Skip to content

Unsloth Studio: Cosmos3-Nano video continuation (extend a clip from its last or first frames) - #16741

Merged
danielhanchen merged 62 commits into
unslothai:mainfrom
LeoBorcherding:cosmos3-nano-video-continuation
Nov 10, 2026
Merged

danielhanchen merged 62 commits into
unslothai:mainfrom
LeoBorcherding:cosmos3-nano-video-continuation

Conversation

@LeoBorcherding

@LeoBorcherding LeoBorcherding commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #16737, so this diff includes its commits until that one merges. Review #16737 first.

What

Adds a third workflow for Cosmos3-Nano on the Unsloth Studio Video page: Continue a clip. You upload a short video, Nano keeps 5 frames from its end (or its start) and generates what happens next.

Why

Predicting the future of a clip is one of the main things Cosmos 3 is built for, and NVIDIA's pipeline already supports it (Cosmos3OmniPipeline(video=...)). Unsloth Studio only offered text-to-video and image-to-video, so there was no way to use it. Nano only: Cosmos3-Edge does not accept video input, and the section does not show for it.

Before / after

Merge base 590119d vs the head, Cosmos3-Nano loaded, theme set in Settings > Appearance. The AFTER frame-rate picker comes from #16737.

before and after, light
before and after, dark

States: first/last choice, clip over 15 s, generating, Cosmos3-Edge (light and dark)

states, light
states, dark

Messages: a start frame and a clip replacing each other, a 20 s clip, a 3-frame clip

messages, light
messages, dark

Full page: generating, result, switching to Cosmos3-Edge with a clip staged, 1024 px

pages, light
pages, dark

Screenshots: headless Playwright on a Colab G4, Unsloth Studio at 9358a68 (the head f6a1402 only drops a toast that never reached the screen).

Unsloth Studio vs plain diffusers

Colab G4 (NVIDIA RTX PRO 6000 Blackwell Server Edition, 96 GB), Linux, backend at 965e910 (the clip decoding is unchanged since; later commits are frontend and one error message). Unsloth Studio loaded nvidia/Cosmos3-Nano in auto mode (bf16, no offload) with UNSLOTH_COSMOS3_SAFETY_CHECKER=0, since the guardrail repo is gated.

  1. Source clip: Nano text-to-video in Unsloth Studio, 832x480, 93 frames at 24 fps, 35 steps, guidance 6, seed 0. Prompt: "A golden retriever bounds through deep fresh snow in a pine forest, kicking up powder with each leap, the camera tracking alongside at dog height."
  2. Continue it with the same settings, prompt: "The dog leaps over a fallen log and keeps running as snow falls from the branches above.", once from its last 5 frames and once from its first 5.
    • Unsloth Studio: /video/generate with continuation_video and continuation_keep.
    • Plain diffusers: Cosmos3OmniPipeline(video=<the source's decoded frames>, condition_video_keep=...) with the model card's setup (UniPCMultistepScheduler with flow_shift=10.0, enable_safety_checker=False).
last, Unsloth Studio last, diffusers first, Unsloth Studio first, diffusers
generate time 51.2 s 51.6 s 51.2 s 51.3 s
nvidia-smi peak 36.0 GiB 38.3 GiB 36.0 GiB 38.3 GiB
kept frames vs the source's kept 5 (PSNR, dB) 34.6, 32.1, 32.8, 33.1, 34.4 34.6, 32.0, 32.8, 33.1, 34.5 34.2, 31.6, 31.2, 31.8, 32.6 34.1, 31.6, 31.2, 31.8, 32.6
seam, kept frame 4 to generated frame 5 (PSNR, dB) 17.4 17.5 16.8 16.8
Unsloth Studio vs diffusers, frame 0 / frame 5 / mean from frame 30 (dB) 39.8 / 31.6 / 15.6 38.6 / 33.4 / 19.1
  • Both pipelines keep the source's frames (32 to 35 dB is mp4 re-encoding) and carry the motion on with no cut: the seam step sits inside the source clip's own frame-to-frame range (15.5 to 22.3 dB, mean 17.9) for a fast tracking shot.
  • Unsloth Studio and diffusers start nearly identical and drift apart over the clip: same scene and same events, not bit-identical sampling, as we saw comparing Cosmos3-Edge text-to-video between the two.
  • The source took 57.1 s at the same 36.0 GiB peak; model load was 185.6 s including the download.

Source | plain diffusers | Unsloth Studio, from the last frames:

continue from the last frames

From the first frames:

continue from the first frames

Kept frames 0 and 4 and the first generated frame 5 (top row: the source's kept end)

last
first

GIFs are 400 px a panel at 8 fps.

Memory and speed

Cosmos3-Nano continuation: peak VRAM and generate time, Unsloth Studio vs plain diffusers

Same runs as the table above, measured at 965e910 on the Colab G4 (RTX PRO 6000, 96 GB). Peak is the nvidia-smi card total: Unsloth Studio holds 36.0 GiB through the source and both continuations, plain diffusers peaks at 38.3 GiB. Not run: other GPUs, offloaded loads, 720p.

UI pass

Driven in Unsloth Studio on Colab, light and dark, 1440, 1024 and 768 px. Fixed here:

  • A clip now sizes the canvas through Match source, the way a start frame does. Before, a picked clip kept whatever size was set (800x544 in the run) and was centre-cropped onto it.
  • A start frame and a clip still replace each other, and a toast now says which one was removed.
  • A clip over 15 s is flagged under its preview when picked, not only after Generate uploads it.
  • The too-short refusal reads "This clip has 3 frames at 24 fps, and continuing it needs at least 5. Use a longer clip." instead of a message with a decode count.
  • The first/last hint uses the same words as the options.

Checked and fine: the preview (same player and size as the MiniMax-H3 reference videos), progress (the page's usual step counter and time left), the section hidden for Cosmos3-Edge, the layout at 1024 and 768 px in both themes. Not checked: keyboard-only use and reloading the page with a clip staged.

Noticed, not changed:

  • Picking Cosmos3-Edge with a clip staged drops the clip without a notice. A toast for it fires during the load and is replaced by the load's own toasts, so it was taken out again rather than left in as code that never shows.
  • No in-app trim for a clip over 15 s, unlike MiniMax-H3 reference videos.
  • At 768 px the page header overlaps ("Family" label clipped), on main too.

Tests and status

  • studio/backend/tests/test_video_cosmos3.py: 267 passed, 2 skipped with diffusers 0.42.1; 260 passed, 9 skipped with diffusers blocked (as the rest CI shard runs it). studio/frontend/tests/video-continuation.test.ts: 9 passed; frontend suite 14942 passed; typecheck clean. Local, macOS, at f6a1402.
  • Head f6a1402. Codex at the head: Didn't find any major issues on the fork mirror.
  • CI at the head: queued at the time of writing. On 8eafc9b, Backend CI / (Python 3.13, rest) failed on this branch (a test imported diffusers unconditionally; fixed by merging Unsloth Studio: Cosmos3 256p, NVIDIA's frame ranges and a per-model frame-rate picker #16737's a012d26). Chat UI Tests (extra) failed on a /login page timeout in playwright_multi_account.py that is not this PR's: the same timeout failed on main's push run (a1e340b) and on three other PR branches the same day (1, 2, 3).

Not run

720p, anything other than NVIDIA on Linux, and the Unsloth Desktop app.

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. Cosmos3 Edge gets no continuation section; Cosmos3 Nano gains "Continue a clip" (and the frame-rate dropdown from #16737).

Cosmos3 Edge rail before and after
Cosmos3 Nano rail before and after

Also fixed here: a portrait phone clip (stored landscape with a display rotation) is now decoded upright, matching ffmpeg's autorotate, before its frames reach the pipeline.

…e picker

Edge and Nano gain the pipeline's 256p tier (320x192, 192x320, 256x256,
320x256, 256x320) and Nano the 480p sizes it lacked, so the custom-size
floor drops to 61,440 px and NVIDIA's 448x256 is accepted.

VideoFamily gains fps_range / fps_choices: Edge 12-30 (model card),
Nano 10, 16, 24, 30 (NVIDIA/cosmos models.md). The status defaults carry
them with the frame window, the request is refused outside them, and the
Video page shows a picker instead of the fixed label for those families
only. Durations, the pipeline fps and the mp4 follow the chosen rate.
… or last frames)

Nano's pipeline takes video= and keeps 5 frames from one end of it. Studio
now decodes an uploaded clip with PyAV, resamples it onto the output frame
rate, centre-crops it to the canvas aspect and passes video= and
condition_video_keep (default last). Gated on a supports_video_continuation
family flag set only on Nano; Edge and every other family refuse the field.
The Video page gets a Continue a clip section with a preview and a
first/last choice.
… absent

Backend CI installs no diffusers, so the unguarded import failed the rest shard. The preset assertions don't need diffusers and now always run; the comparison against the pipeline's bins moves to its own test behind importorskip.
@danielhanchen

Copy link
Copy Markdown
Member

(Python 3.13, rest) fails here on the new test:

tests/test_video_cosmos3.py::test_presets_carry_the_pipelines_256p_and_480p_tiers
    from diffusers.pipelines.cosmos.pipeline_cosmos3_omni import _ACTION_RESOLUTION_BINS
E   ModuleNotFoundError: No module named 'diffusers'

Backend CI installs no diffusers, so the other diffusers tests in this file start with pytest.importorskip("diffusers", reason = "Backend CI installs no diffusers"). This one imports it directly. Adding the same importorskip line at the top of the test should fix it.

The Chat UI Tests (extra) red is a Page.goto: Timeout 30000ms exceeded flake seen on unrelated PRs too; a rerun should clear it.

A variable-frame-rate clip was resampled by decoded-frame index at the stream's average
rate, so the 5 kept frames could stand for uneven intervals. Each frame now covers the
output ticks from its timestamp to the next frame's.
…tamps too

The cap was a frame count at the stream's reported rate, so a variable-frame-rate clip
whose rate overstates its timestamps could span past 15 s. Test added.
danielhanchen added a commit that referenced this pull request Nov 5, 2026
…ed-load retry (#16768)

## Summary

`Chat UI Tests (extra)` fails on unrelated PRs several times a day at
the same place, for example #16722, #16741 and the staging run for
#16750:

```
File "tests/studio/playwright_multi_account.py", line 173, in run
    open_login(page)
File "tests/studio/playwright_multi_account.py", line 67, in open_login
    page.goto(url)
playwright._impl._errors.TimeoutError: Page.goto: Timeout 30000ms exceeded.
Call log:
  - navigating to "http://127.0.0.1:18894/login", waiting until "load"
```

#16437 added a recorded retry for exactly this stalled `/login` load,
but it never runs in these failures. None of the failing logs print its
`WARN: /login did not fire load ...` line, and the whole step lasts
about 33 s, i.e. one 30 s timeout. `open_login` gives aborts and
timeouts one shared two-attempt budget: right after a log-out the app's
own 401 redirect (`redirectToAuth`) aborts the first `goto` with
`ERR_ABORTED`, which spends attempt 1, and the stalled load then happens
on attempt 2, where it is fatal.

## Change

`tests/studio/playwright_multi_account.py`, `open_login` only:

- Aborts and timeouts each get their own single retry, so an abort can
no longer use up the retry #16437 added for a stalled load. A second
abort, a second timeout, or any other error still fails the run as
before.
- When the abort came from the app's redirect and that redirect has
already loaded `/login`, the page is used as it is instead of navigating
to `/login` a second time. A redirect that ends anywhere else (for
example `/change-password`) still navigates to `/login`.

Nothing outside this Playwright driver changes.

`tests/studio/test_playwright_multi_account_open_login.py` drives
`open_login` with a scripted page and the real Playwright error types:

| goto outcomes | expected |
|---|---|
| abort, redirect already on `/login` | returns after one goto |
| abort elsewhere, timeout, load | returns after the third goto (the CI
failure) |
| abort to `/change-password`, load | navigates to `/login` |
| two aborts / two timeouts / abort then two timeouts | raises |
| an error other than an abort | raises, no retry |

## Testing

- New test: 7 passed. Against the driver on main: 3 failed, including
`test_a_timeout_after_an_abort_still_gets_its_retry`, the sequence the
CI logs show.
- `tests/test_ci_repo_cpu_shards.py`,
`tests/studio/test_playwright_suites_run_in_ci.py` and
`tests/studio/test_pwsh_calls_use_the_shared_runner.py` pass.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@LeoBorcherding
LeoBorcherding marked this pull request as ready for review November 5, 2026 20:41
A frame count still offered at the new rate was kept, so Nano at 2 s (49 frames) became 4.9 s at 10 fps.
…a clip over 15 s at pick time

Picking a clip to continue silently dropped a staged start frame (and the reverse); a toast now says
which one went. A clip longer than the backend's 15 s cap is flagged under its preview instead of only
failing at Generate. The first/last hint now uses the same words as the options. Tests added.
Loading a model that cannot continue a clip removed a staged clip without a word; a toast now says it
went, like the start-frame and clip swaps. Test updated.
…ource; plain short-clip message

A start frame switched the aspect ratio to Match source, but a clip to continue left whatever size was
picked and was centre-cropped onto it, while the backend already matches the clip's aspect when the
size is omitted. The clip now drives Match source the same way. The too-short refusal now reads
"This clip has N frames at F fps, and continuing it needs at least 5" without the decode count.
Tests added.
Driving a switch from Cosmos3-Nano to Cosmos3-Edge in the model picker showed the toast never reaches
the screen: it fires while the load is finishing and the load's own toasts replace it. The clip is still
removed, as before 6e1ec4e.
@LeoBorcherding

LeoBorcherding commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Codex is clean at this head (f6a1402) on the fork mirror: LeoBorcherding#767

Fork mirror CI at f6a1402 is complete: 67 checks pass. The two red jobs are not this PR's:

  • Repo tests (CPU, rest): 6 cases of test_fp8_loss_ignores_model_output_flags_only_on_its_head fail with "Unsloth cannot find any torch accelerator" on the fork's runner. The same job passes on this repo's runners (#16737 at 2676a6d) and fails the same way on every Cosmos3 mirror.
  • connection (dsh, stable): npm can't find @deepseek-ai/dsh (ETARGET). It fails the same way on main (run).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 819a581e0c

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 55a27cba5e

ℹ️ 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".

# Conflicts:
#	studio/backend/tests/test_media_generation_preset_settings.py
# Conflicts:
#	studio/backend/tests/test_video_shape_validation.py
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

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: Didn't find any major issues. Another round soon, please!

Reviewed commit: d19ba643ed

ℹ️ 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
danielhanchen merged commit 34905ec into unslothai:main Nov 10, 2026
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