Repository navigation
Studio: keep loading a downloaded retired FLUX.3 full copy from disk - #14835
Conversation
The copies were retired for size, not for their files. A copy complete on disk (snapshot path, or the id with a complete cached snapshot) is no longer redirected to its base, which offline raised LocalEntryNotFoundError and online downloaded the same weights again from the -FP8 mirror. Incomplete or absent copies still load through the base.
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. |
… in #14822 (#14852) pre-commit.ci fails `ruff-format-with-kwargs` again on PRs queued after 00:36 UTC (#14834, #14835, #14836, #14842, #14845): `studio/backend/tests/test_video_stream_encode.py` was merged in #14822 without the formatter, so every PR's all-files run rewrites it. Same class as #14817. `python scripts/run_ruff_format.py` (the hook's entry point, `ruff==0.6.9`) applied to that one file. The AST is identical before and after, `ruff check` passes, and a full run of the hook over every tracked Python file on this branch changes nothing else.
…snapshots The root model.safetensors pick of a complete retired copy stayed on disk but named no companion base, so the loader assembled it around the family default (the base's -FP8 mirror): absent offline, a second download online. The copy is now that pick's base_repo unless one was named. A downloaded snapshot of a retired copy went straight to the load, but only the backend knows whether it is complete; an incomplete one is redirected to the base and pulled inline, outside the download plan. Such picks are now planned by their path (with the copy as the display id), so the plan reaches the same verdict and stages the base's files first. [skip ci]
…onfig, id loads need refs/main, and a redirected snapshot is remembered as its base [skip ci]
|
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". |
# Conflicts: # studio/frontend/src/features/images/images-page.tsx [skip ci]
…ne, keep it on its snapshot in the auto-switch, and redirect an incomplete pipeline base [skip ci]
…oaded as after a page reload
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
…ick loads from disk instead of redirecting its id up front [skip ci]
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
Summary
#14173 sends every load of
unsloth/flux-3-image-kleinandunsloth/flux-3-image-klein-baseto the BFL base they copy, which Studio then fetches from the-FP8repo. That includes a snapshot of the copy that is already downloaded. The copies were retired for size (about 43 GB of the gated BFL repo, which the-FP8repo now hosts for Studio). Their files are fine: the bf16 transformer, text encoder and VAE are the base's own. So the redirect broke installs that already hold a complete copy:modular_model_index.jsonthroughhf_hub_download(local_files_only=True)and fails withLocalEntryNotFoundError, even though the model is on disk.This change keeps a copy that is complete on disk loading from disk, and redirects everything else as before:
retired_copy_loads_from_disk(diffusion_families.py): true for a snapshot path, or the copy's id with itsrefs/mainsnapshot in the live HF cache, when the folder passes the same FLUX.3 completeness check the load route applies (local_pipeline_components_are_completewithFLUX3_COMPONENT_FOLDERS). As the companion base of another single file, which supplies the transformer, the copy needs only the transformer config. Local stat only, no network.DiffusionLoadRequestskips the redirect for such a copy (model_pathandbase_repo). Its rootmodel.safetensorspick loads as the copy's own pipeline (the same weights): in the HF cache that file is a symlink intoblobs/, which the single-file path check refuses. An incomplete or absent copy, a named id with nothing cached, and every other pick are redirected exactly as in Studio: load the retired FLUX.3 full copies through their base #14173, and a pipeline redirected to the base also redirects abase_repothat names the incomplete copy._retired_copy_as_baseleaves a complete downloaded copy as its own pick, so the switch neither plans nor waits for the mirror, and the load keeps its snapshot path (by id only the active cache is searched, so a copy in an earlier Models folder would be redirected). An incomplete one is still switched as the base.retiredSnapshotAsLoaded), including after a page reload mid-load.Offline, with the copy's real file layout in the cache (real JSON, placeholder weights), a load by its id reads everything from the snapshot; the only Hub call is a non-fatal size lookup.
Testing
tests/test_flux3_retired_copy_on_disk.py(new): a complete snapshot, by path with or without the display id, stays on the snapshot. WithHF_HUB_OFFLINE=1and every Hub lookup raisingLocalEntryNotFoundError, the loader reads its manifest from disk with 0 Hub lookups. On main it is redirected and the lookup fails. The rootmodel.safetensorspick stays on the snapshot. The copy named by id stays when its cached snapshot is complete. An incomplete snapshot, a root-transformer pick missing its file, and a copy that is not on disk at all are still redirected to the base. 4 of these fail on main and all 7 pass here.blobs/) passes the route validator, the auto-switch keeps a copy in an earlier Models folder on its snapshot, and a pipeline redirected to the base does not keep an incomplete copy as itsbase_repo. These fail before the fix.tests/test_media_auto_switch.py::test_a_complete_downloaded_retired_flux3_copy_switches_to_itself(new): the switch loads the snapshot without planning the base. On main it is refused with a 409 "not fully downloaded" for the base. The existing incomplete-copy switch test is unchanged and passes.studio/frontend/tests/image-retired-full-copies.test.ts,image-load-resume.test.ts: retired-copy picks (id or snapshot) are planned and not redirected up front, and a load that went through the base, or loaded a root pick as the pipeline, is remembered as what it loaded as, also when recovered after a reload.test_flux3_retired_full_copies.py,test_media_auto_switch.py,test_diffusion_routes.py,test_diffusion_flux3.py,test_local_model_format.pypass.Not covered: a real image generation from the copy. That needs the roughly 43 GB checkpoint and a GPU; routing was checked with the copy's real configs and placeholder weights.
Before / after
Offline Studio (
HF_HUB_OFFLINE=1) with a downloadedunsloth/flux-3-image-kleinin its cache, picked from the Images page On Device list. Before, the page sendsblack-forest-labs/flux-3-image-klein, whose mirror is not cached, so the load fails. After, it sendsunsloth/flux-3-image-kleinand the load reads the snapshot on disk; it stops here only because the test cache holds placeholder weights.