Editing guide · checked Oct 27, 2026
Edit images with Qwen Image 2.1 in ComfyUI
Qwen-Image-2.1 edits with the same model that generates: you give it the image to change, up to nine more reference images and an instruction. This guide covers the official edit template, how to point at each image, the resolution setting that decides speed, marking a region, background removal, inpainting with a mask and the common problems.
What it can edit
Qwen's model card: “Support up to 10 reference images, specify local edits via circles, painted annotations, or separate masks, and preserve identity for people and products.” Its VAE carries an alpha channel, so it also edits transparent layers and extracts subjects from photos.
Qwen's showcase includes circle-guided edits of several regions at once (remove a watch, change hair color, replace clothing), a group photo made from six portraits, an outfit assembled from five reference images, a panorama from a selfie and a storyboard from a three-view character sheet. Qwen publishes no list of edit types beyond these examples.
Sources: Qwen/Qwen-Image-2.1 · QwenLM/Qwen-Image-2.1
The official edit template
Open Qwen Image 2.1: Image Edit from ComfyUI's Template Library; Turbo has its own edit template that samples in 8 steps. Its settings next to Qwen's own pipeline:
| Setting | ComfyUI template | Qwen's pipeline |
|---|---|---|
| Steps | 25 | 40 |
| CFG | 1, so the negative prompt is unused | 1 |
| Sampler | euler, simple scheduler | euler |
| resolution | 0: each image keeps its own size, rounded to a multiple of 32 | 2048×2048 output by default |
| Reference images | 10 inputs wired; the node takes 16 | Up to 10 |
| Prompt enhancer | Off; max_length 4096 when switched on | Recommended: thinking on, 24,000 tokens |
It loads the standard model's three files (int8 diffusion model, int8 text encoder, VAE) and also lists the editing prompt enhancer, qwen3.5_9b_qwen_image_2.1_pe_i2i.int8_convrot (9.47 GB). The enhancer is off by default, but ComfyUI checks every loader's file before a run, so without it the template stops with “Value not in list”: download it, or its 6.72 GB w4a8 version and select that.
Download the edit workflow JSONSources: image_qwen_image_2_1_image_edit.json · ComfyUI nodes_qwen.py · QwenLM/Qwen-Image-2.1 · docs.comfy.org
Pointing at each image
image_1 is the image you edit, and it sets the output size; the other inputs supply content and can have any size or aspect ratio. Name them in the instruction by slot number, <image1>, <image2> and so on: the text encoder places each image before your prompt in slot order under that tag. ComfyUI's docs give this example for putting the shirt from the second photo on the person in the first:
Keep the character and pose in <image1> unchanged, put this light blue denim shirt from <image2> on the character, preserve the original facial features, hair, body shape and poseFor local edits, ComfyUI's docs: “describe the object or region to change and the rest of the image is preserved.” The editing prompt enhancer uses the same tags, as in its example “Place <image1>'s subject into <image2>'s scene”.
Sources: docs.comfy.org · image_qwen_image_2_1_image_edit.json
The resolution setting
On the Text Encode Qwen Image 2.1 node, resolution is a pixel budget, not a width: each reference is resized to about resolution × resolution pixels, keeping its aspect ratio, at multiples of 32. The node's default is 1024; the edit templates ship 0, which keeps every image at its own size. With custom_size off, the template default, the output takes image_1's size, so this setting decides how long an edit takes:
| resolution | A 3000×4000 photo becomes | Per step on an RTX 5090 |
|---|---|---|
| 0 (template) | 3008×4000, about 12 MP | about 6 s |
| 1024 (node default) | about 896×1184, about 1 MP | about 0.3 s |
A lower value gives a smaller image faster; it doesn't add detail. ComfyUI's docs warn that targets well above the model's 2K training size, such as 4K, lose prompt adherence. If you turn custom_size on and set width and height yourself, keep them close to the resized image_1, or the edit can shift. One open bug: when the node lands on exactly 1024, through resolution 1024 or a 1024-pixel image_1 at 0, edits can fill with coloured speckle; the reporter found 992 and 1056 clean (ComfyUI #16435).
Sources: ComfyUI nodes_qwen.py · docs.comfy.org · ComfyUI #16435
Marking the region to change
ComfyUI's Qwen nodes have no mask input. Qwen's card mentions circles, painted annotations and separate masks but doesn't document how a separate mask is passed. ComfyUI's docs mark the region on the image itself:
- Right-click the Load Image node that supplies image_1 and choose Open in Mask Editor.
- Paint over the region with the Paint Pen and save. Paint Pen strokes go onto the image's colors, not into the mask.
- Name the mark's color in the instruction, for example “change the jacket in the red area”.
Keep the mark inside the region you want changed. If the mark's color shows up in the result, also state the color you want in the prompt.
Sources: docs.comfy.org · Qwen/Qwen-Image-2.1 · ComfyUI nodes_qwen.py
Removing a background
The background removal template, Remove Background: Qwen Image 2.1, runs the same edit subgraph without the prompt enhancer and with this instruction, then compares the result with the original:
Remove the background, and output a PNG imageComfyUI's docs: “the transparent background is generated into the alpha channel rather than cut out afterwards.” Save as PNG to keep the transparency. Nodes written for three-channel images can fail on the four-channel output; put Split Image with Alpha after VAE Decode and feed them its RGB output.
Sources: image_qwen_image_2_1_background_removal.json · docs.comfy.org
The prompt enhancer for edits
Qwen-Image-2.1-PE-I2I is a fine-tuned Qwen3.5-VL 9B that “takes a vague editing instruction plus input image(s) and produces a precise, actionable prompt”. In the edit template it runs when refine_prompt is on. Turn thinking on with it: the template note says the checkpoint “was trained with a reasoning block and loses quality without it”.
The template caps max_length at 4096 tokens so a rewrite can't run for minutes; Qwen's setting for editing is 24,000. When the reasoning uses up the budget, the enhancer returns an empty string and the edit comes back close to its input (ComfyUI's docs). If that happens, raise max_length.
Sources: Qwen/Qwen-Image-2.1-PE-I2I · image_qwen_image_2_1_image_edit.json · docs.comfy.org
Inpainting with a mask
For classic mask inpainting there is alibaba-pai's Qwen-Image-2.1-Fun-Controlnet-Union, which adds a mask channel next to eight control types. Its rules: the mask is “white where the content should be re-generated and black where it should be kept”, and the prompt describes the whole target image, because the mask, not the text, marks the region. Its examples use 40 steps, guidance 1.0 and control_context_scale 1.0.
ComfyUI has no official template for it. Put the file in models/model_patches and load it with Load Model Patch. For inpainting, apply it with Apply Fun ControlNet, which has inpaint_image and mask inputs; Apply Qwen Image DiffSynth ControlNet takes a mask but no image to inpaint. Both send a Qwen-Image-2.1 patch through the same code, which repaints where the mask is 0.5 or more. We read this wiring from ComfyUI's node code; no official example shows it yet.
Sources: alibaba-pai/Qwen-Image-2.1-Fun-Controlnet-Union · ComfyUI nodes_model_patch.py · ComfyUI PR #16519
Edit problems and fixes
Problems reported with editing in ComfyUI, with the fix for each.
Edits come out etched, over-sharpened or full of grain
If Qwen-Image-2.1 generated the image with the same seed, the edit replays that noise pattern. Use a different seed for the edit; the reporters of ComfyUI #16607 and Qwen discussion #61 confirmed this fixed it.
Coloured speckle in the background of edits at resolution 1024
Open bug (ComfyUI #16435): when the encode node lands on exactly 1024, through resolution 1024 or a 1024-pixel image_1 at resolution 0, the subject gets over-sharpened and the background fills with speckle. Set resolution to 992 or 1056; the reporter found both clean.
With refine_prompt on, the edit comes back almost unchanged
The enhancer's reasoning used up max_length (4096 in the template) and returned an empty prompt. Raise max_length; Qwen's own setting for editing is 24000.
The edited image is shifted to the left
The reporter of ComfyUI #16496 found it only happens with Viggle's 4-step LoRA. Remove that LoRA, or use Comfy-Org's Turbo model for speed.
Edits ignore the prompt on an 8 GB GPU with 16 GB of RAM
Open (ComfyUI #17187): on ComfyUI 0.42.0, not 0.41.0, an 8 GB laptop GPU produced edits that ignored the instruction. Users linked it to a race in memory offloading that PR #17297 fixed in ComfyUI's development branch on Oct 22; that fix is not in a release as of v0.42.5, and no one has confirmed it cures this report.
Mac: edits are noisy or embossed and ignore the references
A PyTorch bug on Apple GPUs breaks VAE encoding at 1024×1024 and above, which damages every edit input. Start ComfyUI with --cpu-vae, or use a PyTorch 2.15 build, which has the fix (ComfyUI #16433).
Fatal Python error: Aborted during an edit
Open on Windows, mostly with large reference images (ComfyUI #16443). Users stopped it with smaller references, or by switching the Qwen Image 2.1 Cache node's device from auto to gpu.
Sources: ComfyUI #16607 · Qwen-Image-2.1 discussion #61 · ComfyUI #16435 · ComfyUI #16496 · ComfyUI #17187 · ComfyUI PR #17297 · ComfyUI #16433 · ComfyUI #16443 · docs.comfy.org