#16437·ComfyUI

Qwen-Image 2.1: --enable-dynamic-vram silently corrupts output after any model reload (channel slice offset, ROCm gfx1201)

Author: flyingturbanCreated Sep 20, 2026Updated Sep 28, 2026

Summary

On ROCm (gfx1201), --enable-dynamic-vram silently corrupts Qwen-Image 2.1 output after any model evict/reload cycle. The first job after a server start is correct. The first job that forces a model reload comes back corrupt, and every subsequent job stays corrupt until the server is restarted.

The output is not noise. Its four channels are the correct image's channels in the pattern [B, A, B, A] — a slice offset by 2 carrying real, smooth image content. Visually, subjects render bright green.

Removing --enable-dynamic-vram fixes it completely. No other flag change was needed.

Environment

ComfyUI c194dd0 (master, version 0.37.0)
GPU AMD Radeon RX 9070 XT (gfx1201), 16304 MB
torch 2.9.1+rocm7.2.1, HIP 7.2.53211-158bd99533
OS / Python Windows 11, Python 3.12.10 (portable build)
Model qwen_image_2.1_int8_convrot.safetensors
Text encoder qwen3vl_8b_int8_convrot.safetensors
VAE qwen_image_2.1_vae_bf16.safetensors

All weights from Comfy-Org/Qwen-Image-2.1. Workflow is the bundled image_qwen_image_2_1_t2i template (12 steps, cfg 1, euler, simple). Graph is just ResolutionSelector → EmptyLatentImage → KSampler → VAEDecode → SaveImageAdvanced plus the three loaders and TextEncodeQwenImage21. No QwenImage21Cache node is present, so that node is not involved.

The trigger is a model evict/reload, not the prompt or resolution per se

The 7B DiT (6920 MB staged) plus the qwen3vl_8b text encoder (8916 MB staged) cannot co-reside in 16304 MB. Anything that forces the text encoder back in must evict the DiT and VAE.

  • Re-running with only the seed changed is clean — the conditioning is cached, nothing reloads.
  • Changing the prompt re-runs the text encoder → corrupt from then on.
  • Changing the resolution forces a realloc → corrupt from then on.

Reproduction

Start the server with --enable-dynamic-vram, then run these in one session, changing nothing else:

--listen 0.0.0.0 --enable-dynamic-vram --fast-disk --disable-pinned-memory --reserve-vram 1.5
# action result
1 1 MP (1024×1024), seed S clean
2 change prompt, same 1 MP corrupt
3 jump to 2 MP (1440×1440) corrupt
4 back to 1 MP, original prompt/seed corrupt (persists)

Restart the server and step 1 is clean again.

With --enable-dynamic-vram removed and everything else identical, all four steps are clean in a single session with no restarts.

Evidence: channel means, same seed and prompt throughout

run R G B A mean-abs-gradient
correct 154.7 154.9 162.6 254.9 5.03
corrupt (1 MP) 162.6 254.9 162.6 254.9 2.85
corrupt (2 MP) 130.4 191.7 130.4 191.7 26.66

In the corrupt 1 MP output, numpy.array_equal(img[...,0], img[...,2]) and numpy.array_equal(img[...,1], img[...,3]) are both True — pixel-exact, not approximately equal. Channels 0 and 1 hold exactly what channels 2 and 3 of the correct image hold.

The low gradient (2.85) confirms this is real image content, not noise, which is what rules out a numerical/precision fault: a bf16 overflow produces blown highlights or NaN, never byte-identical channel pairs. There are no NaN or Inf values, and no errors or warnings are logged — the job reports Prompt executed normally.

Note on --fp32-vae (separate issue, mentioned to pre-empt confusion)

This VAE is bf16-native (all 238 tensors BF16, working_dtypes lists bfloat16 first). Forcing --fp32-vae doubles the staged size from 644 MB to 1288 MB and pushes the decode onto what looks like a tiled/CPU fallback — a 1024² job went from 27.2 s to stalling past 285 s with ~2 CPU cores pinned and flat memory. That is a separate problem from the corruption above; the corruption reproduces with --fp32-vae absent.

Guess at the mechanism

Given this is the same hardware where pinned host memory plus async weight offload has previously caused silent NaN output, this looks like the dynamic-VRAM re-stage path writing the VAE back incorrectly on ROCm — the VAE's channel dimension in particular. The server logs Using async weight offloading with 2 streams and Model WanVAE prepared for dynamic VRAM loading. 644MB Staged before each decode.

I don't have an NVIDIA card to test whether this is ROCm-specific. Happy to run further diagnostics, dump intermediate tensors, or test a patch.