Skip to content

Studio: Cosmos3-Nano and Cosmos3-Edge video families - #14554

Merged
danielhanchen merged 33 commits into
unslothai:mainfrom
sbabamohamad:studio-cosmos3-video
Oct 26, 2026
Merged

danielhanchen merged 33 commits into
unslothai:mainfrom
sbabamohamad:studio-cosmos3-video

Conversation

@sbabamohamad

@sbabamohamad sbabamohamad commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 Studio: video families default to a hosted quantized text encoder #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 Studio: fetch every video component from unsloth repos #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.

Video picker before and after: Cosmos3 Edge row appears

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 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']}
crawl/r_hub

maybe_prefetch_hf_snapshot declared a complete snapshot incomplete when the repo keeps its
weight shards in subfolders and only the index at the root. nvidia/Cosmos3-Nano and
nvidia/Cosmos3-Edge lay their weights out that way (transformer/, vision_encoder/), so
FastModel / FastVisionModel refused to load them until the user set HF_HUB_OFFLINE=1 after
a manual download. The prefetch now follows the root index to the subfolder shards and the
download gate counts them. Tests cover the root-index request and the gate.
…UI and in unsloth run

Studio's pinned transformers predates the cosmos3 and cosmos3_edge model types, so a
Cosmos3 checkpoint was reported as "not supported yet in transformers==5.5.0". The
latest-transformers offer now covers these types, including Cosmos3-Edge's inline
cosmos3_edge_projector sub-config, and `unsloth run --model` asks the same question the
UI asks.
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.
…aults

LABELS gains cosmos3-nano and cosmos3-edge in registry order. VIDEO_CATALOG gets the
Edge group, sized 9 GB from its resident footprint (bf16 weights 8.1 GB; the card's clip
peaked at 13.3 GiB whole-GPU), so it is offered on 16 GB cards and not on 12 GB ones.
Nano is unlisted in the picker until the installer pins a diffusers that loads it; the
Hub path loads it today. MODEL_DEFAULTS seeds the cards' steps and CFG on pick (Nano 35
steps, Edge 20, CFG 6.0 for both), read from the model name as the Wan rows are. The
Hub reads Cosmos3 pipelines as "Video gen" and keeps the sibling Reasoner repos in Chat.
The startup bundle budget is raised by the bytes the new rows add. Frontend tests cover
the page defaults, the catalog check, the capability split and the family override.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-24T16:43:52.492780Z
We couldn’t complete this review. Comment @codex review to try again.
c2a0107 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

danielhanchen added a commit to Etherll/unsloth that referenced this pull request Oct 24, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 24, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 24, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

danielhanchen added a commit to Etherll/unsloth that referenced this pull request Oct 24, 2026
danielhanchen added a commit to Etherll/unsloth that referenced this pull request Oct 24, 2026
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 25, 2026
unslothai#15184)

`maybe_prefetch_hf_snapshot` warms the cache before a bare remote load.
For repos with weights at the root it drops every `*/...safetensors`
file, since the load only reads root weights. That breaks repos whose
root `model.safetensors.index.json` maps shards into subfolders.
`nvidia/Cosmos3-Nano` and `nvidia/Cosmos3-Edge` keep every transformer
shard under `transformer/` and list them in the root index. The prefetch
skips those shards, so `FastModel` / `FastVisionModel` then download
them uncached, or fail offline, unless `HF_HUB_OFFLINE=1` is set by
hand.

**Change**
- `_root_index_weight_subfolders` reads the root
`model.safetensors.index.json` and returns the subfolders its
`weight_map` points into. Any failure (no index, 404, bad JSON, non-dict
map) returns `()`, so the prefetch keeps its old behaviour.
- It is probed next to the existing sentence-transformers module probe,
under the same conditions: root weights, no `subfolder=`, not
tokenizer-only / adapter-only / GGUF. When it finds subfolders, the
subdir-weight prune is skipped, like the ST case.
- `revision`, `token` and `cache_dir` are forwarded to the probe.

**Who is affected**: only repos whose root index names a path with a
`/`. Root-sharded models (`model-00001-of-00002.safetensors` at the
root) return `()` and prune exactly as before. Repos without a root
index get a 404 and keep their current path.

**Tests**: `tests/test_root_index_subfolder_weights.py` (19 cases)
drives the prefetch through a fake Hub with a Cosmos3-shaped listing, a
root-sharded listing and no index. It checks the allow/ignore patterns
`snapshot_download` receives and the probe's forwarded arguments. 11 of
the 19 fail on main and all pass here. The existing prefetch tests
(`test_prefetch_snapshot_scope.py`,
`test_st_subfolder_weights_are_fetched.py`,
`python/test_revision_forwarding.py`,
`test_hf_login_keeps_saved_token.py`) still pass: 166 passed in total.

Split out of unslothai#14554, which adds the Cosmos3 Studio video families. The
Studio path loads through diffusers and does not depend on this.
# Conflicts:
#	studio/backend/core/inference/video.py
#	studio/frontend/scripts/check-bundle-budget.ts
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 26, 2026
@danielhanchen
danielhanchen merged commit f1a1805 into unslothai:main Oct 26, 2026
danielhanchen added a commit that referenced this pull request Nov 10, 2026
…rame-rate picker (#16737)

**#16741 (Nano video continuation) is stacked on this PR. Merge this one
first.**

Lets Unsloth Studio's Cosmos3 Edge and Nano families take the generation
settings NVIDIA's model cards list, so the release doc can quote
NVIDIA's numbers and Unsloth Studio accepts them.

**UI**: the Video page on a Colab G4, main `590119de67` (BEFORE) vs this
branch (AFTER), light and dark theme set from Settings, driven with
headless Chromium. Shots at `a012d267c0` unless labelled; the two
commits after it touch only the duration snap and the picker text.

![Frame-rate controls, before and after, light and
dark](https://raw.githubusercontent.com/LeoBorcherding/unsloth/d990c609722c3db138382402fa0e854cb9fd8606/ui_frame_rate_controls.png)

Durations follow the picked rate and stay inside the frame window.
Changing the rate keeps the length you picked, not the frame count
(fixed in `74671433c6`: at `a012d267c0`, Nano at 2.0 s became 4.9 s at
10 fps, and Edge at 3.0 s became 6.1 s at 12 fps).

![Duration options at 12 and 30 fps, and the snap
fix](https://raw.githubusercontent.com/LeoBorcherding/unsloth/d990c609722c3db138382402fa0e854cb9fd8606/ui_duration_follows_rate.png)

An out-of-range rate is refused with a toast instead of starting a job
(the page's own request with `fps` rewritten to 31; the controls never
send one), and restoring a clip brings its rate back.

![fps 31
refused](https://raw.githubusercontent.com/LeoBorcherding/unsloth/d990c609722c3db138382402fa0e854cb9fd8606/ui_refusal.png)
![Restoring a 12 fps and a 10 fps
clip](https://raw.githubusercontent.com/LeoBorcherding/unsloth/d990c609722c3db138382402fa0e854cb9fd8606/ui_restore.png)

Also checked, nothing to change: the Trained sizes list shows the five
256p sizes on Edge and Nano; the slider takes arrow keys (24 to 25 moves
the duration to 3.1 s); a family without a picker keeps the "24 fps"
label; at 1024 and 768 px the rail reflows without clipping. Not driven:
switching models with a rate picked.


**What changed**

| | before (`590119de67`) | after |
|---|---|---|
| Edge sizes | 480p only (832x480, 480x832, 640x640, 736x544, 544x736) |
+ the pipeline's 256p tier: 320x192, 192x320, 256x256, 320x256, 256x320
|
| Nano sizes | 720p + 832x480 / 480x832 | + 640x640, 736x544, 544x736
and the same 256p tier |
| Custom-size floor | 204,800 px on Edge: 448x256 and 320x192 refused
with a 422 | 61,440 px: 448x256 (NVIDIA's Jetson T2000 size) is accepted
|
| Edge frames | 53-149 | unchanged (see below) |
| Nano frames | 5-397 | unchanged |
| Frame rate | read-only "24 fps, fixed per model"; the API took any
1-120 and passed it through | Edge any integer 12-30, Nano 10 / 16 / 24
/ 30, default still 24; anything else refused |

- `VideoFamily` gains `fps_range` / `fps_choices` (`video_families.py`).
`validate_video_request_shape` refuses a rate outside them with a
`VideoShapeError` (422 on `/video/generate`, 400 with `param: fps` on
`/v1/videos`). A family that declares neither is never judged, so every
other family behaves as before.
- Status `defaults` carries `fps_range`, `fps_choices`,
`min_num_frames`, `max_num_frames`.
- The Video page shows a frame-rate slider (Edge) or dropdown (Nano)
instead of the fixed label, only for families that declare one
(`video-fps.ts`). Duration options follow the picked rate and stay
inside the frame window; the request, the pipeline's `fps` and the mp4
all use it. Restoring a clip's settings restores its rate, and never a
frame count the loaded family refuses. Changing the rate keeps the
picked length (the nearest offered duration), not the frame count.

**Where the numbers come from**
- 256p sizes: diffusers
`Cosmos3OmniPipeline._ACTION_RESOLUTION_BINS["256"]`, the same table as
NVIDIA's `cosmos-framework` `VIDEO_RES_SIZE_INFO["256"]` and
`NVIDIA/cosmos` `docs/reference/models.md` ("256p uses 320×192"). The
pipeline defines no separate video-generation bins.
- Edge: model card, "256p and 480p resolution, 12–30 fps, and 50–150
frames".
- Nano fps: the card states no range; `NVIDIA/cosmos`
`docs/reference/models.md`, Generation settings: "10, 16, 24, 30 FPS
(default 24)".
- **Edge keeps its 53-frame minimum.** 53 and 149 are the 4k+1 counts
inside the card's 50–150; 49 is outside it. #14554 picked the window for
that reason (its test: "Windows: the 4k+1 counts inside") and nothing
NVIDIA publishes says 49 is supported.
- Nano keeps 397, the largest 4k+1 count at or under the card's 400.
(NVIDIA's `models.md` says 5–300; the card says 5–400; this keeps the
card's.)

**Renders**: Colab G4, NVIDIA RTX PRO 6000 Blackwell Server Edition 96
GB, Linux, driver 580.82.07, torch 2.11.0+cu130, diffusers 0.42.1.
Unsloth Studio booted from this branch at `4095020d9f` (backend
identical to the head; later commits touch only the restore logic in the
page and a test). Seed 0, card steps (Edge 20, Nano 35), CFG 6, bf16
(`transformer_quant: none`). Prompts from our own test set. Each Unsloth
Studio render is compared with plain diffusers `Cosmos3OmniPipeline` on
the same VM (cudnn.benchmark off, card scheduler, untiled VAE, frames
through Unsloth Studio's own x264 encode), decoded frame by frame.

| render | Unsloth Studio speed off vs diffusers | Unsloth Studio
default load vs diffusers |
|---|---|---|
| Edge T2V 448x256, 53 f, 24 fps (waves) | identical, 53/53, same mp4
bytes | differs, PSNR 26.8 dB |
| Edge T2V 320x192, 53 f, 24 fps (dog) | identical, 53/53 | differs,
27.7 dB |
| Edge T2V 832x480, 121 f, **12 fps** (rain) | identical, 121/121 |
differs, 16.2 dB |
| Edge T2V 832x480, 121 f, **30 fps** (rain) | identical, 121/121 |
differs, 18.9 dB |
| Edge T2V 832x480, 121 f, 24 fps (rain, existing preset) | identical,
121/121 | differs, 17.4 dB |
| Nano T2V 320x192, 189 f, 24 fps (waves) | identical, 189/189 |
differs, 28.4 dB |
| Nano T2V 448x256, 121 f, **16 fps** (dog) | identical, 121/121 |
differs, 24.0 dB |
| Edge I2V 832x480, 121 f (bees) | identical, 121/121 | differs, 21.9 dB
|
| Edge I2V 448x256, 53 f (bees) | identical, 53/53 | differs, 24.6 dB |
| Nano I2V 320x192, 121 f (bees) | identical, 121/121 | differs, 20.1 dB
|

- **Nothing changed for the existing sizes**: the 832x480 / 24 fps clip
is byte-identical between base `590119de67` and this branch, at the
default load (`9aaba48470dc38af`) and at speed off (`50f69a6420eff926`),
both Unsloth Studio servers on the same VM.
- The default-load column is not this PR: on this card Unsloth Studio's
default speed mode picks the `_native_cudnn` attention backend and a
channels-last VAE, and base renders the same bytes as the branch there.
`seam_safe_tile_strides` has no 256p edge case: 192/256/320 px sides fit
in one stock 256 px tile or leave an 8-latent edge tile, and 448 px gets
the seam-safe 16/10 tiles (covered by the existing tile sweep); every
render above decoded untiled anyway.
- Refusals on the branch (HTTP 422): fps 31 and 11 on Edge ("Supported:
12 to 30 fps"), 176x176 ("between 61,440 and 409,600 pixels"), 49 frames
("Supported counts run from 53 to 149"). Base refused 448x256 and
320x192 with "between 204,800 and 409,600 pixels", and took fps 31 on
Edge without complaint.

Each card is one setting, Unsloth Studio at speed off on the left and
plain diffusers on the right (frame-identical, per the table), 2.2 s per
card at the clip's own frame rate. 320x192 clips are upscaled 1.34x
(lanczos) to match the cell; 832x480 clips are shown at 448x258.

**256p**

![Edge T2V
448x256](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/256p_edge_t2v_448x256.gif)
![Edge T2V
320x192](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/256p_edge_t2v_320x192.gif)
![Nano T2V
320x192](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/256p_nano_t2v_320x192.gif)
![Nano T2V 448x256 at 16
fps](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/256p_nano_t2v_448x256_16fps.gif)

**Frame rate**: same prompt and seed on Edge 832x480, 121 frames, each
played at its real rate (so 12 fps covers less of the clip in the same
2.2 s)

![Edge 832x480 at 12
fps](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/fps_edge_t2v_832x480_12fps.gif)
![Edge 832x480 at 24
fps](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/fps_edge_t2v_832x480_24fps.gif)
![Edge 832x480 at 30
fps](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/fps_edge_t2v_832x480_30fps.gif)

**Image to video**: both clips start from this image (generated with
Qwen-Image-2.1, cropped to 832x480), prompt "The bee lifts off the
flower and flies toward the camera as the petals sway gently in the
breeze."

![Bees start image,
832x480](https://raw.githubusercontent.com/LeoBorcherding/unsloth/c4f0d8451bf6619d99958518d17ba7f134cd0126/i2v_input_bees_832x480.png)

![Edge I2V
832x480](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/i2v_edge_832x480.gif)
![Edge I2V
448x256](https://raw.githubusercontent.com/LeoBorcherding/unsloth/5be098608ad8c6f949199fc49c9c151b87b54cbb/i2v_edge_448x256.gif)

## Memory and speed

![Cosmos3 peak VRAM and generate time at 256p vs 480p, Edge on a T4 and
an RTX PRO 6000, Nano on an RTX PRO
6000](https://raw.githubusercontent.com/LeoBorcherding/unsloth/ad4a1498b376f61296b1a52893ca75f0a170a135/charts/vram_256p_vs_480p.png)

Measured at the head `2676a6d138` on Colab (Tesla T4 15 GB and RTX PRO
6000 96 GB), waves prompt, Auto memory mode. On the T4, where Unsloth
Studio offloads and runs fp32, Edge at 448x256 peaks at 7.6 GiB against
11.0 GiB at 832x480, and 121 frames take 249 s instead of 1,217 s. On
the 96 GB card Edge drops from 14.4 to 10.1 GiB at 121 frames and Nano
from 38.5 to 32.8 GiB at 189 frames. Not run: Nano on a T4 (the VM's 50
GB of host RAM ran out while loading it), L4, A100, H100.

**Tests**: new backend tests in `test_video_cosmos3.py` (presets equal
the pipeline's tiers, 320x192 / 448x256 accepted and smaller refused,
frame snapping, fps validation per family, every other family takes any
rate, status payload, generate passes and exports the picked rate) and
`tests/video-fps.test.ts` (options, fallback, duration math identical to
before for families without a window, restore, a rate change keeps the
picked length: fails at `a012d267c0`, passes at `2676a6d138`).
`test_video_shape_validation.py`'s 256x256 refusal now skips a family
that lists it. Locally on macOS (M5): the video backend suites show the
same 23 failures on base and branch (H3 modular loads, native
quant/stream builds, prequant download plans: environment), branch +48
passing; frontend typecheck clean; full frontend suite 14,930 pass and 2
fail of 14,933: a KaTeX import check that trips on a symlinked
`node_modules` and a timing test.

**Status**: head `2676a6d138`. Codex: [no major issues at
`2676a6d138`](LeoBorcherding#765 (comment))
on the fork mirror. CI at `2676a6d138`: 62 passed; `Core` / `Core zoo`
(6 jobs) and the parity verdict still queued on the runner pool (all
green at `a012d267c0`; the two new commits are frontend only).
`connection (dsh, stable)`
[failed](https://github.com/unslothai/unsloth/actions/runs/42179371398/job/127765159935)
because `npm install -g @deepseek-ai/dsh` finds no version on npm
(ETARGET); the same job [fails the same way on
main](https://github.com/unslothai/unsloth/actions/runs/42150846508/job/127673440744)
(`9d40777eb1`).

**Noticed, not changed**
- Refusal toasts name the family by its id ("for cosmos3-edge"), like
every other shape refusal in `video_families.py`.
- A saved generation preset keeps size, length and steps but not the
frame rate.
- Restoring a clip whose rate the loaded family does not offer (an Edge
12 fps clip on Nano) keeps the current rate and still says "Settings
restored to inputs".
- At 768 px the header's Family / Engine line clips behind the Create /
Train toggle (pre-existing).

**Not run**: Hopper / Ampere (A100 80 GB and H100 were refused by Colab;
this ran on Blackwell), the default speed mode against diffusers with a
matching attention backend, multi-GPU and offloaded loads at 256p, video
continuation, AMD / Apple silicon.







## Before / after (maintainer check)

Video page settings rail, merge base vs this branch, two isolated Studio
installs. No GPU on this host, so the loaded model is not a live load:
each side's page is served the status its own backend returns for a
Cosmos3 load with a stubbed pipeline. Edge: the read-only "24 fps" row
becomes a 12 to 30 slider. Nano: it becomes a 10 / 16 / 24 / 30
dropdown, and the default canvas is no longer pushed up to the old
204,800 px floor.

![Cosmos3 Edge rail before and
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16737/pr16737_pair_00-b71a78fcda00.png)
![Cosmos3 Nano rail before and
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16737/pr16737_pair_01-c3ef4c9fe059.png)

---------

Co-authored-by: Daniel Han <[email protected]>
danielhanchen added a commit to NilayYadav/unsloth that referenced this pull request Nov 10, 2026
…om the Hub (unslothai#16743)

## What
Lists `nvidia/Cosmos3-Nano` in the Unsloth Studio Video page model
picker next to Cosmos3-Edge, and makes the Model hub treat it as a Video
page model instead of marking it "May not be supported".

## Why
The backend fully supports Nano (unslothai#14554), but the picker and Hub only
listed Edge, so the only way to load Nano was typing its repo id. Nano
is the larger, higher-quality model and the only one with 720p.

unslothai#14554 left Nano out on purpose: the installer didn't yet pin a
diffusers that loads it (it does now, 0.42.1), and Nano's checkpoint
turns on NVIDIA's guardrail, which Unsloth Studio doesn't install. So
the row says what Nano needs:

- a `needs cosmos-guardrail` chip on the row itself. The Video picker
never draws a catalog description (its hover only shows the name and Hub
link), so a description alone would have been invisible;
- it's sized from its 32 GB of resident bf16 weights (backend
`bf16_components_gb` 30.4 + 1.4, the same rule as Edge's 9 GB), so it's
greyed out on hosts that can't hold it, with the reason on hover. That's
the weights, not the render peak: on a 96 GB RTX PRO 6000 at
`590119de67`, Nano peaked at 38.5 GB (832x480, 189 frames) and 49.7 GB
(1280x720, 189 frames);
- picking it without the guardrail is refused before anything downloads,
with the install and opt-out steps.

No backend change.

## Before / after
Colab, Unsloth Studio at main `4ee2f916ca` vs this branch `f199960fd5`,
searching "cosmos3" in the Video picker with the pointer on the Nano
row.

96 GB RTX PRO 6000 (Nano fits):

![Video picker, 96 GB,
light](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1e20532eaa7c37da74293491bfbebd9d11c340a4/v2/picker_96gb_light.png)
![Video picker, 96 GB,
dark](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1e20532eaa7c37da74293491bfbebd9d11c340a4/v2/picker_96gb_dark.png)

Tesla T4, 15 GB (Nano greyed, hover says why):

![Video picker, T4,
light](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1e20532eaa7c37da74293491bfbebd9d11c340a4/v2/picker_t4_light.png)
![Video picker, T4,
dark](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1e20532eaa7c37da74293491bfbebd9d11c340a4/v2/picker_t4_dark.png)

Model hub, `nvidia/Cosmos3-Nano`:

![Hub,
light](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1e20532eaa7c37da74293491bfbebd9d11c340a4/v2/hub_light.png)
![Hub,
dark](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1e20532eaa7c37da74293491bfbebd9d11c340a4/v2/hub_dark.png)

Picking Nano with no `cosmos-guardrail` installed (before: Nano isn't in
the list):

![Nano pick
refusal](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1e20532eaa7c37da74293491bfbebd9d11c340a4/v2/refusal_light_dark.png)

## Memory and speed

![Cosmos3-Nano peak VRAM and generate time on RTX PRO 6000, A100 40 GB
and
L4](https://raw.githubusercontent.com/LeoBorcherding/unsloth/1afb12730d513c5deec5b687eb22631af7b544c3/charts/nano_vram_by_gpu.png)

What Nano actually uses, measured at `590119de67` (main; this PR doesn't
touch the backend) on Colab. The picker's 32 GB is the resident weights.
Without offload a render peaks at 36.0 to 62.4 GiB on the 96 GB card,
depending on size and length. On a 24 GB L4, Unsloth Studio streamed the
transformer and quantized it to int8, and Nano fit in 8.3 to 17.7 GiB at
about 6 to 7 times the time. Each bar is drawn against its card's
capacity.

Not run: Nano on a T4, A100 80 GB and H100 (one A100 40 GB row only).

## Status
Head `32b7696ab9`. Codex review is clean at `32b7696ab9` ([fork
mirror](LeoBorcherding#772)). `32b7696`
only rewords two comments in `model-catalog.ts`: at `f199960fd5` they
said "Unsloth Studio", which
`tests/studio/test_tauri_branding_contract.py` bans from frontend source
(Unsloth Desktop displays itself as "Unsloth"); the fork mirror's CI
caught it. New frontend tests: the chip test fails on `7cb1614043` and
passes here; full frontend suite (14929 pass, 1 skipped), typecheck,
catalog check and the branding contract pass. Screenshots were taken at
`f199960fd5`; the comment-only change doesn't affect them.

Not run: a Nano render (the backend path is unchanged); a 48 GB card,
where Nano shows as fitting and 480p fits its measured peak but 720p at
189 frames (49.7 GB) may not; Nano with the guardrail installed, whose
load currently stops on NVIDIA's gated guardrail repo, which unslothai#16742
addresses.

## Noticed, not changed
- The Hub's "Likely fits · ~15.6 GB" chip is the generic 4-bit LLM
estimate shown for every non-GGUF model, so it disagrees with the
picker's 32 GB for any video model (Edge on main too).
- A greyed row can still be clicked, and Nano then answers with the
guardrail refusal rather than a fit warning.
- The refusal toast (backend text) says bare "Studio" twice and quotes
`model_index.json` internals.




## Before / after (maintainer check)

Video page model picker searching "cosmos3", merge base vs this branch,
two isolated Studio installs on a CPU-only host (picker listing only, no
model loaded). After lists Cosmos3 Nano with its `needs
cosmos-guardrail` chip beside Edge.

![Video picker before and
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16743/pr16743_before_after-edb0e5b37082.png)

---------

Co-authored-by: Daniel Han <[email protected]>
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.

2 participants