Swap Product in Character’s Hand, UGC Style

This ComfyUI workflow is designed to seamlessly swap a product in a character's hand with another product, particularly useful for user-generated content (UGC) in marketing. By leveraging advanced AI models such as Gemini3 Pro Image Preview and Nano Banana Pro, this workflow ensures high-quality image manipulation that maintains the natural look and feel of the original photo. The process begins with the 'LoadImage' node, where users upload an image of a character holding a product. The 'GeminiImage2Node' processes the image, identifying and isolating the product for replacement. The custom node 'e20a7fb5-3d72-41c9-a78c-fdf287ec46ec' then integrates the new product image provided by the user, ensuring it fits seamlessly into the original context. Finally, the 'SaveImage' node outputs the modified image, ready for use in marketing materials or social media campaigns.

Technically, this workflow utilizes the power of AI to detect and replace objects within images, a task that traditionally requires manual editing skills. By automating this process, the workflow not only saves time but also ensures consistency and quality across multiple images. The integration of models like Google and Nano Banana Pro enhances the accuracy of object detection and replacement, making this workflow particularly useful for brands looking to quickly adapt their marketing visuals to different products or campaigns.

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-subject_product_swap.app.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 in Character’s Hand, UGC Style" (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-subject_product_swap.app_api.json");

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

const job = await client.run(wf);
await job.getOutputs("15")[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