Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Repair the four a-k checks the Qwen-Image-2.1 wave left red (#11573)

Daniel Han023730cf9c5e
diff --git a/studio/backend/tests/test_build_prequant_checkpoint.py b/studio/backend/tests/test_build_prequant_checkpoint.py
index 0467e7d9c2a..22789d04e41 100644
--- a/studio/backend/tests/test_build_prequant_checkpoint.py
+++ b/studio/backend/tests/test_build_prequant_checkpoint.py
@@ -214,6 +214,14 @@ def test_the_recorded_base_must_be_the_canonical_id_not_just_the_same_tail(capsy
Driven through ``main`` so the refusal is the one a builder would actually hit, and it has to
land BEFORE the download: nothing below is stubbed, so reaching the load would fail differently.
"""
+ # main() imports torch, torchao and diffusers before it reads a single argument. torchao the
+ # guard really needs (the scheme tables import it); diffusers it does not, and the backend CI
+ # shards do not install it. An empty stand-in only when it is absent: the refusal lands before
+ # any diffusers attribute is read, and the accepted arm below already expects the
+ # AttributeError an empty diffusers gives, so the guard is still exercised end to end.
+ pytest.importorskip("torchao")
+ if importlib.util.find_spec("diffusers") is None:
+ monkeypatch.setitem(sys.modules, "diffusers", types.ModuleType("diffusers"))
build = _script()
fam = detect_family("Qwen/Qwen-Image-2.1")
assert fam is not None and fam.base_repo == "Qwen/Qwen-Image-2.1"
diff --git a/studio/backend/tests/test_diffusion_backend.py b/studio/backend/tests/test_diffusion_backend.py
index 6bcbae45894..9f4c3c21f3e 100644
--- a/studio/backend/tests/test_diffusion_backend.py
+++ b/studio/backend/tests/test_diffusion_backend.py
@@ -233,6 +233,14 @@ def test_no_mirror_is_a_companion_only_repo():
assert mirror.lower() not in companions, mirror
+# Vendor bases the catalog offers before their unsloth mirror exists on the Hub. A mirror row for a
+# repo that is not there would 404 every fetch it redirects, so the table cannot lead the upload;
+# this names the gap instead of letting the check below go red on every PR until it closes.
+# Qwen/Qwen-Image-2.1 came in with #11405; unsloth/Qwen-Image-2.1 was not on the Hub on 2026-09-22
+# (unsloth/Qwen-Image-2.1-FP8 and unsloth/Qwen-Image-2.1-GGUF are).
+_MIRRORS_NOT_YET_PUBLISHED = frozenset({"qwen/qwen-image-2.1"})
+
+
def test_every_third_party_bf16_pipeline_the_catalog_offers_is_mirrored():
"""Lookup is by exact id, so a variant the catalog offers is silently missed until listed.
@@ -261,8 +269,18 @@ def test_every_third_party_bf16_pipeline_the_catalog_offers_is_mirrored():
if not repo.lower().startswith("unsloth/")
and "hunyuan" not in repo.lower()
and repo.lower() not in mirrored
+ and repo.lower() not in _MIRRORS_NOT_YET_PUBLISHED
)
assert not missing, f"catalog offers these vendor bases with no unsloth mirror: {missing}"
+ # Each pending entry has to still be pending and still offered, so the exception cannot
+ # outlive the gap it names.
+ for repo in _MIRRORS_NOT_YET_PUBLISHED:
+ assert (
+ repo not in mirrored
+ ), f"{repo} is in the mirror table now; drop it from _MIRRORS_NOT_YET_PUBLISHED"
+ assert repo in {
+ o.lower() for o in offered
+ }, f"the catalog no longer offers {repo}; drop it from _MIRRORS_NOT_YET_PUBLISHED"
def test_the_qwen_2512_mirror_covers_the_card_tag_route(monkeypatch):
@@ -8198,22 +8216,40 @@ def test_download_plan_counts_a_cached_lower_auto_prequant(monkeypatch):
lambda fam, scheme, **kw: source if scheme == "int8" else None,
)
monkeypatch.setattr(dmod, "prequant_checkpoint_cached", lambda *a, **k: True)
-
- plan = DiffusionBackend().download_plan(
- "unsloth/Qwen-Image-GGUF",
- gguf_filename = "Qwen-Image-Q4_K_M.gguf",
- text_encoder_quant = "off",
- )
- baseline = DiffusionBackend().download_plan(
- "unsloth/Qwen-Image-GGUF",
- gguf_filename = "Qwen-Image-Q4_K_M.gguf",
- text_encoder_quant = "off",
- speed_mode = "off",
+ # Whether this install can OPEN an int8 pickle is its own question (#11394): the plan skips a
+ # name it cannot read. torchao 0.18 no longer carries the int8 pickle constructors, so leaving
+ # it to the installed torchao made this test answer that question instead of the one it asks.
+ readable = {"answer": True}
+ monkeypatch.setattr(
+ "core.inference.diffusion_prequant.restricted_prequant_load_supported",
+ lambda *a, **k: readable["answer"],
)
+ def plans():
+ plan = DiffusionBackend().download_plan(
+ "unsloth/Qwen-Image-GGUF",
+ gguf_filename = "Qwen-Image-Q4_K_M.gguf",
+ text_encoder_quant = "off",
+ )
+ baseline = DiffusionBackend().download_plan(
+ "unsloth/Qwen-Image-GGUF",
+ gguf_filename = "Qwen-Image-Q4_K_M.gguf",
+ text_encoder_quant = "off",
+ speed_mode = "off",
+ )
+ return plan, baseline
+
+ plan, baseline = plans()
assert plan["required_bytes"] - baseline["required_bytes"] == 6 * GB
assert any(source.filename in entry["files"] for entry in plan["entries"])
+ # And the converse, so the pin above cannot hide the gate: an artifact this install cannot
+ # open is not budgeted.
+ readable["answer"] = False
+ plan, baseline = plans()
+ assert plan["required_bytes"] == baseline["required_bytes"]
+ assert not any(source.filename in entry["files"] for entry in plan["entries"])
+
def test_download_plan_omits_the_prequant_under_a_definite_offload_policy(monkeypatch):
# The fast path needs a plan with no offload, or a quant-sized replan that came back with
diff --git a/studio/backend/tests/test_diffusion_more_families.py b/studio/backend/tests/test_diffusion_more_families.py
index 4e1f94f8ac0..8c3246d44e3 100644
--- a/studio/backend/tests/test_diffusion_more_families.py
+++ b/studio/backend/tests/test_diffusion_more_families.py
@@ -692,7 +692,13 @@ def test_qwen_image_21_gguf_reaches_sd_cpp_with_its_own_vae_and_a_qwen3vl_encode
assert len(encoders) == 1
repo, filename, kind = encoders[0]
assert repo == "unsloth/Qwen3-VL-8B-Instruct-GGUF"
- assert filename == "Qwen3-VL-8B-Instruct-Q4_K_M.gguf"
+ # Which rung is the family's call, pinned by exact name in
+ # test_diffusion_compat_preflight.py::test_qwen_image_2_1_takes_the_dynamic_4bit_text_encoder.
+ # Restating it here broke when #11542 moved it to UD-Q4_K_XL. What this route needs is that
+ # the declared file is what reaches sd.cpp, and that it stays a 4-bit GGUF: the CPU RAM win
+ # is the reason the no-GPU route exists (bf16 is 16.4 GB).
+ assert filename == fam.sd_cpp_text_encoders[0][1]
+ assert filename.endswith(".gguf") and "Q4_K" in filename, filename
assert kind == "llm"
assert text_encoder_flags_for_family(fam.name) == ("--llm",)
@@ -755,16 +761,11 @@ def test_a_minimum_that_has_not_shipped_does_not_prescribe_an_impossible_upgrade
assert "has not been released yet" in message
assert "git --version" in message, "the likely cause has to be checkable by the reader"
- pin = (
- pathlib.Path(__file__).resolve().parents[1]
- / "requirements"
- / "diffusers-main.txt"
- )
+ pin = pathlib.Path(__file__).resolve().parents[1] / "requirements" / "diffusers-main.txt"
commit = _re.search(r"@([0-9a-fA-F]{40})\b", pin.read_text(encoding = "utf-8"))
assert commit is not None, "the main pin must carry a full commit for the zip route to exist"
assert (
- f"https://github.com/huggingface/diffusers/archive/{commit.group(1).lower()}.zip"
- in message
+ f"https://github.com/huggingface/diffusers/archive/{commit.group(1).lower()}.zip" in message
), message
# A released minimum keeps the ordinary remedy.