Skip to content

[Bug] FLUX.1-Kontext-dev: -r reference editing outputs pure noise (t2i works fine) on Vulkan and CPU, both Q4_K_M and Q8_0 GGUF #2133

Open

Description

@liuwei12987

Summary

FLUX.1-Kontext-dev reference-image editing (-r) produces pure RGB noise with every parameter/backend/quantization combination I tried, while text-to-image with the same model files works perfectly. Reproduced on both the latest release and the build before #2085.

Environment

  • stable-diffusion.cpp: master-959-d637cfb (win-vulkan-x64 release), also reproduced on master-955-b7a74e6
  • OS: Windows 11, AMD RX 6750 GRE 12GB (RDNA2) via Vulkan; also reproduced with --backend cpu (pure CPU)
  • Models: flux1-kontext-dev-Q4_K_M.gguf and flux1-kontext-dev-Q8_0.gguf from QuantStack/FLUX.1-Kontext-dev-GGUF (byte sizes identical to upstream), ae.safetensors (verified 16-ch latent Flux VAE), clip_l.safetensors, t5-v1_1-xxl-encoder-Q8_0.gguf

What works

Text-to-image, same model, same session — clean output in 37s:

sd-cli.exe --diffusion-model flux1-kontext-dev-Q8_0.gguf --vae ae.safetensors --clip_l clip_l.safetensors --t5xxl t5-v1_1-xxl-encoder-Q8_0.gguf -p "a lovely cat holding a sign says 'hello'" --cfg-scale 1.0 --guidance 2.5 --steps 12 --sampling-method euler -W 512 -H 512 -o ok.png

What fails

Reference editing (official example style command) — output is pure RGB noise:

sd-cli.exe -r ref.png --diffusion-model flux1-kontext-dev-Q8_0.gguf --vae ae.safetensors --clip_l clip_l.safetensors --t5xxl t5-v1_1-xxl-encoder-Q8_0.gguf -p "Change the sign text to 'KONTEXT OK'" --cfg-scale 1.0 --sampling-method euler --clip-on-cpu -o noise.png

Already ruled out

  • --cfg-scale 1.0 (official recommendation) vs 2.5; --guidance default vs 2.5
  • scheduler: default vs simple; steps 8 / 12 / 20 / 24
  • resolution: 256x256, 512x512 (matching 512x512 ref), and default (ref native 1380x900 — that run produced a blank/white image instead of noise)
  • backend: Vulkan and --backend cpu
  • quantization: Q4_K_M and Q8_0
  • sd.cpp version: master-955 (before feat: run conditional and unconditional CFG in one batched UNet forward #2085 CFG batched forward) and master-959 d637cfb
  • VAE file integrity verified (safetensors header, decoder.conv_in.weight [512,16,3,3], 245 keys); Q8_0 gguf byte-size matches upstream exactly
  • sd-server img2img API with Qwen-Image-Edit on the same install works fine (its ref/img-cond path is OK), so the issue appears specific to the Kontext ref path

Expected

Edited image preserving the reference, per docs/kontext.md example.

Happy to provide more logs/screenshots if needed.

Activity

  1. liuwei12987 commented on Oct 13, 2026

    @liuwei12987
    Author

    Update: additional testing shows the Q8_0 GGUF fails on Vulkan for plain text-to-image as well (pure noise), which matches the known open issue #1927 (Q6_K/Q8_0 Vulkan). So the Q8_0 datapoint above is likely explained by #1927 and should be disregarded for this bug. The core repro for this issue stands on Q4_K_M alone: t2i works perfectly (clean image), but -r reference editing outputs pure noise, on both Vulkan and --backend cpu, across master-955 and master-959.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions