Skip to content

Studio: count companion assets in the Hub download size of image and video GGUFs - #12370

Merged
Lyxot merged 4 commits into
unslothai:mainfrom
oobabooga:worktree-hub-diffusion-download-footprint
Oct 1, 2026
Merged

Lyxot merged 4 commits into
unslothai:mainfrom
oobabooga:worktree-hub-diffusion-download-footprint

Conversation

@oobabooga

Copy link
Copy Markdown
Member

The Hub shows only the GGUF file size for image and video models. Qwen-Image-2.1 Q5_K_M reads 5.4 GB, but Run then fetches about 19 GB of required assets (#11637).

The Images and Video pickers already include these assets through the host's download plan (#8036). This adds the same total to the Hub.

Fix

  • Reuse the media download planner once per companion set, with default load settings and the Hub token.
  • Show model plus companion size in the quant selector and menu, with a breakdown on hover.
  • Keep fit checks, sorting and downloads unchanged. Partial rows retain "X left"; failed or incomplete plans fall back to the checkpoint size.
  • Reuse plans for five minutes, scoped to page, repo, file and token. Do not cache failures or show results from another request identity.
  • Fix picker spacing ("23 . 1 GB"), align help icons with the digits, and add spaces before tooltip units.

Screenshots

BEFORE: merge base adbf205f17. AFTER: this branch. Both served on the same host.

Hub quant menu for Qwen-Image-2.1-GGUF:
hub_menu_before_after

Selected quant's size tooltip:

hub_tooltip_before_after

Images picker's expanded quant rows:

picker_before_after

Tests

Live A/B on Linux in headless Chromium, using the same backend code with GPUs hidden:

Hub card Main This PR
Qwen-Image-2.1 Q5_K_M 5.4 GB 24.3 GB (5.4 GB model + 19 GB required assets)
LTX-2.3 Q8_0 (distilled-1.1) 23 GB 75.7 GB (23 GB model + 53 GB required assets)
Qwen3.8-27B GGUF (chat) unchanged unchanged, no plan request

Qwen's 19 GB matches the base repo's encoder, VAE and processor. Opening the card sends one plan request. A separate CUDA plan call returned 23.41 GB, including an FP8 encoder and a cached INT8 transformer.

  • New tests cover sizing, routing, grouping, partial rows, cache reuse, retries and request identity changes.
  • Frontend: 9498 of 9507 tests passed; all nine failures also fail on main. Typecheck, build and bundle budget passed.

Scope

@oobabooga

Copy link
Copy Markdown
Member Author

Reached Codex review convergence at oobabooga#322.

@Lyxot Lyxot self-assigned this Oct 1, 2026
…ownloads

Count only uncached companion files from the download plan's entries instead of required_bytes, which includes companions already in the cache and overstated the transfer by the full companion set (e.g. 24.3 GB shown for a 5.4 GB Run).

Plan unkeyed variants (video families, whose companions differ per checkpoint) per file when selected, instead of applying one representative's companions to every row.

Show companions on downloaded quants, including next to Run, since Run is what fetches them; partial quants keep their remaining size.

Reuse plans for the card's lifetime instead of a five-minute module cache, so returning from Run re-plans, and format the total and its breakdown with one decimal so they add up.
@Lyxot

Lyxot commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Pushed e16b091 on top of the PR.

  • Count only companions that are not cached. required_bytes is the full on-disk footprint, so it also counts companions already in the cache. With Qwen-Image-2.1's encoder and VAE cached, Q5_K_M read 24.3 GB while Run fetched 5.4 GB. The size now comes from the plan's entries, which list only uncached files. The selected GGUF is subtracted even when it shares an entry with companions from the same repo.
  • Plan each video file separately. Video GGUFs have no dependency_key, but their companions differ by checkpoint: LTX-2.3 dev vs distilled extras, and the MiniMax-H3 Q2 vs Q4 encoder. One plan was applied to every row: on LTX-2.3, distilled BF16 needs nothing extra while dev Q4_K_M needs 4.1 GB. Rows without a key are now planned per file, once selected. Keyed image groups still share one plan.
  • Show companions on downloaded quants too. The card offers Run only once the GGUF is downloaded, and Run is what fetches the companions. This includes the size next to Run, which previously showed nothing while about 19 GB was still to come. Partial quants keep "X left".
  • Reuse plans per card, not for five minutes. A cache-aware total goes stale after Run, so plans are now kept only while the card is open. This also stops the duplicate plan request each time the variant list refetches.
  • Make the total and the breakdown add up. Both now use one decimal through GB/TB, so the total no longer sits above a breakdown like "14 GB + 4.1 GB".

Checked in Unsloth Studio:

Card Size shown
Qwen-Image-2.1 Q5_K_M (companions cached) 5.4 GB, one plan request
FLUX.2-klein-4B BF16 16.0 GB (7.8 + 8.2)
LTX-2.3 dev Q4_K_M 18.5 GB (14.3 + 4.1)
LTX-2.3 dev BF16 46.2 GB

Lyxot added 2 commits October 1, 2026 14:53
…try on older backends

A plan flagged plan_failed now rejects, so the per-card plan cache drops it and a later rerun retries instead of keeping the checkpoint-only size until the card is reopened.

An older backend omits the per-entry checkpoint flag; fall back to the entry's file list, as the Images and Video pages already do, so the GGUF is not counted as a required asset.
…ckpoint flags

Entries keep a stable scoped file list, so a cached GGUF can be listed in an entry whose bytes are only same-repo companions; inferring the checkpoint from that list subtracted the whole model. Backends that predate the flag also predate checkpoint_bytes and required_bytes and cannot attribute bytes at all, so their plans add nothing.
@Lyxot

Lyxot commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Pushed two follow-ups from Codex review:

  • bfa7faa: a plan the backend flags as incomplete is no longer cached for the card's lifetime. It is retried on the next reselection, variant refresh or reopen.
  • 40fb8b0: a backend from before the per-entry checkpoint flag (which also predates checkpoint_bytes and required_bytes) cannot say which bytes belong to the checkpoint. Its plans now add nothing, so the row keeps the GGUF size. Guessing from the file list could subtract the whole model.

I declined one suggestion, with the reasons in the thread. When a GGUF is reused from an older snapshot and missing companions share its repo entry, the companion size is understated. That needs the diffusers planner, same-repo companions and a republish all at once, and in the worst case the row shows the plain GGUF size, as main does today. An exact fix needs a backend contract change.

Codex review on 40fb8b077d (current head): Didn't find any major issues. CI on the same head: all 38 checks passed (staging run). Two Windows jobs were rerun once and passed: Composer hit a PyPI download timeout, and the unit-test failure was an unrelated chat test that passes locally.

@Lyxot Lyxot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The Hub now shows the companion assets Run still has to download for image and video GGUFs. Codex converged and CI passed on 40fb8b0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants