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
Utiliser ce workflow depuis le code
Chaque workflow Comfy est un graphe JSON. Le contenu ci-dessous est ce workflow, exactement comme ComfyUI l’exécute — récupérez-le depuis l’URL, gardez-le dans le contrôle de version, ou chargez-le dans ComfyUI et exécutez-le nœud par nœud.
Exécutez-le depuis TypeScript ou Python avec le Comfy SDK. Le même code cible Comfy Cloud ou un ComfyUI auto-hébergé — seule l’URL de base change.
// 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");Le SDK prend un workflow au format API : ouvrez ce workflow dans ComfyUI et utilisez Fichier → Exporter le workflow (API).
L’accès à l’API Comfy Cloud nécessite un forfait avec clé API.
















