Qwen-Image-2.1: A New Generation Combining Generation and Editing (Native 2K, Transparent Background, 16 Reference Images)
Qwen-Image-2.1 is the latest open-weights release in the Qwen-Image series from Alibaba's Qwen team, and the biggest change of this generation: a single model handles both text-to-image and instruction-based editing—the same weights can generate images from prompts and also edit images based on one-sentence instructions, without switching checkpoints in the workflow. On top of that, it does three things the previous generation couldn't do or couldn't do well: native 2K direct output, professional text layout with dense small text, and a VAE with a built-in alpha channel for directly generating transparent background images.
This page walks you through the official Qwen-Image-2.1 workflow from start to finish: download the three-part model set, load the text-to-image and editing templates from the template library, use Resolution Selector for direct 2K output, write transparent background prompts, connect multiple reference images for outfit changes, and finally switch to Turbo with 8 steps for acceleration.
Relation to the previous two lessons: Qwen-Image base handles generation from scratch, Qwen-Image-Edit handles instruction-based editing, and 2.1 merges the two lines into one model, also replacing the entire text encoder (Qwen2.5-VL 7B → Qwen3-VL 8B); the model files are not compatible with the previous three generations.
What You'll Be Able to Do After Learning
- Load the Qwen-Image-2.1 text-to-image and editing workflows from the official template library, complete the model files, and run your first generation
- Use Resolution Selector to output by aspect ratio + megapixels; 1:1 plus 4MP directly outputs 2048×2048 native 2K
- Write one-sentence instruction-based edits: change background, edit text, swap outfits, with up to 16 reference images from image_1 to image_16
- Generate transparent background PNGs with the official prompt templates, no need to run a cutout model again
- Switch to the Turbo checkpoint or attach the official Turbo LoRA for 8-step output
Your Current Pain Points
- Using Qwen-Image for base images and then opening Qwen-Image-Edit for editing means two model sets totaling thirty-plus GB—too much for both your disk and your workflow
- The previous generation's default output was only 1328×1328 (about 1.8MP); making posters required another upscaling pass, and text turned blurry the moment it was enlarged
- E-commerce assets need transparent backgrounds; after generation you still had to run BiRefNet for a cutout, and the edges always had a ring of white fringe
- For multi-image reference (put this piece of clothing on this person), the previous generation accepted at most 3 images—not nearly enough for outfit sets and scene images
When to Use This Technique
When you need:
- One model covering both "generate from scratch" and "instruction-based editing" tasks, without maintaining two sets of weights
- Native 2K resolution direct output: posters, packaging, infographics, with dense small text still crisp
- Directly generate or edit images with alpha-channel transparent backgrounds
- Multi-reference-image editing: feed in a person image + clothing image + scene image together
And you don't want to:
- Run an upscaling model again after generation to reach 2K
- Put transparent background assets through another cutout workflow
- Download separate model sets for generation, editing, and acceleration
🎒 Preparation Before Starting
- Have taken the previous lesson Qwen-Image-Edit Instruction-Based Editing and know what instruction-based editing is (the model files of 2.1 are not compatible with it, but you can start directly even without taking it)
- Have run your first generation, know how to load templates, and recognize the KSampler and the three Loaders
- Know the model directory rules by heart: what goes in
diffusion_models,text_encoders, andvae(if you forget, revisit where models go) - Reserve about 16GB of disk space: diffusion model int8 version 6.76GB + text encoder 8.71GB + VAE 0.64GB (add another 8.82GB if you want prompt enhancement)
- ComfyUI updated to v0.37 or above (the Turbo templates require v0.39+, and the current stable version v0.43.2 is fine; if you don't know how to update, see troubleshooting overview)
- Your network can reach Hugging Face; if the connection is unstable, use the ModelScope domestic mirror (address given in step 2)
- VRAM reference: int8 weights take about 6.76GB, and when editing large images VRAM usage rises with the number of reference images and the resolution—if it gets tight, go to insufficient VRAM for solutions
Core Idea
Why can 2.1 do both jobs with one model? Text-to-image and instruction-based editing share the same underlying diffusion process; the only difference is the conditioning input: text-to-image feeds only the prompt, while editing "stitches" reference images into the text encoder's input sequence—the Qwen3-VL encoder is multimodal by design, reading images and text together. So 2.1 no longer needs a separately trained Edit branch; the same set of weights switches tasks directly, and the edit template simply wires LoadImage into the image slot of the Text Encode node.
Qwen-Image-2.1 workflow skeleton (text-to-image template, all wrapped in a single "Text to Image (Qwen Image 2.1)" subgraph node):
ResolutionSelector (aspect ratio + megapixels) ──→ subgraph: EmptyLatentImage ─→ KSampler ─→ VAEDecode ─→ SaveImage
CLIPLoader (Qwen3-VL 8B) ──→ TextEncodeQwenImage21 (positive/negative) ─→ KSampler
UNETLoader (2.1 diffusion model) ─→ QwenImage21Cache (KV cache) ─→ KSampler
VAELoader (4-channel VAE) ─→ VAEDecodeThe edit template replaces EmptyLatentImage with the latent output of TextEncodeQwenImage21—this latent's dimensions automatically follow the first reference image (image_1), so you don't have to compute the canvas yourself.
Five official templates, one model family:
| Template name (template library search term) | Task | Steps | Minimum version |
|---|---|---|---|
| Qwen Image 2.1: Text-to-Image | Text-to-image | 25 steps | v0.37.2 |
| Qwen Image 2.1: Image Editing | Instruction-based editing + multi-reference | 25 steps | v0.37.0 |
| Remove Background: Qwen Image 2.1 | Transparent-background cutout | 25 steps | v0.37.0 |
| Qwen Image 2.1 Turbo: Text-to-Image | Accelerated text-to-image | 8 steps | v0.39.0 |
| Qwen Image 2.1 Turbo: Image Editing | Accelerated editing | 8 steps | v0.39.0 |
This generation's parameter preferences differ from the previous one—remember these three points before you start:
- cfg fixed at 1: the official release path is cfg 1, in which case ComfyUI skips the negative conditioning, so a negative prompt is useless even if you write one
- Start at 25 steps: the official original pipeline uses about 40-50 steps, and the templates' reduction to 25 steps is sufficient; even 4-8 steps works for small local edits
- Think of resolution in "megapixels": 1MP ≈ 1024×1024, so a 2K square image is 4MP—stop calculating width and height by hand
Follow Along
Step 1: Load the official Qwen-Image-2.1 workflow template
Why: the official template wraps model loading, sampling, and KV caching into a single subgraph node, so you only face about a dozen exposed parameters instead of wiring from scratch.
Open ComfyUI, search "Qwen Image 2.1" in the Templates sidebar on the left—for text-to-image pick Qwen Image 2.1: Text-to-Image, for editing pick Qwen Image 2.1: Image Editing (the template library's Chinese names depend on your local setup; English search terms are the most reliable).
You should see: the text-to-image template has only three nodes on the canvas—a Resolution Selector (aspect ratio + megapixels), a large subgraph node Text to Image (Qwen Image 2.1), and a Save Image; the edit template is an Image Edit (Qwen Image 2.1) subgraph with a row of image input slots from image_1 to image_10, plus two LoadImage nodes and one Image Compare. If models are missing, nodes turn red and the template tries to auto-download; auto-download often fails on domestic networks, so manually download per step 2.
- Template loaded successfully, with the Resolution Selector and subgraph node on the canvas
Step 2: Download the three-model set and put them in the right directories
Why: 2.1 uses a new Qwen3-VL text encoder and a 4-channel VAE, so its model files are not interchangeable with those of Qwen-Image / Qwen-Image-Edit and need to be downloaded again; however, the five official templates (including Turbo and background removal) share the same set of encoder and VAE, so next time all of them can be used.
Three must-download files (templates load the int8 version by default, which is VRAM-friendly):
| File | Directory | Size |
|---|---|---|
qwen_image_2.1_int8_convrot.safetensors | models/diffusion_models/ | 6.76 GB |
qwen3vl_8b_int8_convrot.safetensors | models/text_encoders/ | 8.71 GB |
qwen_image_2.1_vae_bf16.safetensors | models/vae/ | 644.2 MB |
Pick one of the two download sources (the directory structure is the same; files are under the diffusion_models/, text_encoders/, vae/ subdirectories):
- Hugging Face:
https://huggingface.co/Comfy-Org/Qwen-Image-2.1 - ModelScope domestic mirror (recommended):
https://modelscope.cn/models/Comfy-Org/Qwen-Image-2.1
Once placed, go back to ComfyUI and refresh; the red boxes on the subgraph nodes will disappear.
You should see: the model name dropdown at the top of the subgraph node can select qwen_image_2.1_int8_convrot, and clicking Queue (Ctrl+Enter) no longer throws a missing-model error.
- The three files are in place, the nodes show no red boxes, and the missing-model errors are gone
Step 3: Get your first native 2K text-to-image run working
Why: one selling point of 2.1 is producing 2K directly without an upscaling model — the resolution isn't a manually entered width and height, but a "megapixel" target from the Resolution Selector; get the default value working first before moving up to 2K.
- In the subgraph node's prompt box, write what you want to draw (the template's sample prompt is very long; you can use it for a trial run first)
- Keep Resolution Selector at its defaults:
1:1 (Square)+1megapixels (about 1024×1024) - Click Queue (Ctrl+Enter)
You should see: the progress bar runs 25 steps (cfg 1, euler, simple), and the output image has the prefix Qwen_image_2.1.
Once it works, switch to 2K: change Resolution Selector's megapixels from 1 to 4, keep the ratio at 1:1, and run again.
You should see: the output becomes 2048×2048, with noticeably more solid detail and small text — this is native 2K, with no upscaling model involved in between.
💡 How to pick the resolution
- Pick the ratio in Resolution Selector's aspect_ratio (1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9 — eight options)
- Set the size with megapixels (0.1–16.0): 1MP ≈ 1024×1024, 4MP = 2048×2048 (2K square image)
- The official recommendation is to use pixel values that are multiples of 32; common targets (1MP, 4MP square) happen to work out to exactly that
- Don't push for 4K: going far beyond the 2K training size degrades prompt adherence
- Generate once at 1MP and once at 4MP; both succeed, and 4MP gives 2048×2048
Step 4: Edit an image with a one-sentence instruction and up to 16 reference images
Why: editing is a capability merged into 2.1; reference images are stitched into the text encoder in slot order, and the prompt names them with <image1>, <image2> — this syntax didn't exist in the previous-generation Edit line and is a brand-new interface.
- From the template library, load the Qwen Image 2.1: Image Editing template
- The image_1 slot takes the image to be edited (upload via the LoadImage node; the template's example is a
portrait_model_denim.pngportrait) - From image_2 onward, attach reference images (the example is a
clothing_light_blue_denim_shirt.pngclothing image); you can attach up to image_16, and the official template exposes the first 10 slots - In the subgraph node's prompt, write the instruction, naming slots:
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 pose(Keep the pose of the person in image_1 unchanged, dress the person in the light blue denim shirt from image_2, and preserve the original face shape, hairstyle, body, and pose.)
- Click Queue
You should see: in the output, the person is still the same person, but the clothing is now the denim shirt from the reference image; the template also includes an Image Compare node, where you can drag the slider to compare the original and the result.
💡 Rules for the editing canvas size (the resolution parameter)
resolutionis a total pixel budget, not the width or height:1024means scaling image_1 by its aspect ratio to a total pixel count of about 1024×1024 (e.g., a 3:4 image gets scaled to about 896×1184)- Template default
0: each reference image keeps its own pixel size (aligned to multiples of 32); a 3000×4000 photo gives a canvas of 3008×4000 custom_sizeoff (default): the canvas follows image_1; only when enabled does it use the Resolution Selector's width and height- The bigger the canvas, the slower it runs: in official testing on an RTX 5090, 3008×4000 takes about 6 s/it, while scaling down to about 896×1184 takes only about 0.3 s/it — if editing is slow, first check resolution and the reference image sizes before considering anything else
Only want to change part of the image? Right-click the LoadImage node of image_1 → Open in Mask Editor, use the Paint Pen to paint a few strokes over the area you want to change, then save. The strokes are written back into the image itself (not a mask); in the prompt, call it out by color: "change the jacket in the red area". The marks must be painted within the area you want to change, and if the marking color itself might appear in the output image, also write the desired color into the prompt.
Multiple reference images can do more than outfit swapping—feed a design draft and a real product photo together to make a product mockup; the approach is the same, see Product Mockup for a hands-on walkthrough.
- Outfit swap with two images succeeded; the person's face and pose unchanged
- Try changing resolution from 0 to 1024, and observe faster generation and a smaller canvas
Step 5: Generate a transparent-background image (two paths: text-to-image and editing)
Why: the VAE of 2.1 has 4 channels, so alpha is generated directly in the image with no post-hoc cutout needed—this is a hard requirement for e-commerce assets, and the reason the official release includes a standalone "Remove Background" template.
Route A: generate a transparent background directly via text-to-image. In the prompt of the text-to-image template, use the official template phrasing and replace the middle part with your subject:
This is an RGBA format image with transparency. [a red sneaker, product photography, side view]. The image has an alpha channel and a transparent background.Route B: remove the background of an existing image. From the template library, load the Remove Background: Qwen Image 2.1 template, connect your image to image_1, and the prompt is already written:
Remove the background, and output a PNG imageBoth routes require attention: the output must be saved as PNG (the template's Save Image is already set to png / 8-bit / sRGB); JPEG cannot store the alpha channel—if you save as JPEG, the transparency is gone.
More ways to play with transparent assets (local cutout with BiRefNet, cloud cutout with Bria, background-replacement compositing) are covered in Product Cutout and Background Replacement.
You should see: the output shows transparent areas over a dark checkerboard background; drag the file into PS / GIMP and the layer carries an alpha channel.
- Route B works end to end: a real photo successfully gets its background removed, and the PNG carries an alpha channel
Step 6: Switch to Turbo, generate in 8 steps
Why: Turbo is a distilled checkpoint of the same model with a fixed 8-step schedule, taking roughly one third the time of the 25-step version—the difference feels huge during batch generation and repeated rerolls.
Method A (recommended): switch to the Turbo template directly. From the template library, load Qwen Image 2.1 Turbo: Text-to-Image or Qwen Image 2.1 Turbo: Image Editing, which swaps the diffusion model to qwen_image_2.1_turbo_int8_convrot.safetensors (6.76 GB, same size as the int8 base); sampling uses a fixed 8-step ManualSigmas schedule—the step count can't and shouldn't be changed.
Method B: attach the Turbo LoRA to the base template. If you don't want to download another 6.76GB, download qwen_image_2.1_turbo_lora_avg_rank_178_bf16.safetensors from the official repo (the loras/ directory of Comfy-Org/Qwen-Image-2.1) and put it in models/loras/; in the subgraph, add a LoraLoaderModelOnly node on the model line to load it, then change the subgraph node's steps to 8, leaving sampler/scheduler at euler/simple untouched.
You should see: the progress bar finishes in only 8 steps; quality on dense-layout tasks like text posters remains solid (the Turbo template's example prompt is a two-line large-text poster reading "QWEN IMAGE / 2.1 TURBO"—you can use it first to verify).
⚠️ Turbo's 8 steps are "locked"
The Turbo template hardcodes the distilled schedule in a ManualSigmas node (1.0, 0.978453, 0.95418, 0.926626, 0.89508, 0.845148, 0.704534, 0.414568, 0). To add steps you must swap the schedule along with them; changing the step count alone is meaningless. The base model has no such restriction—25 → 40 steps can be adjusted at any time.
- Turbo generates an image in 8 steps, taking about one third the time of the 25-step version
Checkpoint ✅
- Template loads successfully: Resolution Selector + subgraph node + Save Image, no red boxes
- The trio is in place: the 2.1 diffusion model in
diffusion_models, Qwen3-VL intext_encoders, and the 4-channel VAE invae - 1:1 + 4MP directly outputs 2048×2048, without going through any upscale node
- The editing template calls out reference images with
<image1>/<image2>, and the outfit swap succeeds - The transparent-background PNG shows transparency over the checkerboard, and the file carries an alpha channel
- Turbo generates normally in 8 steps
Pitfall reminders
❌ Negative prompts have no effect
When cfg is 1, ComfyUI skips the negative conditioning computation entirely, so whatever you write in negative_prompt is ineffective—this is by design in the 2.1 official release path, not a bug. To make the negative prompt take effect you must raise cfg: the official reference is cfg 2, which adheres better to dense text and small numbers but with overly sharp edges; cfg 5 visibly degrades quality, and 0.5 outright breaks the image. Before raising cfg, fix the seed for comparison and change only one value at a time.
❌ Image editing is so slow it seems frozen
Check two things before blaming your GPU: is the subgraph node's resolution set to 0 (each reference image enters the canvas at its original pixel size, so a few 3000×4000 images stacked together mean sampling starting at 12MP); and are the reference images numerous and large (multiple images lengthen the text-encoding sequence and put more pressure on the KV cache). Set resolution to 1024, and in official testing the speed recovers from about 6 s/it to about 0.3 s/it. If it's still slow, tweak the Qwen Image 2.1 Cache node: set device to cpu (uses memory prefetch with almost no speed loss), or set dtype to int8 (cache halved, precision close to bf16).
❌ With prompt enhancement enabled, the generated image doesn't match the prompt at all
When refine_prompt is enabled, what actually gets fed to the image model is the prompt rewritten by the enhancement model, not the sentence you wrote. The rewrite quality depends on max_length: the template default is 4096, while the enhancement model's reasoning block (thinking) consumes a lot of tokens—when the budget is exhausted by reasoning, the rewrite result becomes an empty string, and the image model samples with an empty prompt, so the edited image is returned unchanged. The official enhancement model's recommended values are t2i 16256 / i2i 24000. The correct order: first raise max_length to the official value, then enable thinking_mode, and finally enable refine_prompt, and use the Preview Any node in the subgraph to see the actually effective prompt. Note that the waiting time will also increase accordingly.
❌ Transparent image errors out when connected to other nodes
2.1 The decoded image has 4 channels (RGB+alpha). Many nodes written for 3 channels (upscale, some compositing nodes) will throw an error when they receive it, and the error appears on downstream nodes, which makes it easy to misdiagnose that node as broken. The fix: insert a SplitImageWithAlpha node after VAEDecode, feed the RGB output to the three-channel nodes, and route the alpha separately. Both nodes use the mask convention "1 = transparent", so SplitImageWithAlpha's mask output can be connected directly to JoinImageWithAlpha's alpha input.
Advanced Tips (Optional)
How to tune steps without wasting them. 25 steps is the "good enough" tier, not the optimal one: the official pipeline uses 40-50 steps; for small local edits like changing a clothing color, 4-8 steps suffices, several times faster than the default; stubborn details like hands and fingers converge at around 30 steps, and 25 → 40 steps reduces fizz at detail areas (soft details, fuzzy edges). Principle: adjust only what's wrong; if nothing is wrong, don't touch it.
KV cache node (Qwen Image 2.1 Cache). Every sampling step in the editing workflow recomputes the text + reference image prefix; this experimental node caches the prefix in VRAM or memory to skip recomputation. device: auto (default, uses free VRAM first, then memory) / gpu / cpu (memory prefetch, almost no speed loss) / off (recompute every step, used when troubleshooting to rule out cache issues); dtype: default lossless / int8 halves the cache with precision close to bf16 / int4 halves it further but roughly doubles the per-step error. The template defaults (auto + default) work out of the box for most configurations.
Fixing checkerboard artifacts by swapping the VAE. Dense detail areas in photo-style images may show fine checkerboard textures—this is an artifact of the VAE decoder, and adding steps won't fix it. Community author madebyollin fine-tuned the same decoder: texture_fix_vae_for_qwen_image_2.1_bf16.safetensors (an unofficial file). Put it into models/vae/, and select it in the Load VAE node as a replacement; the trade-off is slightly lower reconstruction accuracy.
Lightning 4-step LoRA. Besides the official Turbo, community author lightx2v released a 4-step distilled LoRA (Qwen-Image-2.1-Lightning, unofficial): download pytorch_lora_weights.safetensors and put it into models/loras/, attach it with LoraLoaderModelOnly, change steps to 4, and keep sampler/scheduler as euler/simple. Note that its schedule is fitted for 1024×1024, so other output sizes will match more loosely.
The right way to use Prompt Enhancer. Both t2i and the editing template include an optional prompt-rewriting branch: a dedicated Qwen 3.5 encoder (t2i uses ..._pe_t2i..., editing uses ..._pe_i2i..., each 8.82GB) expands your single sentence into a full description. It's off by default; to use it, follow the order in "pitfall 3". The system prompt the rewriting follows is in the Text (System Prompt) node in the subgraph—edit it if you want to change the rewriting style. The background removal template does not have this branch, so don't go looking for it.
Lesson Summary
✅ Looking back at the goals from the beginning, you can now:
- Load the five official templates of the Qwen-Image-2.1 workflow (text-to-image / editing / background removal / Turbo ×2), get the three essentials set up and running
- Use Resolution Selector's megapixel output, 4MP native output at native 2K
- Edit images with one-sentence instructions,
<image1>…<image16>with up to 16 reference images addressed by slot - Use the RGBA template phrasing for text-to-image and the official background removal template for editing, outputting transparent-background PNGs directly
- Switch to the Turbo checkpoint or attach the Turbo LoRA, generating images in 8 steps
Key parameters recap:
| Parameter | Recommended value | Description |
|---|---|---|
| cfg | 1 | Official path; negative prompts have no effect at this point—raising cfg is what makes them work |
| steps | 25 (base) / 8 (Turbo) | Base is adjustable within 4-50; Turbo is locked to 8 steps with a fixed schedule |
| sampler / scheduler | euler / simple | Consistent across all official templates |
| megapixels | 1 (default) → 4 (2K square) | The size target of Resolution Selector |
| resolution (editing) | 0 (default) or 1024 | 0=follows the reference image's original size; 1024=total pixel budget, faster |
| refine_prompt / thinking | off / off | Before enabling, raise max_length from 4096 to the official value |
| cache device / dtype | auto / default | Use cpu or int8 when VRAM is tight |
Next Lesson Preview
That wraps up the Qwen family. The next lesson moves to another mainstream family: FLUX.1 text-to-image: local deployment of dev and schnell. You will learn:
- FLUX.1 the positioning differences between the dev and schnell versions, and which scenarios each is suited for
- VRAM trade-offs between full checkpoints and fp8 versions
- FLUX-style prompt writing (a completely different flavor from Qwen)
- Later lessons like Kontext consistency editing and Fill inpainting are built on top of this one