Repository navigation
Studio: stop listing a GGUF's borrowed text encoder and VAE as a model in the picker - #13778
Conversation
…l in the picker The picker's On Device list showed the base repo a diffusion GGUF borrows its companions from as a partial Safetensors row; a click fetched the full bf16 denoiser and loaded the dense pipeline. Filter companion_prefetch rows out of the picker, and stop flagging a torn denoiser download as a prefetch so it stays listed and resumable.
…ting transformer_2 weights The companion prefetch skips only transformer/ (keeping its config.json), so judge torn vs prefetch on transformer/ and unet/ alone, and count a shard index there too. Keeps latest_snapshot_dir lazy.
|
@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: f131fe681a
ℹ️ 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".
| try: | ||
| root = Path(snapshot) | ||
| return any( | ||
| entry.name.lower().endswith((*_DENOISER_WEIGHT_SUFFIXES, ".index.json")) |
There was a problem hiding this comment.
Exclude config-prefetched UNet indexes from weight evidence
For a whole-pipeline single-file/GGUF whose base uses a sharded unet/, the normal companion prefetch includes unet/diffusion_pytorch_model.safetensors.index.json: core/inference/diffusion.py::_base_config_file_downloaded accepts this JSON while rejecting the referenced .safetensors shards. This broad .index.json match therefore makes the local inventory set companion_prefetch=false, so the Hub presents the config-only cache as an interrupted download and “Continue” fetches the full dense UNet. Distinguish indexes staged by the config prefetch (or stop staging them) from indexes that prove a user-started denoiser download.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e929e69. Under unet/ only a weight file now counts as evidence of a user-started denoiser download; a lone unet/.index.json is what the whole-pipeline single file's config prefetch stages, so that cache keeps companion_prefetch and the Hub no longer offers it as an interrupted download. A lone transformer/ index still counts, since the GGUF companion prefetch fetches only transformer/config.json there. Test: test_unet_index_staged_by_the_config_prefetch_is_not_weight_evidence (fails before, passes after); hub/tests otherwise unchanged (839 passed, the 5 test_delete_variant_ failures are pre-existing on main).
…ence A whole-pipeline single file's config prefetch (_base_config_file_downloaded) stages unet/*.index.json beside the configs, so under unet/ only a weight file proves a user-started denoiser download. A lone transformer/ index still counts: the GGUF companion prefetch fetches only transformer/config.json there. [skip ci]
|
@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". |
Loading a diffusion GGUF such as
unsloth/Qwen-Image-2.1-Turbo-GGUFdownloads only the companion files (text encoder, VAE, configs) from its base repo,Qwen/Qwen-Image-2.1-Turbo. The model picker's On Device tab then listed that base repo under "Other models" as a partial Safetensors row. Clicking it, or its settings gear, read it as an interrupted download: it fetched the 14 GB bf16 transformer and loaded the full pipeline, which runs out of memory on a 16 GB card. Reported in the Discord help thread.#11644 already flags these rows as
companion_prefetch, but only the Hub reads the flag.Changes
use-chat-picker-inventory.ts: the picker skipscompanionPrefetchrows, the same way it already skips sd.cpp companion mirrors. The Hub still lists them, so their size stays visible and deletable.inventory_scan.py: addssnapshot_denoiser_has_weights.cache_inventory.pyandlocal_inventory.pystop flagging a snapshot as a prefetch when any denoiser shard is on disk. A full download that stopped part way is a torn download, not a prefetch. Before this, it would have been hidden by the new filter. It now stays listed, partial and resumable.Tests
MacBook Pro M5, macOS 26, at
5e927b0fa3:test_delete_variant_*tests fail on base and on this branch alike, unrelated.companionPrefetch. It fails on base and passes here, andtsc -bis clean.Not tested: a live Unsloth Studio run with a real Turbo GGUF download.
Screenshots
Seeded cache:
Qwen/Qwen-Image-2.1-Turboas a companion-only base (only the text encoder, VAE and configs, as a GGUF load leaves it) andTongyi-MAI/Z-Image-Turboas a torn full download (index plus 1 of 3 shards). Left is main, right is this PR.Images picker, On Device: the companion-only base is gone, the torn download stays listed and resumable.
Chat picker, On Device: same.
The Hub still lists both rows, so the companion files stay visible and deletable.
Additional checks
unet/bases are flagged as a prefetch; a base repo the user also downloaded in full is not, and stays listed..safetensors,.binand*.index.jsonunder the denoiser all count as weights, so a torn full download stays partial and resumable.hub/testsfiles go from 8 failed / 580 passed to 5 failed / 583 passed (the three newly passing are this PR's tests);tests/2522 passed on both; frontendnpm testdiffers only by the new picker test;tsc -bexits 0.test_delete_variant_*failures exist on main too and are a test-only stub problem:_patch_variant_delete_side_effectsstubsget_hf_cache_pathswith aSimpleNamespacethat lackssource, whichknown_hf_cache_homes()reads. Production code is unaffected; that belongs in a separate fix.