Image and video generation
Last updated
Qwen-Image 2.1: local image generation and editing
Create an image with Qwen-Image 2.1, then edit what you need
Qwen-Image 2.1 generates images from written scene descriptions and edits existing images using references and edit instructions. Run the generator together with the Qwen3-VL-8B encoder and its dedicated VAE1.
Suppose you want a green ceramic teapot on a wooden shelf with room for a title on the right. Generate one image from text first; if the product shape and composition work, use reference editing to change only a detail such as the background color. Changing one condition at a time makes it easier to see whether the handle, shadow, or product position shifted.
Create one image from text and edit only what needs changing
The official model card describes text-to-image, image editing, transparent-background output, and up to 10 reference images. Apps and nodes do not necessarily expose the same features, so verify that your installed version supports 2.1 editing and alpha output. If you plan to composite a PNG, check that its alpha channel remains and that edges look clean against both light and dark backgrounds.
Version 2.1 consists of a 7B image-generation model, a Qwen3-VL-8B text encoder, and a dedicated VAE. Do not relabel the earlier 2512 checkpoint2 and VAE; use the app's 2.1 workflow and model configuration. A GGUF3 distribution may contain only the generation model, so check whether the runtime4 requires separate encoder and VAE paths.

On an RTX 5090, start with the dedicated LightX2V container
LightX2V announced day-0 support on September 20, 2026. Pull the CUDA5 13.0 container tag for RTX 5090, download the model, then align repository and script paths inside the container. Update the repository/model paths and the quantized-checkpoint paths in the JSON first.
The official single-5090 example uses FP166 accumulation for FP87 DiT8, FP8 QwenVL weights, text-encoder offload9, and VAE compilation. This is not a generic recipe for FP8 files from another framework or the 2511 Lightning LoRA10. Conversion expects the qwen_image_21_dit format and an SM120 FP16-accumulation kernel, so container, kernel, and conversion settings must match.
Prepare Git, Docker, the Hugging Face CLI11 and NVIDIA Container Toolkit on the host PC first. The first block downloads the repository and model into a workspace and mounts that folder at /workspace in the container. Run the second block inside the container. Set the script's lightx2v_path to /workspace/LightX2V and model_path to /workspace/Qwen-Image-2.1, and save the JSON's quantized checkpoint paths to match the actual files. Results are in LightX2V/save_results.
mkdir -p qwen-image21-workspace
cd qwen-image21-workspace
git clone https://github.com/ModelTC/LightX2V.git
hf download Qwen/Qwen-Image-2.1 --local-dir ./Qwen-Image-2.1
docker pull lightx2v/lightx2v:26062001-cu130-5090-fix-260921
docker run --rm --gpus all --ipc=host -it -v "$PWD:/workspace" -w /workspace/LightX2V --entrypoint /bin/bash lightx2v/lightx2v:26062001-cu130-5090-fix-260921cd /workspace/LightX2V
# Save lightx2v_path, model_path and quantized checkpoint paths in the script/config first.
bash scripts/qwen_image_21/qwen_image_21_t2i_5090_1k.sh
# For reference-image editing, use qwen_image_21_i2i_5090_1k.shInspect the workflow alongside its output
These are Qwen-Image 2.1 examples published by Comfy Org, not outputs or timing measurements produced by this site.



Before

After
Check the scope behind the published RTX 5090 timings
LightX2V reports 5.586 seconds for 1024×1024 T2I and 6.804 seconds for I2I on one RTX 5090. At 2048×2048 the figures are 30.333 and 42.787 seconds. Conditions are PyTorch12 2.11.0+cu130, 40 steps, seed 42, and CFG13 disabled; the figures are medians of three runs after the initial request. Image saving is included, while model loading and first initialization are excluded. Your reference image or CFG settings may differ.
Scroll sideways to compare all columns.
| GPU | Workload | Output size | Median after initialization |
|---|---|---|---|
| RTX 5090 ×1 | T2I | 1024×1024 | 5.586 s |
| RTX 5090 ×1 | I2I | 1024×1024 | 6.804 s |
| RTX 5090 ×1 | T2I | 2048×2048 | 30.333 s |
| RTX 5090 ×1 | I2I | 2048×2048 | 42.787 s |

Verify saving and editing with a single 1K image
In the T2I script, set the prompt14, seed, and output path, then generate one image. For I2I, set image_path and the prompt. To size output automatically to the input aspect ratio, the documentation says to remove --size. When specifying it manually, use --size HEIGHT WIDTH; each dimension is rounded down to a multiple of 32. After the file saves, run an edit that changes only the background and compare product shape and edges.
If an error occurs, check that the container can access the GPU15 and that the model root and JSON paths for dit_quantized_ckpt and text_encoder_quantized_ckpt exist. Initialization can fail if the SM120-specific FP16-accumulation kernel or converted text encoder is missing. RUN pipeline16 cost in the logs marks elapsed runtime after execution begins. Errors before that point call for checking kernels, checkpoints, and paths first.

Check Mac support and usage rights separately
LightX2V timings use the RTX 5090 CUDA path. On a Mac, check a separate route such as ComfyUI GGUF or stable-diffusion.cpp, and verify that the installed version supports 2.1, its encoder, and dedicated VAE. Do not apply CUDA-container or RTX 5090 timings to Apple Silicon. Earlier 2512 guidance and LightX2V acceleration claims for Qwen-Image-Edit-2511 are not 2.1 measurements.
Qwen-Image 2.1 was released on September 20, 2026, under the Qwen Research License. Unlike the earlier Qwen-Image Apache-2.0 terms, it is limited to non-commercial research and evaluation. Commercial projects require a separate license; check the weights and tools independently. Identify whether your use needs background replacement, transparent PNGs, or text rendering, and review that output quality directly.
Terminology notes
VAE — Short for Variational Autoencoder. It can encode input into a compact latent representation or decode that representation into an output.
Back to the textCheckpoint — A file containing saved model weights and related state. Versions or tasks in one model family may use different checkpoints.
Back to the textGGUF — A file format for model data, widely used by llama.cpp-based tools.
Back to the textRuntime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.
Back to the textCUDA — A software platform for general-purpose computing on NVIDIA GPUs.
Back to the textFP16 — A 16-bit floating-point format. It uses the same bit width as BF16 but allocates bits differently between exponent and significand.
Back to the textFP8 — A floating-point format that represents each value with 8 bits.
Back to the textDiT — Short for Diffusion Transformer: a model architecture that uses a transformer to refine noisy representations across diffusion steps.
Back to the textOffloading — Moving some model data from GPU memory to system RAM or storage when capacity is limited. This adds data transfer.
Back to the textLoRA — A method that learns and applies small additional weights to adapt a base model. The adapter is used with the base model for purposes such as style adaptation or few-step generation.
Back to the textCLI — Short for Command-Line Interface: operating a program by entering commands in a terminal.
Back to the textPyTorch — A software framework for building and running AI models. Check the compatible PyTorch version and hardware support along with the model.
Back to the textCFG — A technique that combines conditioned and unconditioned predictions to adjust how generation follows its input. Distilled models may require it to be disabled; recommended values vary by model.
Back to the textPrompt — The input text sent to a model. For generative models it describes the desired result and strongly shapes the output.
Back to the textGPU — A processor designed to handle many calculations in parallel. It performs model computations during AI inference.
Back to the textPipeline — A sequence of processing stages from input to output. Different models or tools may be used at each stage.
Back to the text
Frequently asked questions
- What should you check first in this article?
- Qwen-Image 2.1 generates images from written scene descriptions and edits existing images using references and edit instructions. Run the generator together with the Qwen3-VL-8B encoder and its dedicated VAE.
- Where can you check the conditions and sources?
- The official model card describes text-to-image, image editing, transparent-background output, and up to 10 reference images. Apps and nodes do not necessarily expose the same features, so verify that your installed version supports 2.1 editing and alpha output. If you plan to composite a PNG, check that its alpha channel remains and that edges look clean against both light and dark backgrounds.
Read next
Image and video generation
Qwen-Image-2.1-Turbo: How Do You Generate and Edit Images in 8 Steps?
Image and video generation
Run Pruna-Qwen-Image-2.1 locally: choosing its 5- or 8-step adapter
Image and video generation
Make your first image locally with FLUX.3 Klein
Model setup recipes
Qwen-Image 2.1 GGUF download: choosing Q4_K_M, Q8_0 and the VAE
