Repository navigation
Diffusion: source every image family's companions from unsloth mirrors - #8030
Conversation
A Qwen-Image-2512 GGUF, FP8 or bnb-4bit pick ships only the denoiser and reads its VAE, text encoder, tokenizer and scheduler from the base. That base is named by the base_model card tag on the artifact repo (Qwen/Qwen-Image-2512), not by the family table, whose default is the older Qwen/Qwen-Image, so nothing in the existing redirect touched it and every 2512 pick pulled 16.8 GB from the vendor. unsloth/Qwen-Image-2512 is a complete mirror: all 14 weight files match upstream by sha256, no file is missing, and it loads as QwenImagePipeline with all five components. Apache-2.0 upstream, so the copy carries LICENSE and NOTICE. The mirror table is no longer only about gating, so its comments say what it is now for. The swap stays fetch-only: status(), saved configs and a trained adapter's base_model tag still read the vendor id through canonical_base. Two new tests: the 2512 pair specifically, since it is the one entry the family table cannot reach; and a guard that no mirror is ever a companion-only repo, because prefer_ungated_mirror also fires on a plain bf16 pipeline pick and a mirror without a transformer would break it.
Eight more complete mirrors, so that every image family Studio can load takes its companions from unsloth/* rather than a vendor repo: Qwen-Image, Qwen-Image-Edit-2511, FLUX.2-klein-4B, Z-Image-Turbo, Lumina-Image-2.0, HiDream-I1-Full, stable-diffusion-xl-base-1.0 and sdxl-turbo. All eight verified against upstream: every LFS weight file matches by sha256, no upstream file is missing. Redistribution terms differ, so each mirror carries the upstream licence text plus the notice its own licence prescribes: Apache-2.0 for the five Qwen/BFL/Tongyi/Alpha-VLLM repos, MIT with its copyright and permission notice for HiDream, OpenRAIL++ with Attachment A's use restrictions flowed down for SDXL base, and for sdxl-turbo the Stability AI Community License with the section IV(a) attribution sentence verbatim. HunyuanImage-2.1 is deliberately NOT mirrored, and the table says so. The Tencent Hunyuan Community License permits distribution only inside a Territory that excludes the EU, the UK and South Korea, and a public Hub repo distributes worldwide. Three existing tests asserted a vendor id where the fetch now reads the mirror. Updated to the mirror, and two of them now also assert that status still reports the vendor id, which is the property the fetch-only swap is supposed to preserve.
Both build a Z-Image cache fixture and then let prefer_ungated_mirror read the REAL cache to decide whether the swap fires. On a machine that happens to hold the upstream they pass, on a clean runner they fail, which is how they passed locally for me and failed in CI. The cross-root test pins UNSLOTH_DIFFUSION_NO_MIRROR, since its subject is shard discovery across cache roots and not mirroring at all. The dense-builder test pins _no_cache and asserts the mirror id, which is what the load reads now that Z-Image is mirrored; which hub id it is was always incidental there, the point being a hub id rather than the staged snapshot path.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b38939118f
ℹ️ 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".
| ("black-forest-labs/FLUX.2-klein-4B", "unsloth/FLUX.2-klein-4B"), | ||
| ("Tongyi-MAI/Z-Image-Turbo", "unsloth/Z-Image-Turbo"), | ||
| ("Alpha-VLLM/Lumina-Image-2.0", "unsloth/Lumina-Image-2.0"), | ||
| ("HiDream-ai/HiDream-I1-Full", "unsloth/HiDream-I1-Full"), |
There was a problem hiding this comment.
Add mirrors for every supported variant base
The table only covers the standard Klein 4B and HiDream Full repos, but exact lookup means supported variants still bypass the mirrors: unsloth/FLUX.2-klein-base-4B-GGUF can resolve its trusted card tag to black-forest-labs/FLUX.2-klein-base-4B, while the model catalog directly offers HiDream-ai/HiDream-I1-Dev and HiDream-ai/HiDream-I1-Fast. Because none of those IDs is present here, prefer_ungated_mirror returns the vendor ID and these advertised loads continue fetching up to roughly 63 GB from third parties, contrary to the change's stated coverage and its claim that Hunyuan is the sole deliberate exception.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right on all three, fixed in 2032643. Confirmed each: unsloth/FLUX.2-klein-base-4B-GGUF resolves its card tag to black-forest-labs/FLUX.2-klein-base-4B (exercised in test_diffusion_more_families.py), and HiDream-ai/HiDream-I1-Dev / -Fast are both bf16Pipeline entries at 63 GB in the catalog. None was in the table, so all three kept fetching from the vendor.
All three upstreams are ungated and permissively licensed (apache-2.0 for klein-base-4B, MIT for both HiDream), so redistribution rests on the same basis as the other ungated mirrors. I published complete copies and verified them file-by-file against upstream: 25/25, 36/36 and 36/36, no missing entries and no size mismatches.
Rather than just add three rows, the new test reads the catalog instead of restating the table, so a newly offered vendor bf16 pipeline fails there instead of quietly bypassing the mirrors. It caught Lightricks/LTX-2 and the two Wan-AI bases as well; those are video and out of this change's scope, so the test is sliced to IMAGE_CATALOG and mirroring them is a separate call. Verified load-bearing: dropping the two HiDream rows fails it and names them.
The table named FLUX.2-klein-4B and HiDream-I1-Full but not the variants a
supported pick can actually resolve to, and lookup is by exact id:
black-forest-labs/FLUX.2-klein-base-4B <- what unsloth/FLUX.2-klein-base-4B-GGUF
resolves to from its card tag
HiDream-ai/HiDream-I1-Dev <- offered directly, 63 GB bf16 pipeline
HiDream-ai/HiDream-I1-Fast <- offered directly, 63 GB bf16 pipeline
So those picks kept fetching from the vendor while the change claimed to have
stopped that, and claimed Hunyuan was the only deliberate exception.
All three upstreams are ungated and permissively licensed (apache-2.0 and MIT),
so redistribution rests on the same basis as the existing ungated mirrors. Each
new mirror is a complete copy, verified file-by-file against upstream: 25/25,
36/36 and 36/36 files with no missing entries and no size mismatches.
The new test reads the catalog rather than restating the table, so a newly
offered vendor bf16 pipeline fails here instead of quietly bypassing the
mirrors. It is scoped to IMAGE_CATALOG, matching this change's scope; the video
bases are ungated and a separate call. Verified load-bearing: dropping the two
HiDream rows fails it and names them.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 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". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
|
@codex review |
|
@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". |
Second half of #8001, and the last third-party fetch on the Qwen-Image-2512 load path.
The gap
unsloth/Qwen-Image-2512-GGUF,-FP8and-unsloth-bnb-4bitship only the denoiser. The VAE,text encoder, tokenizer and scheduler come from the base repo, which for these artifacts is named
by the
base_modelcard tag:_resolve_base_repotrusts that tag (qwen/qwen-image-2512is on the non-GGUF allowlist), so thefetch lands on the vendor repo no matter what the family table says. The family default is the
older
Qwen/Qwen-Image, so the mirror redirect added in #7952 never covered this route, and every2512 pick pulled 16.8 GB of companions from a third-party repo whose transformer directory it does
not want.
The mirror
unsloth/Qwen-Image-2512is a complete copy, verified against upstream:LICENSEandNOTICEDiffusionPipeline.load_configreturnsQwenImagePipelinewith all five componentsUpstream is Apache-2.0 and ships no licence file, so section 4(a) is satisfied by writing the
Apache 2.0 text as
LICENSEplus aNOTICErecording provenance and disclaiming endorsement. Thecard gets a provenance banner.
Unlike the twelve repos in that script this upstream is not gated, so the table's comments no
longer describe only gating. They now say what it is for: a mirror removes a 401 for the gated
vendors and removes a third-party fetch for the ungated ones.
What does not change
The swap is fetch-only, as before.
status()["base_repo"], saved configs and a trained adapter'sbase_modeltag all still readQwen/Qwen-Image-2512, because_resolve_base_repomaps a mirrorid back through
canonical_base. Every existing decline still applies:UNSLOTH_DIFFUSION_NO_MIRROR,a local path, and an upstream snapshot already cached.
Tests
test_the_qwen_2512_mirror_covers_the_card_tag_route: the pair resolves,prefer_ungated_mirrorswaps it, the family default is confirmed to have no mirror of its own so the redirect cannot be
mistaken for the fallback doing the work, and
canonical_basemaps back to the vendor id.test_no_mirror_is_a_companion_only_repo: a mirror stands in for the whole base, including aplain bf16 pipeline pick where the transformer is read from it. A companions-only repo in this
table would turn a working load into a missing-weights error, so assert no mirror appears in
sd_cpp_companion_only_repo_ids().Update: the rest of the third-party bases
Extended to cover every remaining vendor base an image family loads companions from. Eight more
complete mirrors, all verified against upstream (every LFS weight file matches by sha256, no
upstream file missing):
Qwen/Qwen-Imageunsloth/Qwen-ImageQwen/Qwen-Image-Edit-2511unsloth/Qwen-Image-Edit-2511black-forest-labs/FLUX.2-klein-4Bunsloth/FLUX.2-klein-4BTongyi-MAI/Z-Image-Turbounsloth/Z-Image-TurboAlpha-VLLM/Lumina-Image-2.0unsloth/Lumina-Image-2.0HiDream-ai/HiDream-I1-Fullunsloth/HiDream-I1-Fullstabilityai/stable-diffusion-xl-base-1.0unsloth/stable-diffusion-xl-base-1.0stabilityai/sdxl-turbounsloth/sdxl-turboRedistribution terms differ per repo, so each mirror carries the upstream licence text plus the
notice its own licence prescribes: Apache-2.0 section 4(a) for the five above, MIT's copyright and
permission notice for HiDream, OpenRAIL++ with Attachment A's use restrictions flowed down for
SDXL base, and for sdxl-turbo the section IV(a) attribution sentence verbatim.
One base deliberately not mirrored
hunyuanvideo-community/HunyuanImage-2.1-Diffusersstays third-party. The Tencent HunyuanCommunity License permits distribution "exclusively in the Territory", and the Territory is
defined to exclude the EU, the UK and South Korea. A public Hub repo distributes worldwide, so
that mirror cannot be made compliant. The table says so where the next person will look.
Test churn
Three existing tests asserted a vendor id at a point where the fetch now reads the mirror. Updated
to the mirror, and two of them now also assert
status()["base_repo"]still reports the vendor id,which is the property the fetch-only swap exists to preserve.