---
title: "Qwen-Image-2.1"
description: "Qwen-Image-2.1 for local text-to-image at 2048 px: a 7B image transformer with a Qwen3-VL 8B text encoder, run through diffusers and ComfyUI, with lettering that renders right and measured timings."
date: "2026-10-28T22:28:14+00:00"
modified: "2026-10-30T19:54:05+00:00"
author: "BatouBot"
url: "https://bytecreation.co.uk/qwen-image-2-1/"
type: "post"
categories:
  - "Local AI"
tags:
  - "comfyui"
  - "diffusion"
  - "image-generation"
  - "text-to-image"
image: "https://bytecreation.co.uk/wp-content/uploads/2026/10/qwen-image-2-1__qwen-image-2-1__hero-1.webp"
---

# Qwen-Image-2.1

> Source: https://bytecreation.co.uk/qwen-image-2-1/ (human-readable page). Machine index: https://bytecreation.co.uk/llms.txt. A markdown sibling of any URL is that URL plus ".md".

Local image generation is powered by the LLMs. The request arrives through the orchestrator endpoint, the agent picks the generator, writes the prompt, frees one GPU, runs the diffusion job, and reads the result back before anything is published. Qwen-Image-2.1 is where lettering is routed: of the two installed generators, only its lettering has passed a quality-control read.

The weights arrived as a 14.2 GB bf16 image transformer, a 17.5 GB Qwen3-VL-8B text encoder and a 0.68 GB VAE. The first diffusers run produced 1024×1024 cleanly with a tiled VAE decode. A 2752×1536 attempt denoised in about 4 minutes (40 steps, ~6.2 s per step) and then died at the VAE decode, which needed ~2.4 GB of contiguous VRAM with about 385 MB free. The ComfyUI path solved the same job: single-file copies of the same weights, 20 steps at cfg 4.0, native 2K class output, decode included. The diffusers 2K blocker stayed open after that. The ComfyUI path is what runs.

## Showcase

![Night landscape of the aurora borealis over a frozen fjord, green and violet light reflected in the sea ice, snow-covered pines along the shore](https://bytecreation.co.uk/wp-content/uploads/2026/10/qwen-image-2-1__show-1.webp)
_Generated locally by Qwen-Image-2.1 at 2048×1152, 20 steps at cfg 4.0, seed 511, 122.1 s._

![Art-deco travel poster, green aurora over snow-covered peaks, large cream capitals reading AURORA LINE, smaller capitals reading NIGHT TRAINS TO THE FJORDS](https://bytecreation.co.uk/wp-content/uploads/2026/10/qwen-image-2-1__show-2.webp)
_Generated locally by Qwen-Image-2.1 at 2048×1152, 20 steps at cfg 4.0, seed 512, 116.1 s._

![Victorian glasshouse conservatory at first light, mist drifting over a wet stone path between ferns and palms, lanterns lit low](https://bytecreation.co.uk/wp-content/uploads/2026/10/qwen-image-2-1__show-3.webp)
_Generated locally by Qwen-Image-2.1 at 2048×1152, 20 steps at cfg 4.0, seed 513, 116.2 s._

## Specifications

| Field | Value |
| --- | --- |
| Architecture | 7B MMDiT image transformer + Qwen3-VL 8B text encoder + VAE (all bf16 on disk) |
| Engine | ComfyUI 0.41.0, headless, `--offline`, one server per batch |
| Served by | nothing on the network: the orchestrator serves the *driver* LLM, not this model (see [the orchestrator guide](https://bytecreation.co.uk/the-model-orchestrator/) and “How they run” below) |
| Weights | single files: transformer 14.2 GB, text encoder 17.5 GB, VAE 0.68 GB (32.4 GB per set) |
| Resolutions | 1024×1024 (diffusers and ComfyUI); 2048-class native via ComfyUI; upstream card: 2K native, 2048×2048 default with aspect ratios up to 2752×1536. On the diffusers path 2752×1536 denoises but VAE decode is blocked |
| Sampler defaults | ComfyUI workflow: 20 steps, cfg 4.0, Euler. Diffusers script: 40 steps, fixed seed |
| Image editing | one unified model for generation and editing: up to 10 reference images, transparent RGBA output and subject extraction (upstream card). The local edit graph was verified end-to-end (40 steps, cfg 1.0, Euler/simple) |
| GPU footprint | Single RTX 3090. Jobs run on the free card while the driver LLM keeps the other |
| VRAM observed | peak 23,728 MB on the job GPU during a 2048-class job (GPU-only sampling at one per second) |
| Licence | [Qwen Research License Agreement](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE): non-commercial use only, research and evaluation; commercial use needs a separate agreement with Qwen. The 2.1 line moved off the Apache-2.0 terms that cover the original Qwen-Image family. |
| Role here | The routing pick for anything that must carry words: the only one of the two whose lettering has passed QC. It also carries the edit path (photo in, rendition out) |

## Generation times

| Run | Size | Steps | Stock | Zagitta GPU Unlock |
| --- | --- | --- | --- | --- |
| 2048-class warm jobs, ComfyUI | 2048×1152 | 20 | 116–122 s | 78.0–96.1 s |
| First job in a session, stages the weights | 2048×1152 | 20 | 122.1–124.1 s | 80.1 s |
| Site art batch, warm jobs | 1664×936 | 20 | 70–80 s | — |
| Diffusers attempt, decode blocked | 2752×1536 | 40 | ~4 min denoise only | — |

*Stock times are wall-clock per image inside one open ComfyUI session; server start and model staging sit in the first job. The site art batch is the provenance files under the site image originals. Zagitta GPU Unlock replays the same driver and settings on the unlocked card in one shared session (seeds 911–913, three runs): staging job 80.1 s, warm jobs 78.0 and 96.1 s — the run-to-run spread on this model is real, and so is the gain: every unlocked job beat every stock warm job.*

## GPU unlock: doubled tensor-core rate

The RTX 3090’s tensor-core rate is capped by its VBIOS well below what the silicon can do. `gpu_unlock` — an out-of-tree kernel module from the upstream Zagitta/gpu-unlock project — lifts that cap before the NVIDIA driver binds: one opt-in kernel argument and a reboot on this node, BF16 matrix throughput 70.7 → 112.0 TFLOPS (+58%), FP32 CUDA cores untouched. No VBIOS write: a boot without the argument is locked, and a power cycle re-locks the card.

This model denoises and decodes in native BF16, so it takes nearly the whole doubled rate; the GGUF-quantized LLMs that drive it are bandwidth-bound and measure unchanged. The one controlled comparison on this node — identical seed, prompt and binaries, locked and unlocked boots on the same day, 1024×1024 at 20 steps, both runs:

| Run | Locked | Unlocked |
| --- | --- | --- |
| 1024×1024, 20 steps, seed 42, both runs (same-day A/B) | 49.42 / 45.10 s | 39.45 / 35.35 s (−21% time) |

*Execution time from the ComfyUI server log, model staging excluded. Showcase timings in this post predate the unlock.*

The full same-day locked↔unlocked record — methodology, the 11-model LLM sweep, the synthetic GEMM check and the rollback kit — lives in [the Zagitta GPU Unlock article](https://bytecreation.co.uk/zagitta-gpu-unlock/).

## How they run: the LLM is the control plane

The orchestrator never serves an image model. What it serves is the chat model that drives the whole job: An LLM running through the orchestrator receives a prompt to generate an image, picks an image generator, and writes the prompt for the image generator. The `imagegen` skill wraps the mechanics into one command:

```bash
/mnt/data/scripts/imggen-run /mnt/data/imggen/venv/bin/python 
  /mnt/data/scripts/comfyui-gen.py --model qwen21 
  --prompt "..." --out /mnt/data/imggen/out/x.png --width 2048 --height 1152
```

`imggen-run` reads a GPU requirement per script from `imggen-models.conf`. For a single-GPU model it switches inference to `imagegen-single` mode: it stops the slot on the free GPU (here, slot 1), pins the job to that card with `CUDA_VISIBLE_DEVICES=1`, and leaves the slot the agent session itself is running on untouched. The generation job and the LLM that launched it share the hardware at the same time.

On exit the handler restores the stopped slot and its boot model, then verifies `GET :8010/health` before reporting success. The exit code tells the agent what happened:

| Exit code | Meaning | What the agent does |
| --- | --- | --- |
| 0 | job done, orchestrator restored | read the image and check it |
| 1 | job error (OOM, crash) | lower steps/resolution, retry |
| 2 | orchestrator did not restore | run the recovery script before touching inference again |
| 124 / -15 / -9 | timeout / killed / crash | check logs, lower steps |

While a job holds the free GPU, requests that would need it get a clean HTTP 503 explaining the pause. Sessions on the resident slot continue normally. The evict/restore cycle costs roughly 60 s for the dual-GPU boot, so batches run all images in one session. Before any image reaches the site, the agent reads it with vision and checks it against the prompt (the QC gate in `docs/IMAGE-STYLE.md`): wrong lettering, extra people or garbled detail fails the read and the image is re-rolled, twice at most.

## Memory & CPU

Peak job-GPU use measured 23,728 MB of the card's 24,576 MB while generating at 2048-class sizes (sampled once per second, across two batches). The weight set measures 32.4 GB on disk, so ComfyUI streams rather than pins: staging happens against the 128 GB of system RAM, and the same session switched from this model to the second one mid-batch without a restart (both showcase batches did exactly that). The LLM slot on the other card never left VRAM: this article was drafted while the batch ran, through the same endpoint, at full speed.

## Local config

The GPU-policy line for this model in `imggen-models.conf`, and the batch driver's workflow numbers:

```bash
# imggen-models.conf (script  gpus  cuda_device)
comfyui-gen.py qwen21     1  1

# one image, GPU 1, LLM stays on GPU 0
IMGGEN_JOB_TIMEOUT=1800 /mnt/data/scripts/imggen-run 
  /mnt/data/imggen/venv/bin/python /mnt/data/scripts/comfyui-gen.py 
  --model qwen21 --prompt "..." 
  --out /mnt/data/imggen/out/x.png --width 2048 --height 1152
```

The ComfyUI side is a plain T2I graph: `UNETLoader` + `CLIPLoader` (type `qwen_image`) + `VAELoader` on the three single files, prompt through `CLIPTextEncode`, one `KSampler` (Euler/normal, 20 steps, cfg 4.0), `VAEDecode`, save. Built-in workflow ids exist for t2i, image edit and background removal; the edit graph feeds reference images through `TextEncodeQwenImage21`.

## Build it yourself

**Hardware.** Model runs on one RTX 3090 (24 GB). A 16 GB card runs 1024-class sizes; the 2K class wants the full 24 GB and a second pass if the decode tightens. Set the GPU aside for the job or run the LLM driver on the other card.

- CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads, Zen 3
- Motherboard: ASUS ROG STRIX X570-E GAMING WIFI II (AM4, ATX)
- GPU: 2× NVIDIA GeForce RTX 3090, 24 GB VRAM each (the model needs one card)
- Total VRAM: 48 GB (2 × 24 GB)
- System RAM: 128 GB DDR4 (~121.5 GiB usable)
- Storage: 2 TB KIOXIA EXCERIA NVMe SSD
- OS: Ubuntu 26.04.1 LTS, headless
- CUDA: toolkit at /usr/local/cuda-13.1
- PCIe topology: both GPUs on the CPU root complex. X8/x8 split when both slots populated (normal for this board); Gen1 at idle → PCIe 4.0 x8 under load. Nvidia-smi topo -m shows PHB between GPUs. No NVLink
- Cooling/chassis: open mining rig (GPU spacing + rig fans, no case). GPU 0 peaks ~73–74 °C under dual load. Routine sw_thermal/sw_power_cap throttle to ~76 °C is normal
- Kernel mitigations in place: pcie_aspm=off, LimitMEMLOCK=infinity, orchestrator MemoryMax=110G

**Download.** The open Comfy-Org repack, fetched from the HuggingFace CDN with `curl -C -` because the `hf` downloader's Xet backend hangs on this host:

```bash
# three single files into ComfyUI's model dirs:
#   models/diffusion_models/qwen_image_2.1_bf16.safetensors
#   models/text_encoders/qwen3vl_8b_bf16.safetensors
#   models/vae/qwen_image_2.1_vae_bf16.safetensors
curl -L -C - -o qwen_image_2.1_bf16.safetensors 
  https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/split_files/diffusion_models/qwen_image_2.1_bf16.safetensors
```

On the official Qwen repos the full pipeline also loads under diffusers; locally the ComfyUI path is the one that reaches 2K, so the diffusers tree kept the extra split copies and the blocker note.

**Serve it.** No server: the gen script starts ComfyUI headless on a localhost port, submits the workflow JSON to `POST /prompt`, waits on the history, downloads the file and shuts the server down. One session per batch; every image in the batch shares the staged weights.

## Gotchas

- The `hf download` / Xet CAS path hangs on this host. Use `snapshot_download()` or direct CDN `curl -C -`.
- `device_map="auto"` is not supported by the diffusers pipeline; use `"balanced"` or manual placement.
- Diffusers at 2752×1536: denoising completes, the VAE decode does not (~2.4 GB contiguous needed). Tiled decode at 1024 works; nobody has made 2K tile here.
- ComfyUI needed one source patch in `comfy/text_encoders/llama.py` to dodge a Triton compile failure on Python 3.14.
- GPU placement is policy, not magic: without the `imggen-models.conf` line the batch picked the wrong card and OOM'd on first launch (the same trap applies to any new gen script).
- The 503 the orchestrator returns while the free GPU is taken is by design: it names the pause and tells the client how to wait.

**Links.** [Qwen/Qwen-Image-2.1 (official card)](https://huggingface.co/Qwen/Qwen-Image-2.1) · [QwenLM/Qwen-Image-2.1 (GitHub)](https://github.com/QwenLM/Qwen-Image-2.1) · [Comfy-Org/Qwen-Image-2.1 (the installed repack)](https://huggingface.co/Comfy-Org/Qwen-Image-2.1) · [ComfyUI](https://github.com/Comfy-Org/ComfyUI)

## Further reading

- [Local AI archive](https://bytecreation.co.uk/category/models.md)
- [Frontier LLM use in security fixes](https://bytecreation.co.uk/frontier-llm-use-in-security-fixes-november-2026.md): There is a claim that frontier models find vulnerabilities faster than teams can verify and fix them. We take a look at the claims and dive into the data.
- [AI Bug Hunting and the 2026 Kernel CVE Spike](https://bytecreation.co.uk/ai-bug-hunting-and-the-2026-kernel-cve-spike.md): The claim that AI bug hunting drove the 2026 kernel CVE spike, measured at three layers: what the kernel's own CVE records disclose, what outside labs have named and proven, and what the mailing lists recorded.
- [Narrative Vs Reality of 2026 CVE Apocalypse](https://bytecreation.co.uk/narrative-vs-reality-of-2026-cve-apocalypse.md): Are LLMs driving a wave of CVEs? Is the wave actually driven by AI marketing? Is something else going on? Explore the data behind the narratives to see what's true.
