This workflow demonstrates image-to-image editing with Qwen-Image-2.1 by feeding two reference images into a single checkpoint that handles both generation and editing. The first image (image_1) is your base subject, and the second image (image_2) is the visual guide for what you want to change—such as clothing, style, or material. A ResolutionSelector node controls canvas size: by default it preserves image_1’s aspect ratio at approximately resolution×resolution (default 1024, rounded to a multiple of 32). Qwen-Image-2.1 supports native 2K (2048×2048) output, or you can set resolution to 0 to keep the original pixel dimensions (again rounded to a multiple of 32).
Technically, the LoadImage nodes feed both references into the Qwen-Image-2.1 checkpoint node (bc1c967a-7f6a-4be9-a372-dad16e4f28e3), which fuses them to produce an edited image anchored to the content of image_1 and guided by the appearance, style, or cutout mask in image_2. This makes it well-suited for character-consistent edits, product cutout compositing with real transparency (when your guide image has an alpha channel), and style-transfer passes at high resolution. The ImageCompare node shows before/after frames side-by-side for quick review, and SaveImageAdvanced lets you export clean PNGs to preserve transparency. MarkdownNote and Note nodes in the graph provide inline tips, and the Qwen edit block is organized as a Subgraph for easy navigation.
API
通过代码使用此工作流
每个 Comfy 工作流都是一个 JSON 图。下面的内容就是此工作流的完整数据,ComfyUI 运行时也是如此——你可以从该 URL 获取、放入版本控制,或在 ComfyUI 中加载并逐节点运行。
使用 Comfy SDK 从 TypeScript 或 Python 运行。相同代码可用于 Comfy Cloud 或你自托管的 ComfyUI——只需更改基础 URL。
// Install (beta)
npm i @comfyorg/sdk
// Run this workflow (TypeScript)
import { Comfy } from "@comfyorg/sdk";
const client = new Comfy({ apiKey: "comfyui-..." });
const wf = await client.workflows.fromFile("workflow_api.json");
const job = await client.run(wf);
await job.getOutputs("<output-node-id>")[0].toFile("output.png");SDK 需要 API 格式的工作流:在 ComfyUI 中打开此工作流,使用 文件 → 导出工作流(API)。
















