Swap Product Into a Reference AD

This ComfyUI workflow, titled 'Swap Product Into a Reference AD,' is designed to help users create compelling static advertisements by seamlessly integrating their products into the style of a reference advertisement. Leveraging advanced image processing nodes and models like Gemini3 Pro Image Preview and Nano Banana Pro, this workflow allows for precise style transfer and product placement. The workflow begins with loading an image using the LoadImage node, which serves as the reference style. The GeminiImage2Node then processes the product image, aligning it with the stylistic elements of the reference ad. The RegexReplace node can be used to adjust textual elements, ensuring that the final output maintains the desired aesthetic consistency. The ResizeAndPadImage node ensures that the product image fits perfectly within the ad's dimensions, while the SaveImage node allows users to easily save the final output. This workflow is particularly useful for marketers and designers looking to create visually cohesive advertisements quickly and efficiently.

API

Use this workflow from code

Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.

templates-product_ad-v2.0.json
Fetching workflow JSON…

Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

// Install (beta)
npm i @comfyorg/sdk

// Run "Swap Product Into a Reference AD" (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });

// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("templates-product_ad-v2.0_api.json");

const asset = client.assets.fromFile("input.png");
wf.setInput("2", "image", asset); // LoadImage

const job = await client.run(wf);
await job.getOutputs("9")[0].toFile("output.png"); // SaveImage

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).

Comfy Cloud API access requires a plan with an API key.

FAQ

Frequently Asked Questions

View all workflows
Showing 30 of 30 templates