Repository navigation
Studio: fetch every video component from unsloth repos - #14003
Conversation
Video families named vendor bases (Wan-AI, Lightricks, MiniMaxAI) and every component fetch went straight to them. Add _VIDEO_MIRROR_PAIRS beside the image mirror table (kept out of _MIRROR_PAIRS, which is the image companion table) so mirror_repo / canonical_base / prefer_ungated_mirror answer for video ids, and route the video fetch sites through it: the scoped base prefetch, the download plan and size estimate (listed from the mirror, staged under the repo the load reads), the from_pretrained / single-file / LTX-2.3 / LTX-2.5 / H3 modular assemblies, checkpoint picks from a mirrored repo, and the in-flight delete guard and progress scan. The upstream id stays the logical identity; prequant variant keys and the LTX-2.5 single-file check fold a mirror back onto it. HunyuanVideo-1.5 stays on hunyuanvideo-community: its licence excludes the EU, UK and South Korea.
No separate unsloth/<vendor-name> repos: the official files Studio loads are carried byte-identical, at upstream paths, by the model's existing unsloth repo. Wan2.2-TI2V-5B and Wan2.2-T2V-A14B, LTX-2, LTX-2.3 and the LTX-2.5 Diffusers pack map to their -FP8 repos, the split LTX-2.5 release to unsloth/LTX-2.5-GGUF, and MiniMax-H3 to the existing unsloth/MiniMax-H3. Wan2.1 has no unsloth repo yet and HunyuanVideo-1.5 stays licence-blocked. A GGUF picked from unsloth/LTX-2.5-GGUF keeps the Diffusers base (ltx25_default_base no longer folds the mirror), and the LTX-2.3 official file check accepts unsloth/LTX-2.3-FP8. Drop every Comfy / third-party repack read from the video path: H3_LEGACY_COMPONENT_REPO, H3_LEGACY_TE_QUANT_REPO and the MiniMax-H3 and Wan2.2-TI2V-5B rows of _SD_CPP_LEGACY_SOURCES. An install that cached the H3 VAEs or conditioner under Comfy-Org/MiniMax-H3 now fetches them once from unsloth/*.
vae/official/ in unsloth/MiniMax-H3-GGUF holds the video (fp16) and audio (fp32) VAEs rebuilt from the official MiniMaxAI weights in sd.cpp layout. They are byte-identical to the vae/ copies that came from the Comfy-Org repack, which stay for released builds.
text_encoders/official/ in unsloth/MiniMax-H3-FP8 holds the int8 ConvRot Qwen3-VL-32B conditioner rebuilt from the official MiniMaxAI text_encoder with Studio's quantize_convrot_int8_weight. It is byte-identical to the text_encoders/ copy from the Comfy-Org repack, which stays for released builds.
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. |
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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eeb7e2b0f0
ℹ️ 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".
| base = repo_id if kind == "pipeline" else resolve_video_base_repo(fam, base_repo, repo_id) | ||
| # Where the base's components are FETCHED from when no staged snapshot dir covers them: its unsloth mirror. | ||
| # ``base`` stays the upstream id every table below is keyed on. | ||
| fetch_base = _video_fetch_repo(base, hf_token) or base |
There was a problem hiding this comment.
Preserve the exact-file mirror choice during assembly
When an upstream repo has any cached weight but not the complete component set, _predownload_base correctly downloads the required files into the mirror after checking the exact filenames, but this second call omits files and switches fetch_base back to the partially cached upstream. This breaks the LTX-2.3 path in particular because it deliberately discards _base_local_dir and resolves every component through fetch_base, causing redundant upstream downloads or an offline failure despite the complete mirror snapshot just having been staged. Carry the predownload repo choice forward, or repeat the exact-file completeness check here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. With a partial upstream cache the exact-name check in _predownload_base picked the mirror, but assembly re-decided without the names and went back to the upstream; LTX-2.3 was hit hardest since it resolves every component through fetch_base. Fixed in 6152487: _predownload_base records its choice, _run_load passes it on as _base_fetch_repo, and load_pipeline and the H3 modular loader use it ahead of the default. Test: test_assembly_reads_the_repo_the_predownload_staged.
| downloaded = sum( | ||
| self._cache_bytes(rid) | ||
| for rid in dict.fromkeys( | ||
| _video_repo_aliases(loading.repo_id) + _video_repo_aliases(loading.base_repo) | ||
| ) |
There was a problem hiding this comment.
Count only cache aliases used by the active load
When both sides of a mirror pair have cache entries, summing every alias counts blobs that the active load is not reading. For example, a partial upstream LTX cache plus a download into its mirror can make downloaded reach expected_bytes immediately, so the progress endpoint reports finalizing while large mirror shards are still downloading. Track the selected fetch repo for each entry rather than adding both complete cache directories.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. Summing both sides of a pair counted a partial upstream cache the load never reads, so the bar could show finalizing while mirror shards were still downloading. Fixed in 6152487: each fetch site records the repo it chose in _VideoLoadingState.fetch_repos and load_progress counts only that side, using the default choice until one is recorded. The delete-cached guard still claims both sides. Test: test_progress_counts_only_the_side_the_load_fetches.
| if base and not Path(base).expanduser().exists(): | ||
| info = api.model_info(base, files_metadata = True) | ||
| info = api.model_info(_video_listing_repo(base), files_metadata = True) | ||
| total += sum( |
There was a problem hiding this comment.
Fetch LTX-2.5 shard indexes from the listing mirror
Although the LTX-2.5 base listing is now read from _video_listing_repo(base), the resulting info is still passed to _ltx25_plan_shards with the original base; that helper downloads every shard index from this argument. For Lightricks/LTX-2.5-Diffusers, the download estimate therefore still contacts the gated upstream, commonly gets a 401 and falls back to heuristic shard selection, contradicting the authentication-free mirror path used by the actual predownload. Pass the same listing repo to the shard-index helper, as download_plan already does.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The estimate read the listing from the mirror but still fetched the shard indexes from the gated upstream. Fixed in 6152487: it now passes _video_listing_repo(base) to _ltx25_plan_shards, as download_plan already does. Test: test_ltx25_estimate_reads_shard_indexes_from_the_listing_mirror.
…ly and progress - carry the predownload's exact-name mirror choice into assembly (LTX-2.3 reads every component through it) - load_progress counts only the side of each mirror pair the load fetches from - UNSLOTH_DIFFUSION_NO_MIRROR folds base components only, an explicit checkpoint pick stays in its repo - LTX-2.5 estimate reads shard indexes from the listing mirror [skip ci]
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6152487b5f
ℹ️ 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".
| or _video_fetch_repo(rid, checkpoint = is_checkpoint) | ||
| or rid, | ||
| ) | ||
| downloaded = sum(self._cache_bytes(rid) for rid in dict.fromkeys(reading.values())) |
There was a problem hiding this comment.
Restrict progress bytes to the planned file set
Even after selecting only one mirror alias, _cache_bytes still totals every blob in that repository. The new carrier repositories deliberately contain their own root FP8/GGUF checkpoints that _base_download_files excludes from expected_bytes; if one of those artifacts is already cached, its multi-GB size is nevertheless added to downloaded, so the endpoint can report finalizing while required base shards are still downloading. Progress must count the selected entry's required files rather than the entire carrier cache.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. Picking one side of the pair still counted the carrier repo's own cached root checkpoints, which the estimate excludes. Fixed in d60eece: the estimate returns the names it summed, _run_load stores them on the loading state, and load_progress counts only those snapshot entries plus in-flight .incomplete blobs. Tests: test_progress_counts_only_planned_files_of_a_carrier_repo, test_estimate_reports_the_planned_names.
… and the planned files - name-less fetch choice (assembly, offline loads, progress) prefers the more complete cached snapshot, upstream on a tie - named fetch choices reuse an upstream complete under either cache root, as the reuse_other_cache_root fetch does - load_progress counts only the planned file names plus in-flight blobs, not a carrier repo's own root checkpoints - the H3 staging index read goes through the same mirror as the base pull [skip ci]
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d60eece021
ℹ️ 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".
| with self._lock: | ||
| recorded = getattr(self._loading, "fetch_repos", None) | ||
| if isinstance(recorded, dict): | ||
| recorded[_video_fetch_key(logical)] = fetched |
There was a problem hiding this comment.
Track checkpoint and base fetch sides separately
When a user selects a root checkpoint from a carrier repo whose mirrored upstream is also its companion base—for example, an FP8 checkpoint in unsloth/Wan2.2-TI2V-5B-FP8 with base Wan-AI/Wan2.2-TI2V-5B-Diffusers—both fetches collapse to the same canonical key here. If the base is complete upstream, _predownload_base overwrites the checkpoint's mirror choice, while fetch_files still unions the checkpoint and base names; load_progress() then scans only the upstream cache and cannot see the selected checkpoint in the carrier cache, so it remains in downloading until the load abruptly becomes ready. Key the recorded choices by fetch entry or physical repository rather than only by canonical mirror pair.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. Keying by mirror pair merged a carrier checkpoint with the base it mirrors, so the base's choice overwrote the checkpoint's. Fixed in f1e8813: fetch choices and planned names are recorded per role (checkpoint / base), each role is counted against the repo it actually reads, and roles sharing a repo are scanned once. The pick and its partner expert now share one choice settled on both names. Test: test_progress_tracks_a_carrier_checkpoint_and_its_mirrored_base_separately.
| for name in files: | ||
| for rev in revisions: | ||
| entry = rev / name | ||
| try: | ||
| blob = os.path.realpath(entry) | ||
| if entry.is_file() and blob not in seen: | ||
| seen.add(blob) | ||
| total += os.path.getsize(blob) |
There was a problem hiding this comment.
Count only the active snapshot revision
When the cache retains multiple revisions of a repository and a planned filename changed between them, this loop adds the blobs from every revision. For a checkpoint-only load, an old cached checkpoint with the same name can therefore satisfy expected_bytes before the new revision has downloaded at all; for a base load, superseded shards similarly make the progress endpoint enter finalizing early. Restrict the scan to the revision selected for this load (ideally the listing SHA or the current ref) rather than all snapshot directories.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The scan added blobs from every cached revision, so a superseded file with the same name could fill the bar early. Fixed in f1e8813: planned names are read from one revision only, the commit the plan was sized from when the fetch repo is the listing, otherwise the one refs/main points to. Test: test_progress_reads_only_the_active_revision.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1e8813a1d
ℹ️ 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".
| blobs = folder / "blobs" | ||
| if blobs.is_dir(): | ||
| for blob in blobs.glob("*.incomplete"): | ||
| try: | ||
| total += blob.stat().st_size |
There was a problem hiding this comment.
Exclude unrelated incomplete blobs from progress
When a carrier repo contains a stale or concurrent partial download, the new planned-name filter still adds every *.incomplete blob in that repo, regardless of the planned filenames or pinned revision. Because these carrier repos also host their own multi-GB FP8/GGUF checkpoints, an abandoned checkpoint download can make a base load reach expected_bytes and report finalizing while required base shards are still downloading. Count only incomplete blobs associated with the active fetch, or omit unidentifiable partial blobs from the planned-file total.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. Any partial download in the repo counted, including an abandoned pull of a carrier's own checkpoint. Fixed in 8e7740c: the estimate records the planned files' blob keys (LFS sha256, else git blob id), and progress counts an in-flight .incomplete blob only when its key is one of them; partials that cannot be identified are never counted. Tests: test_progress_skips_incomplete_blobs_of_unplanned_files, test_estimate_records_the_planned_blob_keys.
| if fam is not None and fam.name == "ltx-2.5" and not ltx_file: | ||
| from .video_ltx25 import LTX25_SINGLE_FILE_REPO, is_ltx25_single_file_base | ||
| if is_ltx25_single_file_base(repo_id): | ||
| if is_ltx25_single_file_base(repo_id, fold_mirror = False): |
There was a problem hiding this comment.
Reject pipeline loads of the LTX-2.5 carrier
When unsloth/LTX-2.5-GGUF is requested as a pipeline without a selected DiT file, disabling mirror folding here prevents this guard from recognizing it as the carrier for the split single-file release. That repository has no pipeline model_index.json, so predownload can stage its large companion set before from_pretrained() fails during assembly. Mirror folding only needs to be disabled in ltx25_default_base() for an actual GGUF pick; this no-file pipeline check should treat the carrier like Lightricks/LTX-2.5 and reject it immediately.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The guard compared names without folding the mirror, so the carrier slipped past it and staged its companions before failing in assembly. Fixed in 8e7740c: the no-file pipeline check treats unsloth/LTX-2.5-GGUF like Lightricks/LTX-2.5 and refuses it up front; ltx25_default_base still skips the folding, so a GGUF pick from the carrier keeps the Diffusers base. Test: test_a_pipeline_load_of_the_ltx25_carrier_is_refused.
…ly planned partials, refuse the LTX-2.5 carrier as a pipeline - modular H3 specs naming either side of the base's mirror pair load from the repo the base was staged from - progress counts an in-flight .incomplete blob only when its key is one of the planned files' blob keys - a pipeline load of unsloth/LTX-2.5-GGUF is refused like Lightricks/LTX-2.5 (no model_index.json) [skip ci]
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e7740c1c5
ℹ️ 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".
| if _upstream_is_cached(repo_id, tuple(files), other_root = True): | ||
| return repo_id |
There was a problem hiding this comment.
Scan the fallback cache root used by fetches
When the user changes the cache folder and a complete upstream snapshot exists only in Hugging Face's import-time cache root, this branch selects the upstream because subsequent fetches use reuse_other_cache_root=True. However, _cache_bytes scans only hub_cache_dir(), so none of those planned bytes are counted and progress remains at downloading—often zero bytes—until the load abruptly becomes ready. Progress should scan the same fallback root or record the paths actually resolved by the fetches.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The fetch choice reuses an upstream that is complete in the fallback cache root, but progress only scanned the live root. Fixed in f6769ab: progress now reads the load's fetch plan and counts each planned file by blob key in both roots. Test: test_progress_reads_the_fallback_cache_root.
| getattr(info, "sha", None), | ||
| _planned_etags(info, names), |
There was a problem hiding this comment.
Pin fetches to the revision used for progress
When main moves between model_info() and the multi-file predownload, this records the old listing SHA, but _predownload_base downloads each file without a revision, so the files can land under the newer SHA. _cache_bytes then scans only the old snapshot and uses etags from the old commit, leaving progress in downloading after the required files finish; pass this SHA through to the downloads or record the revision they actually resolved.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The estimate recorded the listing commit but the downloads were not pinned to it. Fixed in f6769ab: the load records one fetch plan per role (repo, pinned commit, blob key and size per file) at estimate time; the checkpoint fetch and the base predownload, including its listing and shard-index reads, use that repo and commit, and progress counts the same blob keys, so a moving main cannot split them. Tests: test_predownload_follows_the_plan_repo_and_revision, test_estimate_settles_one_plan_per_role, test_progress_without_a_blob_key_reads_the_pinned_revision.
| with self._lock: | ||
| recorded = getattr(self._loading, "fetch_repos", None) | ||
| if isinstance(recorded, dict): | ||
| recorded[role] = fetched |
There was a problem hiding this comment.
Scope fetch-repo updates to the active load
When a load is superseded while its metadata or predownload work is in flight, the old worker can call this method after _loading has already been replaced by the new load's state. Because the update is not checked against a load token or the state object that initiated it, the stale worker records its checkpoint/base repo in the new load and load_progress() scans the wrong cache until another update happens, or permanently if the stale call arrives last. Pass the originating token/state into this method and ignore updates for a different active load.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. A superseded worker could record its fetch repo on the next load's state. Fixed in f6769ab: fetch sites no longer write load state at all; the plan is written once per estimate by the worker that owns the load, under its token check, and progress reads only that. Test: test_a_superseded_worker_cannot_rewrite_the_active_plan.
…d the progress bar The estimate settles, per role (checkpoint / base), the repo to fetch, the commit to pin (the listing's, when that repo is the listing) and every file's blob key and size. _run_load stores it under its load-token check; the checkpoint fetch and the base predownload read repo + revision from it; load_progress reads only it, counting each planned file by blob key (complete or in flight) in the plan repo across both cache roots. Removes the per-site fetch-repo updates, the snapshot-revision scan and the incomplete-blob guesswork. [skip ci]
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6769ab5aa
ℹ️ 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".
| _video_fetch_repo(repo_id, hf_token, files = (gguf_filename or "",), checkpoint = True), | ||
| gguf_filename or "", | ||
| hf_token, | ||
| reuse_other_cache_root = True, |
There was a problem hiding this comment.
Reuse the pinned checkpoint during assembly
When main advances after _estimate_download_bytes() and the first _run_load checkpoint download, load_pipeline() resolves the same checkpoint again through this helper without the plan's revision, so it can download and load the newer checkpoint while progress and the companion plan remain pinned to the older commit. This can silently run different weights than the estimated artifact, including separately re-resolving a MoE partner. Fresh evidence beyond the prior fix is this second assembly-time lookup, which still has no revision parameter even though the earlier prefetch is now pinned.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. Assembly resolved the checkpoint and its partner again from main. Fixed in a6b7b82: load_pipeline gets the plan's checkpoint (repo, revision) and both resolvers download exactly that; re-plans made after the checkpoint fetch keep the entry it was fetched under. Tests: test_assembly_opens_the_pinned_checkpoint_and_partner, test_every_hub_call_of_a_load_matches_its_plan.
- assembly re-opens the checkpoint (and its MoE partner) at the plan's repo + revision - the base plan is settled again when an encoder fetch skips a different set than planned; re-plans keep the checkpoint entry it was fetched under - the base revision reaches every hub-id base read: pipeline from_pretrained, the LTX-2.3 assembly, the H3 modular index and the redirected load_components specs - the cached-snapshot completeness score requires weights beside a model config - invariant test: a load touches the Hub only at the (repo, revision) pairs its plan names [skip ci]
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 196a3b1917
ℹ️ 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".
| **( | ||
| {"revision": revision} | ||
| if revision and (fetch_repo or "").lower() == listing.lower() | ||
| else {} |
There was a problem hiding this comment.
List dense top-ups from the selected base revision
When the base plan reuses an older cached upstream snapshot, fetch_repo and revision identify that upstream commit, but this branch still lists the mirror's current head. If a pre-cast injection then fails and the mirror has renamed or reshared a component since the cached revision, the top-up derives current mirror filenames and requests them from the older upstream commit; the pull falls back to the original sparse snapshot, and the subsequent local from_pretrained() fails because the dense weights were never restored. The expanded file list must come from the selected upstream revision, or from a retained matching listing revision.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Keeping the top-up on the plan here: it is the one place the load's progress, cancel and disk preflight are accounted for, and the listing deliberately never asks the gated vendor repo, so the cached upstream's own commit cannot be listed for an anonymous load. The case needs the mirror to have renamed or resharded a component since the cached upstream revision, and then the pinned pull of the missing name fails and the load reports it, rather than assembling a mixed snapshot.
… it reads A GGUF or single-file pick brings its own denoiser, so the offline choice between an upstream and its mirror no longer counts the transformer folders the pick replaces. [skip ci]
# Conflicts: # studio/backend/core/inference/video.py [skip ci]
# Conflicts: # studio/backend/core/inference/diffusion_families.py [skip ci]
…s and stale H3 indexes; read the hosted LTX-2.5 encoder at its own ref [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
…d budget dense when it is not [skip ci]
Adds nvidia/Cosmos3-Nano and nvidia/Cosmos3-Edge to the Video page through diffusers' Cosmos3OmniPipeline (diffusers >= 0.40.0): text-to-video, and image-to-video from a first frame, following the layout of the Wan2.1 families (unslothai#13376) and the image-to-video path of unslothai#13378. Cosmos3 differs from the other video families in three ways the generic path did not handle, and each gets the smallest change that fits: - Its transformer is also its text model, so the pipeline has a tokenizer and no text encoder. A family whose bf16 component table prices the text encoder at 0.0 is now read as having none: sizing requires only transformer and vae, a cached snapshot without a text_encoder/ folder counts as complete, and an explicit text_encoder_quant is refused with the reason (relates to unslothai#14000). - Each card samples with scheduler and call settings that its shipped configs do not hold. New VideoFamily fields scheduler_overrides and call_kwargs carry them; a scheduler that rejects an override keeps its config. - The pipeline takes the first frame through its own image= argument and crops it itself (i2v_fits_first_frame = False; same pipeline class for both modes). Fidelity, measured against the plain diffusers pipeline at the cards' settings, seed 0, with Studio's own encoder on both sides: every frame identical for Nano (189 of 189, four clips) and Edge (121 of 121, four clips). Three settings were needed to get there and are set on both rows: - cudnn.benchmark off: two server processes otherwise rendered one Edge seed 55 dB (t2v) and 30 dB (i2v) apart. - The VAE encoder stays on the stock kernels: Edge image-to-video at the default speed was 29.5 dB from the card's output through the fused encoder, 51.8 dB with the stock one. - Cosmos3 decodes untiled when it fits, on every speed tier, with tiled decode as the out-of-memory fallback: the stock 16x tiles leave a 4-latent edge tile at 480 / 832 px and a faint seam. The seam is recorded as a strict expected failure in the tile-geometry test so a fix forces the entry out. Also in this commit: the local layout check reads a diffusers-library *Tokenizer component as a model, so Nano's sound_tokenizer/ no longer makes a complete local folder look broken; the download planner recognises the text_tokenizer/-without-text_encoder/ listing as Cosmos3's; the Reasoner, Policy, Sim, Transfer and FP8 builds are refused by name with the repo to load instead; Cosmos3-Super gets no family; the Hub catalog reads Cosmos3 pipelines as "Video gen"; a renamed local Cosmos3 folder is refused by the trainer instead of falling to the SDXL path; and the guardrail opt-out is passed through when the cosmos_guardrail package is absent. Components are fetched from the nvidia repos: no unsloth-hosted copies exist, both repos are public and ungated (OpenMDW-1.1), and the allowlist gains the same two lines Wan2.1 has (relates to unslothai#14003). Quantized Cosmos3 checkpoints are a follow-up (unslothai#12851): diffusers has no single-file converter for Cosmos3OmniTransformer, so a quant needs a hosted source and a key-map loader. Tests: family registry and freeze fixtures, component sizing, flow-shift and scheduler overrides, the i2v class invariant, refusals, local-folder detection, routes, mirrors, and opt-in GPU checks that render both models and compare against the diffusers output.
Adds `nvidia/Cosmos3-Nano` and `nvidia/Cosmos3-Edge` as Studio video families, following #13376 and #13378: text-to-video and image-to-video through diffusers' `Cosmos3OmniPipeline` (diffusers >= 0.41.0: 0.40.0 resolves a group-offloaded transformer's device as the CPU). **What's different about Cosmos3** - Its transformer is also the text model, so the pipeline has a tokenizer and no text encoder. A family whose bf16 component table prices the text encoder at 0.0 is now read as having none: sizing needs only transformer and VAE, a snapshot without `text_encoder/` counts as complete, and an explicit `text_encoder_quant` is refused with the reason (relates to #14000). - Each card samples with scheduler and call settings its shipped configs don't hold. New `VideoFamily` fields `scheduler_overrides` and `call_kwargs` carry them. - The pipeline takes the first frame through its own `image=` and crops it itself. - Components come from the nvidia repos: no unsloth-hosted copies exist, both are public and ungated (OpenMDW-1.1), allowlist gains the same two lines Wan2.1 has (relates to #14003). **Fidelity**: Studio output is frame-for-frame identical to the plain diffusers pipeline for both models (Nano 189/189 frames, Edge 121/121, four clips each, seed 0). Three settings were needed: `cudnn.benchmark` off, the VAE encoder on stock kernels, and untiled decode when it fits, including at speed off and under model / group / streaming offload (the stock 16x tiles leave a 4-latent edge tile at 480/832 px). When untiled does not fit, and on CPU / MPS, the tiled decode uses per-canvas strides that keep every edge tile at 8 or more latents (stock strides wherever they already do). **Also in this PR** (separate commits, can be split out; the root-index prefetch fix moved to #15184) - The latest-transformers offer in the UI covers the `cosmos3` / `cosmos3_edge` model types (the `unsloth run` prompt for it is left to a separate PR). - Frontend: picker rows, Hub "Video gen" label, page defaults; bundle budget raised by the bytes the rows add. **Tests**: backend and frontend suites show no new failures against main (same failing ids on both trees, all environment-related); typecheck clean. Real-weight renders were checked against plain diffusers outside the test suite (Edge on a B200: bit-identical, t2v and i2v; Edge on a T4: valid fp32 output). **Not in this PR**: training support, and quantized Cosmos3 checkpoints (#12851); diffusers has no single-file converter for `Cosmos3OmniTransformer`, so a quant needs a hosted source and a key-map loader. `cosmos_guardrail` is not required: Nano's `model_index.json` enables the safety checker by default, so the load either passes the opt-out or refuses with a message naming the package. Edge ships with it off. **Download and offload**: a Nano download skips `sound_tokenizer/` (1.99 GB, passed as None), a local Nano folder without `sound_tokenizer/` or `vision_encoder/` validates, and under `low_vram` the VAE goes back to the CPU after the conditioning encode for both t2v and i2v (real Edge: VAE on `cuda:0` at every transformer step before, `cpu` after). ## Screenshots Video page model picker on the merge base (left) and this branch (right): the branch lists Cosmos3 Edge after the HunyuanVideo rows.  The Hub pair below is harness state, not this PR: the two sides read the live Hub listing at different times, so the trending rows differ (the masked shot is otherwise identical). macOS and Windows legs: 41 of 41 steps identical. <!-- studio-regress:start --> ### Studio UI regression check Base `c9e5d4ab0` vs head `4aa1f7b91`. Functional: **NO_REGRESSION**, UI coverage 89%, 1 visual change(s), 0 text-only change(s). Only steps whose screenshots differ are shown. **crawl/r_hub**: masks cover 37% of the shot | reproduced on confirm (VISUAL_DIFF) Facts: `missing`: {'before': ['button:DeepSeek-V#.#-Flash-#-GGUF', 'button:Model hub', 'button:NVIDIA-Nemotron-#.#-Super-VL-#B-A#B-GGUF', 'button:Qwen#.#-#B-A#B-GGUF', 'button:Search', 'button:Show workflows', 'button:gemma-#-#B-A#B-it-GGUF'], 'after': ['button:Filters', 'button:MiniMax-H#-GGUF', 'button:NVIDIA-Nemotron-#.#-Super-VL-#B-A#B-GGUF', 'button:Show workflows']}  <!-- studio-regress:end --> --------- Co-authored-by: Daniel Han <[email protected]>
…ow to fix it (unslothai#15547) Replaces unslothai#14698 with a much smaller change. ## Problem Users who installed MiniMax-H3 before unslothai#14003 have the VAEs cached under the old names. Since unslothai#14003 the native H3 load looks them up under `vae/official/...`, so a cache-only load fails with huggingface_hub's bare `LocalEntryNotFoundError`. That message does not say which file is missing or how to recover. Cache-only loads are offline hosts and API-triggered auto-switch loads (`media_auto_switch.py` loads with `local_files_only = not user_initiated`, passed through `routes/video.py`). A single online, user-started load fixes the cache. ## Fix In the native H3 download loop (`_run_load_h3_native`), when the load is cache-only and the fetch fails with a local cache miss (detected with the existing `VideoBackend._te_fetch_miss`), raise a clear error instead: ``` MiniMax-H3 needs its video VAE (vae/official/minimax_h3_video_vae_fp16.safetensors) from unsloth/MiniMax-H3-GGUF, and it is not in the local Hugging Face cache. This load may only use cached files (offline, or a load Studio started on its own), so it could not download it. Load MiniMax-H3 once while online (or reconnect) so Studio can fetch it; after that it loads offline. ``` The component name comes from the same file to role map `h3_download_error` already uses (now a small shared helper). The original exception is kept as `__cause__`. The load worker stores `str(exc)` as the load progress error, so this text is what the UI and API show. Not changed: the unslothai#14003 policy (no reuse of old names or Comfy-cached bytes, no hashing, no snapshot scans), online loads, and every other error, which still goes through `h3_download_error` as before. ## Tests New tests in `studio/backend/tests/test_sd_cpp_h3_matrix.py` drive `_run_load_h3_native` with the video VAE fetch failing: - cache-only load, `LocalEntryNotFoundError`: raises the new message naming the file, and the text survives the load worker's error handling unchanged (fails on main, passes here) - online load, `LocalEntryNotFoundError`: the same exception object propagates - cache-only load, unrelated `OSError`: the same exception object propagates `pytest -n 4` over `test_sd_cpp_h3_matrix.py`, `test_video_backend.py`, `test_video_offline_load.py`, `test_h3_native_{server,resident,memory_fit,nonfinite}.py`: | | failed | passed | |---|---|---| | main + new tests | 1 (`test_h3_cache_only_load_names_the_missing_vae_and_the_fix`) | 890 | | this branch | 0 | 891 |
Studio: fetch every video component from unsloth repos
Each video family in Studio is identified by a vendor base (Wan-AI, Lightricks, MiniMaxAI). Until now, everything a video load needs came straight from that vendor repo: transformer, text encoder, tokenizer, VAE, audio VAE, connectors, latent upsampler and scheduler. GGUF and FP8 picks were no exception, because their companions come from the base. LTX-2.5 was the worst case. Both
Lightricks/LTX-2.5-DiffusersandLightricks/LTX-2.5are gated, so every LTX-2.5 load needed a Hub login that had accepted the terms.This PR reuses the image side's mirror mechanism (
_GATED_MIRROR_PAIRS/_UNGATED_MIRROR_PAIRS,prefer_ungated_mirror). No new repos are created. The official files Studio loads are carried byte-identical, at their upstream paths, by the model's existing unsloth repo: its-FP8repo, or-GGUFwhen there is no-FP8. That includes the bf16 transformer, so bf16 pipeline loads also stay insideunsloth/*. FLUX.3 already does the same thing withunsloth/flux-3-image-klein-FP8.Pairs
Wan-AI/Wan2.2-TI2V-5B-Diffusersunsloth/Wan2.2-TI2V-5B-FP8Wan-AI/Wan2.2-T2V-A14B-Diffusersunsloth/Wan2.2-T2V-A14B-FP8Lightricks/LTX-2unsloth/LTX-2-FP8Lightricks/LTX-2.3unsloth/LTX-2.3-FP8Lightricks/LTX-2.5-Diffusers(gated)unsloth/LTX-2.5-FP8Lightricks/LTX-2.5(gated)unsloth/LTX-2.5-GGUFMiniMaxAI/MiniMax-H3unsloth/MiniMax-H3.gitattributes, where the Hub appends LFS rules for the new files..pt, root.safetensors,.gguf,samples/). Each repo can therefore stand in for the base.Studio changes
diffusion_families._VIDEO_MIRROR_PAIRS(gated and ungated halves) feeds the samemirror_repo/canonical_base/upstream_is_gatedlookups. It is kept out of_MIRROR_PAIRS, whichhub/utils/companion_assetsreads as the image companion table, so nothing on the image side changes._video_fetch_repo:download_planand the size estimate. Listings and sizes are read from the carrier repo, and the staged entry names the repo the load actually reads.from_pretrainedand the single-file configmainthat moves mid-load or a partial cache cannot mix revisions or mis-report progress. A test records every Hub call of a load and checks it against the plan.status(), saved configs and the prequant tables all use it._prequant_base_key,is_ltx25_single_file_baseand the LTX-2.3 official-file check map a carrier repo id back to its upstream.unsloth/LTX-2.5-GGUFkeeps the Diffusers pack as its base. That repo also carries the split release's files now, butltx25_default_basechecks the pick's own id without mapping it back.UNSLOTH_DIFFUSION_NO_MIRROR, local paths, and an upstream cache that already holds the files being fetched.H3_LEGACY_COMPONENT_REPO,H3_LEGACY_TE_QUANT_REPOand the MiniMax-H3 and Wan2.2-TI2V-5B rows of_SD_CPP_LEGACY_SOURCESare removed. An install that cached the H3 VAEs or the conditioner underComfy-Org/MiniMax-H3fetches them once fromunsloth/*.MiniMax-H3 native files
The sd.cpp path's two VAEs and the hosted int8 ConvRot conditioner used to be copies of files from the Comfy-Org repack. They were rebuilt from the official MiniMaxAI weights in
unsloth/MiniMax-H3:quantize_convrot_int8_weightAll three rebuilt files are byte-identical to the files already hosted, so they were added beside the originals rather than replacing them:
vae/official/minimax_h3_video_vae_fp16.safetensorsandvae/official/minimax_h3_audio_vae_fp32.safetensorsinunsloth/MiniMax-H3-GGUFtext_encoders/official/qwen3vl_32b_minimax_h3_int8_convrot.safetensorsinunsloth/MiniMax-H3-FP8This build reads those paths. Released builds keep reading the originals, which are unchanged. Encoded through Studio's loader on 16 prompts, the conditioner scores cosine 0.99985 mean (0.99830 min) against the dense bf16 encoder, identical to the hosted file. The A/A floor is exactly zero, since repeated runs are bitwise deterministic.
Not covered
hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_t2vand-720p_t2v) is not mirrored. The Tencent Hunyuan Community License "DOES NOT APPLY IN THE EUROPEAN UNION, UNITED KINGDOM AND SOUTH KOREA AND IS EXPRESSLY LIMITED TO THE TERRITORY", and a public Hub repo cannot honour that. HunyuanImage-2.1 has no mirror for the same reason.Wan-AI/*(ungated, Apache 2.0).Tests
New
tests/test_video_unsloth_mirrors.py:mirror_repo/canonical_base/prefer_ungated_mirrorunsloth/*, apart from the allowlist; the allowlist is also checked for exactnessAll of these fail on
main. The existing plan / load tests intest_video_backend.pyandtest_video_routes.pyare written against the upstream ids their fake Hub serves. They pinUNSLOTH_DIFFUSION_NO_MIRROR=1, as the image offline-load tests already do. The tests that pinned the removed Comfy legacy reuse are gone.