Repository navigation
Studio: classify qwen_image21 GGUFs as text-to-image - #13333
Conversation
Qwen-Image-2.1 GGUFs that carry a header declare `general.architecture = qwen_image21`, which was missing from the diffusion arch allowlist, so they were listed under Chat instead of the Images page. Add it to the catalog allowlist and to the llama.cpp image-arch gate. Fixes unslothai#13328
|
@codex review |
1 similar comment
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcbd12a73c
ℹ️ 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".
|
|
||
| _DIFFUSION_GGUF_ARCHS = frozenset({"flux", "flux2", "qwen_image", "qwenimage", "z_image", "zimage"}) | ||
| _DIFFUSION_GGUF_ARCHS = frozenset( | ||
| {"flux", "flux2", "qwen_image", "qwenimage", "qwen_image21", "qwenimage21", "z_image", "zimage"} |
There was a problem hiding this comment.
Resolve cached Qwen 2.1 families before advertising them
For a cached Hub GGUF whose repo id and filename are opaque or renamed, this new architecture entry makes _repo_gguf_task() return text-to-image from the header because _gguf_family_buildable() fails open when its name hints resolve no family. The actual image load calls DiffusionBackend.validate_load_request() with only that repo id and filename; detect_family_for_pick() has no cached-header fallback, so it returns None and the picker-advertised load fails with a 400. Resolve qwen_image21 from the cached header on the image load path (as video's _detect_load_family() does), or avoid advertising it when the names do not resolve.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not a regression: _gguf_family_buildable already fails open for every arch in this set (an opaque-named flux or qwen_image GGUF behaves the same), and before this PR such a file was listed in Chat, where it cannot load at all. Every public qwen_image21 upload checked (abenzerps, realrebelai, Gohans, KasugaiSakura, Nylonek, basileleuwa, 0xSojalSec) resolves to qwen-image-2.1 via detect_family_for_pick from its repo id or filename.
| _IMAGE_ARCHES = frozenset( | ||
| ( | ||
| "qwen_image", | ||
| "qwen_image21", |
There was a problem hiding this comment.
Gate the Qwen 2.1 redirect on Images availability
On a CUDA host with diffusers older than 0.41.0 and the default engine policy, family_buildable_here() is false for Qwen-Image-2.1, so the catalog tags a named GGUF unsupported and the Images picker omits it. This unconditional membership nevertheless makes both _non_chat_gguf_refusal() and _classify_llama_start_failure() tell users to open that missing Images entry; apply the same family/buildability verdict used by the catalog before promising this destination.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Studio pins diffusers==0.41.0 (requirements/diffusers-pin.txt) and requires Python >= 3.11, so Qwen-Image-2.1 is buildable on every supported install; the other _IMAGE_ARCHES entries are unconditional for the same reason. Before this PR the same load died with llama-server's unknown-architecture error, so the redirect is strictly better.
There was a problem hiding this comment.
Correction to my earlier reply: diffusers-pin.txt still gives Python 3.9 hosts diffusers 0.36, so this was reachable there. Fixed in 224dc49.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcbd12a73c
ℹ️ 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".
| _IMAGE_ARCHES = frozenset( | ||
| ( | ||
| "qwen_image", | ||
| "qwen_image21", |
There was a problem hiding this comment.
Gate the Qwen 2.1 redirect by host buildability
On a supported Python 3.9 CUDA installation using the default engine policy, the Images entry this new unconditional membership promises does not exist: pyproject.toml:15 supports Python 3.9, studio/backend/requirements/diffusers-pin.txt:12-16 pins that interpreter to diffusers 0.36.0, and diffusion_families.py:1596-1599 records that QwenImage21Pipeline requires 0.41.0, so _gguf_family_buildable() makes the catalog classify a named Qwen-Image-2.1 GGUF as image-diffusion-unsupported. Nevertheless, both _non_chat_gguf_refusal() and _classify_llama_start_failure() now use _IMAGE_ARCHES to direct the user to the absent Images row; use the same family/buildability check before naming that destination. This version-marker evidence directly contradicts the earlier thread's assumption that Studio requires Python >=3.11.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 224dc49: the refusal now asks the same buildability check the catalog uses before naming the Images page (diffusers-pin.txt keeps Python 3.9 hosts on diffusers 0.36, which has no Qwen-Image-2.1 pipeline).
…mages redirect on buildability The image loader now falls back to a cached GGUF's arch when the repo id and filename name no family, for archs that pin down a single family, so a renamed qwen_image21 file the picker lists no longer fails to load with a 400. The catalog judges that file by the same family instead of failing open, and the llama.cpp refusals only point at the Images page when that family can be built on this host.
|
Thanks for taking a look, and for the comment fix! I went through both Codex points and they were right, so I pushed a1a55ff to cover them. Renamed cached GGUFs. Images redirect on hosts that can't build it. The llama.cpp preflight refusal and Tests: 4 new regression tests (loader header fallback, catalog verdict, both refusal paths) fail on the previous head and pass now. The cached GGUF routes, llama.cpp preflight and start failure suites pass (551 passed). Five If you'd rather keep this PR to the one line allowlist change and handle the rest separately, I'm happy to split it out. |
The renamed file case is not a regression, so the loader and catalog go back to how they were. The llama.cpp refusals still check buildability before naming the Images page, since Python 3.9 hosts get diffusers 0.36, which cannot build Qwen-Image-2.1.
|
Sorry, I missed your replies on the threads before posting, my bad. You're right that the renamed file case isn't a regression, so I've dropped the loader fallback and kept this PR small. On the redirect, I think Codex's second note holds: |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Fixes #13328
Qwen-Image-2.1 GGUFs that carry a GGUF header (e.g.
abenzerps/Qwen-Image-2.1-Uncensored-GGUF) declaregeneral.architecture = qwen_image21. That arch was missing from_DIFFUSION_GGUF_ARCHS, so_arch_to_task()fell through totext-generation: the model showed up under Chat (where it cannot run) and never on the Images page. The officialunsloth/Qwen-Image-2.1*repos were unaffected only because their headers have no architecture key and go through the name-based fallback.Changes:
qwen_image21/qwenimage21to_DIFFUSION_GGUF_ARCHSincatalog_classification.py(same pattern as the existingqwen_image/qwenimagepair). Thetext-to-imagebranch still goes through_gguf_family_buildable(), so unbuildable families stay hidden.qwen_image21toLlamaCppBackend._IMAGE_ARCHES, so loading such a file as a chat model gives the "open it from the Images page" message instead of an unknown-architecture failure.test_arch_to_task_hides_unsupported_diffusion_from_chat.Testing:
main('text-generation' == 'text-to-image') and passes with this change.tests/test_cached_gguf_routes.py,tests/test_llama_cpp_non_chat_gguf_preflight.pyandtests/test_local_model_format.py: 370 passed, 1 skipped.Before / after (Studio, merge base vs this PR, same seeded cache with the real
qwen-image-2.1-UC-Q4_K_M.gguf)Images page model picker, On Device tab: the model is missing before and listed after.
Picking the model from the Chat picker: before, Studio tries to load it as a chat model; after, it opens the Images page.