Qwen Image 2.1 in ComfyUI: Multi-Image Editing, Text-to-Image & Native Transparency (Workflows Included)

Swapping clothes or changing a background on a character used to give me a major headache. I had to juggle ControlNets, inpainting brushes, and fragile nodes that stitch images together. The new Qwen Image 2.1 changes all of that. It is a single 7B model that handles text-to-image, editing with up…

Annons
Annons
Swapping clothes or changing a background on a character used to give me a major headache. I had to juggle ControlNets, inpainting brushes, and fragile nodes that stitch images together. The new Qwen Image 2.1 changes all of that. It is a single 7B model that handles text-to-image, editing with up to 10 reference photos, and native transparent cutouts without any manual masking. From left to right: original input portrait, garment reference cloak, and the edited character wearing the transferred cloak on an Icelandic beach under the northern lights. In this tutorial, you will learn how to: Run Qwen Image 2.1 locally in ComfyUI for fast image editing and text-to-image. Transfer clothing, props, and backgrounds across multiple reference images by using , , and plain English. Generate transparent PNG stickers and cutouts with native 4-channel RGBA decoding. Remove backgrounds from photos using a single sentence in your prompt. Software needed I will use ComfyUI in this tutorial. It is a free, node-based AI image generator that you can run on your own computer on Windows or Mac, or in the cloud on Google Colab. Think Diffusion provides a fully managed ComfyUI service if your graphics card does not have enough VRAM. (SDA readers get 20% extra credit .) More example outputs Can one checkpoint really handle character swaps, text generation, and transparent cutouts equally well? I put the model through its paces on three common tasks. Example 1: Text-to-Image with Legible Typography Most open-source models struggle with typography. You usually end up with garbled words and missing letters. Because the developers built Qwen Image 2.1 on top of a vision-language foundation, it generates short words and phrases with sharp, readable letters. Text-to-image generation of a woman in an Oslo coffee shop, with an amber neon sign on the wall that clearly spells out “OSLO BREW”. Example 2: Street Character in a Kyoto Alley Next, I tested how well the model handles lighting contrast and fine fabric textures. I generated a man walking down a wet Kyoto alley. The soft glow from the paper lanterns and the weave on his indigo coat came out sharp and lifelike. A man in a rainy alley at twilight, wearing an indigo coat over modern streetwear under glowing paper lanterns. Example 3: One-Step Background Removal & Transparent Cutouts Instead of running a separate segmentation model like BiRefNet or RMBG, you can generate transparent cutouts directly inside Qwen Image 2.1. The latent space includes an alpha channel that separates subjects from their surroundings in a single generation step. Left: original studio portrait with a neutral gray background. Right: clean transparent cutout decoded by the Qwen 2.1 VAE over a dark background. You can also generate stickers and game assets with transparent backgrounds directly from text prompts without any green-screen keying: A transparent PNG sticker generated directly with an alpha channel. What is Qwen Image 2.1? Qwen-Image-2.1 is an open-weights model for image generation and editing that was created by the Alibaba Qwen team. If you tried the earlier Qwen Image releases, you probably remember the frustration. You had to download one 20B checkpoint for text-to-image and an entirely separate 20B checkpoint for editing. Keeping both on your storage drive took up more than 40 GB of disk space. Qwen Image 2.1 fixes that problem by redesigning the entire pipeline: Single 7B transformer: The visual generation model uses 32 layers in a single-stream diffusion transformer. The quantized int8_convrot checkpoint takes up only 6.8 GB on disk, so you can run it comfortably on GPUs with 12 GB or 16 GB of VRAM. Prefix cache for faster sampling: In earlier models, the sampler recomputed the conditioning tokens on every single step during an edit. Qwen Image 2.1 caches the text and image tokens during the first step, which cuts generation time for multi-image edits down to 10 to 13 seconds on an RTX 4090. Native RGBA transparency: The model pairs with an updated 4-channel VAE (qwen_image_2.1_vae_bf16.safetensors). When you ask for a transparent background, the VAE outputs a true alpha channel directly. Up to 10 reference images: The native TextEncodeQwenImage21 node lets you connect up to 10 reference images at the same time. You can refer to each photo directly in your prompt as , , and so on. Multi-Reference Editing Step-by-Step Here is how to set up the workflow for editing with multiple reference images. Step 0: Update ComfyUI Make sure that your ComfyUI installation is up to date. The TextEncodeQwenImage21 and QwenImage21Cache nodes are included directly in recent releases of ComfyUI. Click the Manager button on the top toolbar. Select Update ComfyUI. Restart ComfyUI. Step 1: Download the models Download the three model files below from Hugging Face and place them into their corresponding folders: Download qwen_image_2.1_int8_convrot.safetensors (6.8 GB) and place it in ComfyUI > models > diffusion_models. Download qwen3vl_8b_int8_convrot.safetensors (8.8 GB) and place it in ComfyUI > models > text_encoders. Download qwen_image_2.1_vae_bf16.safetensors (645 MB) and place it in ComfyUI > models > vae. Critical note on the VAE: Do not reuse the older qwen_image_vae.safetensors from last year’s Qwen Image 1.0 workflows. The older VAE is a standard 3-channel RGB autoencoder and cannot decode the 4-channel alpha channel. I recommend that you download the int8_convrot diffusion checkpoint. It gives you full visual fidelity while keeping memory usage under 7 GB. If you want faster 8-step sampling, you can also download the optional qwen_image_2.1_turbo_lora_avg_rank_178_bf16.safetensors (872 MB) into ComfyUI > models > loras. Step 2: Load the workflow Download the ready-to-run workflow file below. Drag and drop it directly into your ComfyUI window to load it. Download If you prefer to start with text-to-image or want to generate transparent PNG images from scratch, download the text-to-image workflow instead: Download Step 3: Install missing nodes Both workflows rely primarily on core nodes. If any node shows a red outline after loading: Click Manager > Install Missing Custom Nodes. Install any missing packages. Restart ComfyUI. Step 4: Upload your reference images In the editing workflow: Upload your primary photo to the first Load Image node (image_1). This image sets the canvas dimensions and serves as your target for editing. Upload your item, garment, or style reference to the second Load Image node (image_2). You can download the two test images below if you want to follow along with the exact example that I used here: Input 1: Target PortraitInput 2: Garment Reference Step 5: Write your edit prompt How you write your prompt makes all the difference. When you edit with multiple images in Qwen Image 2.1, follow this reliable three-part formula: State what stays unchanged: Always begin by locking identity and pose: > Keep the character, facial features, braided platinum-blonde hair, and pose in unchanged… State the transfer or change: Name the source image clearly: > …put the emerald green and gold embroidered fantasy cloak from on the woman in … Describe the setting and integration: Mention how lighting, folds, and the environment should blend together: > …and change the background to an atmospheric Icelandic black-sand beach with misty volcanic cliffs and glowing emerald aurora borealis in the twilight sky, realistic fabric folds, natural cinematic lighting, sharp details. Step 6: Generate the image Click the Queue Prompt button (or press Ctrl + Enter). During the first step, ComfyUI processes your input images and stores the prefix cache. Sampling runs for 25 steps using the euler sampler and the simple scheduler, completing in about 12 to 14 seconds. The finished result: facial identity and braided hair from the portrait are preserved, the cloak texture from the reference transfers cleanly, and the background shifts to a misty Icelandic beach. Settings SettingEffectStepsTotal denoising steps. In my tests, 25 steps gave the best balance between quality and generation speed.CFGClassifier-Free Guidance scale. Keep this value at 1.0 for reliable prompt following.Sampler / SchedulerThe recommended sampling combination (euler / simple) for Qwen Image 2.1.ResolutionSizing on the TextEncodeQwenImage21 node. Leaving this at 0 preserves the native resolution of your input image.Custom Size (switch)Locks canvas dimensions to image_1. Switch this to true only if you need to alter the aspect ratio.Cache DeviceWhere ComfyUI stores the prefix cache. It uses free VRAM first and falls back to system RAM if memory runs short. Tips One-sentence background removal: To remove a background from an image, keep your photo connected to image_1, disconnect image_2, and prompt: "Remove the background, and output a PNG image with a transparent background". Make sure that you save the output as a PNG file so that you keep the alpha channel. Prompts for transparent text-to-image: When you use the text-to-image workflow, wrap your prompt with the official transparency formula from Qwen: "This is an RGBA format image with transparency. [Your description here]. The image has an alpha channel and a transparent background." Do not enable custom_size for in-place edits: In the editing workflow, leave the custom_size switch set to false. If you enable it, ComfyUI forces the canvas to match the dimensions from the ResolutionSelector node rather than image_1. That can cause your subject to shift off-center or crop unexpectedly. Speed up generation with the Turbo LoRA: If you want faster generation, add a LoraLoaderModelOnly node with qwen_image_2.1_turbo_lora_avg_rank_178_bf16.safetensors set to a strength of 1.0. You can reduce your step count from 25 down to 8 steps at CFG 1.0, which cuts generation time to around 4 seconds. Targeted edits with visual markup: You do not need an inpainting mask for small adjustments because Qwen3-VL can process visual markup directly. Draw a rough red circle or arrow over an object in your photo editor before uploading. Then add this sentence to your prompt: “Replace the object inside the red circle in with the item in , and remove the red circle.” It works remarkably well! What’s next ControlNet in ComfyUI Qwen Image Edit with Multiple Images Qwen Image Inpainting How to Remove Watermarks with AI Inpainting Wan 2.2 Text to Image MiniMax H3 Text to Video AI Upscalers Guide The post Qwen Image 2.1 in ComfyUI: Multi-Image Editing, Text-to-Image & Native Transparency (Workflows Included) first appeared on Stable Diffusion Art.

Source: Stable Diffusion Art — Published — Category: Image AI

🔗 Read full article on Stable Diffusion Art →
Annons
Annons