Skip to content

Studio: route krea2 GGUFs to Images instead of opening them as chat models - #14477

Merged
danielhanchen merged 5 commits into
unslothai:mainfrom
indrajeetapache:fix/krea2-gguf-unsupported-arch-14474
Oct 21, 2026
Merged

danielhanchen merged 5 commits into
unslothai:mainfrom
indrajeetapache:fix/krea2-gguf-unsupported-arch-14474

Conversation

@indrajeetapache

@indrajeetapache indrajeetapache commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Custom Krea 2 GGUFs from some converters (for example molbal/krea2-gguf) declare general.architecture = krea2. That arch was in none of Studio's GGUF arch tables, so the listing classified the file as text-generation: the Model Hub offered RUN as a chat model and llama-server failed with "does not recognise this GGUF's model architecture ('krea2')" (#14474). The Images picker never listed it.

Studio's Images engine already loads Krea 2 GGUF transformers: most published Krea 2 GGUFs declare flux or qwen_image (vantagewithai, Abiray, byteshape, realrebelai) and load through the same diffusers GGUF path, because the loader reads the DiT from the tensor names, not from the declared arch. So a krea2 GGUF does not need to be refused; it only needs to be routed to Images.

  • krea2 joins _DIFFUSION_GGUF_ARCHS (listing) and LlamaCppBackend._IMAGE_ARCHES (chat preflight and the llama-server failure text), so the file is listed under Images and opening it in a chat says "Open it from the Images page instead."
  • krea2 names exactly one family, unlike flux / qwen_image, so the buildability gate checks Krea 2 from the arch even when the file name says nothing (my-mix-Q4_K_M.gguf). A host that cannot build Krea 2 (diffusers older than 0.39) hides the file and the refusal names no page. flux / qwen_image keep going by name only.
  • The original commit's "unsupported diffusion" classification is replaced by the above; branch merged with current main first.

Evidence

Tiny Krea 2 DiT (real ComfyUI layout, 2D weights Q8_0, general.architecture = krea2, uninformative file name) in a custom models folder, Studio's own functions:

main this PR
listing task (_local_model_task) text-generation (chat RUN) text-to-image (Images picker)
chat preflight none, llama-server "does not recognise ('krea2')" "This is an image-generation GGUF (architecture 'krea2'), which cannot run as a chat model. Open it from the Images page instead."
Images family detection (detect_family_for_pick) krea-2 krea-2
GGUF transformer load (Krea2Transformer2DModel.from_single_file + GGUF quant config, Studio converter) 0 missing keys, max abs err 8.8e-4 vs dense same

Routing cells (arch x name hints, listing task + preflight + llama-server failure text): 320 cells, 290 identical, 30 moved, all of them krea2 / KREA2 / padded krea2.

Tests, base (main) vs head with the head test files: 6 FIXED (fail or absent on base, pass on head), 511 unchanged, 0 head failures:

  • test_cached_gguf_routes.py::test_krea2_gguf_is_an_image_model_not_chat
  • test_llama_cpp_non_chat_gguf_preflight.py::test_a_krea2_gguf_names_the_images_page[...] (2)
  • test_llama_cpp_non_chat_gguf_preflight.py::test_a_krea2_gguf_this_host_cannot_build_promises_no_page
  • test_llama_cpp_non_chat_gguf_preflight.py::test_every_media_arch_is_refused_before_launch[krea2]
  • test_llama_cpp_start_failure_classification.py::TestDiffusionArchitectures::test_every_image_arch_is_recognised[krea2]

Not covered

  • No real Krea 2 GGUF was run end to end (tiny model only); the companion text encoder / VAE come from krea/Krea-2-Turbo exactly as for the Krea 2 GGUFs that already load.
  • The no-GPU sd.cpp route has no Krea 2 mapping yet, so a CPU-only host builds Krea 2 GGUFs through diffusers. Upstream stable-diffusion.cpp supports Krea 2, so that is a possible follow-up.
  • Custom Krea 2 safetensors and the Create-only modes from [Bug] Custom Krea2 models showing, but crashing the app or not loading #14474 are handled separately.

Custom Krea 2 GGUFs declare architecture krea2, which Studio does not
run (pipeline-only, no sd.cpp mapping). Without that arch in the
unsupported set they fell through to text-generation, so Hub offered
RUN as chat and llama.cpp failed. Mirror the catalog and llama.cpp
preflight lists so both pickers and the load refusal stay in sync.
@danielhanchen danielhanchen self-assigned this Oct 21, 2026
Custom Krea 2 GGUFs from some converters declare general.architecture = krea2.
The Images loader already reads the Krea 2 DiT from the tensors (the same path
the Krea 2 GGUFs declaring flux or qwen_image take), so list them as
text-to-image and point the chat preflight at the Images page. The arch alone
names the family, so the buildability gate checks Krea 2 even when the file
name says nothing.

[skip ci]
@danielhanchen danielhanchen changed the title Classify krea2 GGUFs as unsupported diffusion (not chat) Studio: route krea2 GGUFs to Images instead of opening them as chat models Oct 21, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T12:49:51.721038Z 5c7c43f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 5c7c43f015

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 5ff3fa4 into unslothai:main Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants