Repository navigation
Fix image model dependency downloads and show full footprint - #8036
wasimysaid merged 62 commits into
Conversation
Follow-ups on the review comments, plus the terminal-state gaps they surfaced. Backend: - Filter the native sd.cpp plan against the cache the same way the diffusers plan does. The frontend now asks for a plan on every Hub pick, so on a CPU or MPS host a fully cached native model was staging download jobs instead of loading. required_bytes keeps the unfiltered sum: it is the disk footprint, not the pending transfer. - Merge the per-repo size maps instead of overwriting them. When the resolved base IS the checkpoint repo, the companion lookup dropped the checkpoint's size: the entry was planned at 0 bytes and checkpoint_bytes reported the companion total. A repo laying its GGUF out in a subfolder also listed and counted it twice. - Pin the cache probe to the revision the plan was sized against. Unpinned it answers from the local main ref, so a republished companion read as present and the loader fetched it inline, outside the download manager. - One entry per repo, so same-repo groups cannot fight over one scope variant. Frontend: - Hang the footprint explanation off the variant row button instead of a span nested inside it. The span was not a tab stop, so the checkpoint-versus-assets breakdown could only ever be hovered, and clicking it selected the quant. - Announce the staged download once an entry actually starts, not when the plan is staged: a refused start promised a download and then contradicted itself. - Clear the consumer's pending auto-load on every ending that leaves files missing, not just cancellation, and wire the same handler into the video page, which shares the hook and had the identical stale-intent bug. Drop the disposable Windows A/B harness. Its backend half is covered by the permanent tests, and its frontend half asserted source literals in images-page.tsx, which proves nothing at runtime and breaks on a reformat. Tests: 261 pass in test_diffusion_backend.py + test_sd_cpp_backend.py, 17845 pass in the full studio backend suite (3 pre-existing failures unrelated to this work, identical on main). Frontend typecheck clean, 774 tests pass, and the rendered Playwright footprint regression still passes.
|
Went through this one carefully and pushed the follow-ups directly to the branch. The core fix is right: a cached diffusion GGUF whose companion base repo was missing really did bypass staging, and the plan is the correct place to make that call. Three of the four review comments reproduced, so I fixed those plus a couple of things they surfaced. What reproducedNative sd.cpp plans were not cache-filtered. Forcing every asset cached still returned The shared-repo overwrite. Root layout is the case in the review comment: checkpoint entry at 0 bytes, The revision pin. Confirmed against the installed The tooltip. Checked in a real browser against the built bundle. The help element was The explanation now hangs off the row button, which is already the focus target. That gives it a keyboard path with no nested trigger and no extra tab stop, and the icon becomes decorative. Re-ran the same probe after the change: Also fixed while in there
One thing I removedI dropped Verification
Four new backend regression tests cover the combined-repo sizing, the revision pin, and the native cache filter in both the partial and fully cached cases. Left for a follow-up
Also worth noting for later: companion bytes are resolved once from a representative quant and applied to every row, which holds only while all variants under one expander share a base and text-encoder set. Nothing enforces that today. Nice work on the root cause, this was a real bug and the diagnosis was correct. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93aaf6afdb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Simulating the cache probe against real hub cache trees turned up a regression in my own previous commit. model_info().sha is the REPO head, not the file's, so any unrelated commit (a README fix) names a snapshot a healthy cache never downloaded. Every required file then read as missing, which would re-stage the whole footprint and can fail a disk preflight for space nobody needs. Two probes now, because neither is safe alone. A hit at the planned revision proves the file is current and needs nothing further. A miss proves nothing, so it falls back to the local main ref and corroborates with the size the same lookup declared: identical size means the file did not change, a different one means it was republished and must come through the download manager rather than inline mid-load. A republish that keeps the byte count exactly reads as cached, which is where the unpinned probe already was. Verified against real cache layouts on huggingface_hub 0.34.0, 0.35.3, 0.36.2, 1.0.1 and 1.2.0 (the >=0.34 floor through the 1.x line), with both posix symlink snapshots and the Windows copy layout, plus dangling links, truncated files, a missing refs/main and an absent declared size. Tests: 263 pass in test_diffusion_backend.py + test_sd_cpp_backend.py; 17846 pass in the full studio backend suite. The 3 openai-route failures are pre-existing and identical on main; test_stt_sidecar's cancellation test flaked once in the full run and passes 3/3 in isolation.
|
Pushed one more commit ( The bug my revision pin introduced
The user-visible effect would have been the picker claiming the whole 10.8 GB was missing on caches that were completely intact, plus a disk preflight that could refuse the load for space nobody needs. That is worse than the stale-cache window it was meant to close, so thanks to the simulation for catching it before this went anywhere. Two probes now. A hit at the planned revision is proof on its own. A miss proves nothing, so it falls back to the local SimulationsEverything below runs offline, no model downloads, no GPU. Isolated environments are
Plus a straight A/B of a build of Does anything old breakNo hardware path is added here, so there is no new-path-breaks-old-path risk, but I walked the product anyway. Every NVIDIA, AMD and Intel Arc host on Linux, Windows and WSL still routes to the diffusers planner exactly as before; only CPU-only hosts and Mac behind the MPS flag reach sd.cpp, which is unchanged routing. The invariants held on all 84 combinations: a fully cached model plans nothing, an uncached one plans something, For existing installs, the floor is One note on your import-light rule for CIRan on staging repos rather than the org queue, then closed. All green, on real runners rather than mocks:
Locally: 263 pass in One harness limitation worth stating: sonner's |
…an-repro-ci-fixed
…ixed' into fix/image-download-plan-repro-ci-fixed
test_a_staged_download_that_never_starts_clears_the_queue looked for setQueue(null) within 400 characters of the "error" branch. The three non-started outcomes now share one clean-up after the if/else chain, which is further away than that, so the test failed on a stronger guarantee than the one it was written for. Asserted over the whole non-started region instead: all three outcomes are handled, the queue is cleared, and the consumer's pending auto-load is dropped. One shared clean-up passes and three copies would too. tests/studio: 2787 passed.
|
Re-verified everything against the new head after your On the progress changeDropping the staging toast in favour of the Downloads panel is the better call, and it makes my earlier toast-timing fix redundant, so I have no objection to it going. The concern I had was that The Two small notes, neither blocking:
The test my refactor broke
Verification on the new head
Simulations re-run against the new head, all unchanged: cache probe 13/13, hub versions 8/8 on each of 0.34.0, 0.36.2 and 1.2.0, OS x accelerator 84/84, compatibility and edges 18/18, browsers 30/30 across Chromium, Firefox and WebKit, staged terminal states 12/12. Staging CI, then closed: I also checked the merge for overlap with #7379, which landed device-side model discovery in the same neighbourhood. It adds cache inventory for the chat auto-load path and does not touch the diffusion download plan, so the two are independent. The merge left Looks good to me from here. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f3a3281c0
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f54c0eba3e
ℹ️ 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".
|
@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 |
|
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". |
|
Live end-to-end confirmation for
This confirms the full-footprint display, staging, cancellation, retry/adoption, load, and generation paths on the real Studio install. Fork CI is running in wasimysaid/unsloth#130. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd44601248
ℹ️ 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".
|
@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". |












What changed
Model fileorRequired assetsinstead of exposing the internal@diffusionscope.Loading to GPU…only after the model file and required assets are both ready. The defensive inline fallback now calls missing files “model requirements,” not the selected model itself.Root cause
The picker only knew the selected GGUF checkpoint's size and cache state, while diffusion loaders also require a base repository containing text encoders, VAE, tokenizer, and configuration files. A cached checkpoint could therefore bypass staging even when those companions were missing. When the backend fetched them during load, the UI described the combined 11 GB footprint as “Downloading model,” exposed a dismiss-only X that looked like cancellation, and could overlap download and GPU-loading feedback.
User impact
Selecting a diffusion GGUF now stages exactly the missing files through one actionable download surface. Users can distinguish the selected model file from shared required assets, cancel or retry through the Downloads panel, and only see GPU-loading feedback once every required download has completed.
This PR intentionally does not change companion-asset reuse or deletion policy; those product semantics remain a separate decision.
Validation
git diff --checkpassed.