
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.
GET https://comfy.org/workflows/download/57eb4f2ddb92.jsonFetching workflow JSON…
Run it from Python or TypeScript with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.
# Install (beta)
pip install comfy-sdk # Python
npm i @comfyorg/sdk # TypeScript
# Run "Swap Product Into a Reference AD" (Python)
from comfy_sdk import Comfy
client = Comfy(api_key="comfyui-...")
# This workflow, exported in API format (see note below)
wf = client.workflows.from_file("templates-product_ad-v2.0_api.json")
asset = client.assets.from_file("input.png")
wf.set_input("2", "image", asset) # LoadImage
job = client.run(wf)
for output in job.get_outputs("9"): # SaveImage
output.to_file(output.name)The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API). API access requires a Comfy Cloud plan with an API key. SDK docs · Get an API key
FAQ














