Repository navigation
Description
What happens
Since master-1116-bf31b9c, Ming-Image 0.1 Design fails metadata validation when the diffusion model loads, so nothing can be generated. master-1111-6874e49 loads and runs the same files. Between the two, the only change that touches model loading is #2396 (Diffusion Graph Language support), so I think that's where it came from. Still failing on master-1141-e637c7b.
The server starts fine (weights now load on demand), and the first generation fails with:
[E] Diffusion model tensor 'model.diffusion_model.cap_pad_token' not in model metadata --- model_manager.cpp:1085
[E] Diffusion model tensor 'model.diffusion_model.x_pad_token' not in model metadata --- model_manager.cpp:1085
[E] invalid tensor part 'model.diffusion_model.context_refiner.0.attention.qkv.weight.1' for 'model.diffusion_model.context_refiner.0.attention.qkv.weight' --- model_manager.cpp:1099
... (34 of these, one per attention block)
[E] model metadata validation failed --- model_runtime.cpp:474
and the request returns {"error":"line 38, column 18: cannot load component from '.../ming_image_0.1_design-Q8_0.gguf'"}.
The weights
I tested with a Q8_0 GGUF converted from Comfy-Org's ming_image_0.1_design_bf16.safetensors, the file docs/models/ming_image.md links. The GGUF has the same 519 tensors as that file, and neither has a fused QKV or any pad token:
layers.6.attention.to_q.weight [3840, 3840]
layers.6.attention.to_k.weight [3840, 3840]
layers.6.attention.to_v.weight [3840, 3840]
layers.6.attention.to_out.0.weight [3840, 3840]
layers.6.attention.norm_q.weight [128]
layers.6.attention.norm_k.weight [128]
(no x_pad_token, no cap_pad_token)
So I'd expect the bf16 safetensors to fail the same way. I haven't run it, though.
What I suspect (not verified)
MingImageConfig::detect_from_weightssetssplit_qkvfromtensors.count(prefix + ".layers.0.attention.qkv.weight") == 0. Theqkv.weight.1part names in the log suggest the loader has already mappedto_q/to_k/to_vonto parts ofqkv.weightbefore that check runs. If so,split_qkvends up false, the block gets one fused QKV tensor, and the parts no longer fit the shape it expects.x_pad_tokenandcap_pad_tokenlook like they come from the Z-Image side that Ming's config and blocks build on. Ming's checkpoint has neither, so they may need to be optional for Ming.
To reproduce
Linux x86_64, Vulkan (RX 9070 XT), the release bin-Linux-...-vulkan zips:
./sd-server \
--diffusion-model ming_image_0.1_design-Q8_0.gguf \
--llm ming_ling_mini_2.0-Q4_K.gguf \
--vae ming_image_vae_bf16.safetensors \
--tokenizer tokenizer.json \
--diffusion-fa --backend te=cpu --vae-tiling \
--listen-ip 127.0.0.1 --listen-port 8798
curl -s -H 'Content-Type: application/json' \
-d '{"prompt":"x","width":256,"height":256,"steps":1,"cfg_scale":1,"sampler_name":"euler","seed":1}' \
http://127.0.0.1:8798/sdapi/v1/txt2imgBisected over release builds:
| Release | Result |
|---|---|
| master-929-3f8527a | loads |
| master-1028-37bc88b | loads |
| master-1078-73fef08 | loads |
| master-1092-5d78740 | loads |
| master-1098-b521db4 | loads |
| master-1106-532d2c1 | loads |
| master-1111-6874e49 | loads |
| master-1116-bf31b9c | validation fails |
| master-1117-0d71f96 | validation fails |
| master-1141-e637c7b | validation fails |
The GGUF is public, if it helps: https://huggingface.co/voltaire321/Ming-Image-0.1-Design-GGUF
Thanks for the --api-key-file and --cors-origins work in #2367, by the way. That's what I was updating for when I hit this.
Activity
kuhnchris commentedon Nov 27, 2026
Does it also show "Model detected as Z-Image"?
If so, it may be due to a detection change of the DGL, according to GLM-Flash:
Workaround that works on your existing build (no recompile): run a DGL script with explicit
family = "ming_image"(pattern indocs/dgl/ming_image/ming-image-0-1-design-txt2img.dgl)The following diff was suggested for a permanent fix but I cannot say that this not may cause side effects, someone more aligned with tensors would need to verify:
Side effect, this also makes it work with the new Ming-Image-0.2-Design (tested with the https://huggingface.co/Abiray/Ming-Image-0.2-Design-GGUF )
fix(image): lock the bundled sd-server to the app with a per-run key (#…