Qwen Image 2.1: Image Edit - After
Qwen Image 2.1: Image Edit - Before

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

Use este workflow a partir do código

Todo workflow Comfy é um grafo JSON. O payload abaixo é este workflow, exatamente como o ComfyUI executa — obtenha-o pela URL, mantenha-o no controle de versão ou carregue-o no ComfyUI e execute nó por nó.

5fbe136ba6f9.json
Buscando workflow JSON…

Execute a partir de TypeScript ou Python com o Comfy SDK. O mesmo código serve para o Comfy Cloud ou um ComfyUI hospedado por você — apenas a URL base muda.

// 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");

O SDK utiliza um workflow no formato API: abra este workflow no ComfyUI e use Arquivo → Exportar Workflow (API).

O acesso à API do Comfy Cloud requer um plano com chave de API.

Ver todos os workflows
Showing 30 of 30 templates