[bugfix] Wire Cosmos-Predict2.5 2B to its sampling preset#1468
[bugfix] Wire Cosmos-Predict2.5 2B to its sampling preset#1468Mister-Raggs wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes Cosmos-Predict2.5 2B Hugging Face path resolution so it selects the cosmos25 default preset (ensuring expected sampling params) instead of falling back to generic defaults.
Changes:
- Assign
model_family="cosmos25"anddefault_preset="cosmos25_predict2_2b"for the Cosmos 2.5 (2B) detector registration. - Add a regression test asserting
SamplingParam.from_pretrained()resolves the 2B path to the expectedcosmos25preset values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| fastvideo/tests/api/test_presets.py | Adds regression coverage ensuring the 2B model path resolves to the cosmos25 preset. |
| fastvideo/registry.py | Sets the cosmos25 model family and default preset for Cosmos 2.5 (2B) model detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Regression: the Cosmos-Predict2.5 2B model path must select the | ||
| cosmos25 preset (guidance_scale=7.0), not fall back to the generic | ||
| default (guidance_scale=1.0) which produced blurry output.""" |
There was a problem hiding this comment.
Code Review
This pull request configures the Cosmos 2.5 (2B) model in the registry by specifying its model family as "cosmos25" and its default preset as "cosmos25_predict2_2b". It also adds a regression test to ensure that the Cosmos-Predict2.5 2B model path correctly resolves to the expected preset instead of falling back to a generic default. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟠 PR merge requirementsWaiting for
Waiting checks:
|
The 2B registry entry (KyleShao/Cosmos-Predict2.5-2B-Diffusers) was missing `model_family` / `default_preset`, so `SamplingParam.from_pretrained` found no preset and fell back to the generic default (guidance_scale=1.0, no CFG), producing blurry output. Point it at the existing `cosmos25_predict2_2b` preset (guidance_scale=7.0, num_inference_steps=35) — the same wiring the 14B entry already uses. Add a regression test asserting the 2B path resolves to the preset. Verified on an NVIDIA GB10: the default guidance_scale=1.0 produced blurry text-to-world output (mean frame Laplacian-variance sharpness ~92); rerunning with guidance_scale=7.0 restored sharpness to ~431, matching known-good Wan clips. This fix makes that the default, so no manual override is needed.
e96c300 to
0e62620
Compare
SolitaryThinker
left a comment
There was a problem hiding this comment.
Hi @Mister-Raggs — automated review from Gob, one of @SolitaryThinker's AI reviewers. Findings aren't all human-verified; ping @SolitaryThinker if anything looks off.
Verdict: APPROVE — correct, minimal, tested. Open PR, +14/-0.
Verified the fix end-to-end:
- Bug is real on
main. The 2Bregister_configs(...)(fastvideo/registry.py:602-618on base) ended atmodel_detectorswith nomodel_family/default_preset, soget_preset_selectionreturned(None, None)andfrom_pretrainedfell back tocls()defaults (guidance_scale=1.0,num_inference_steps=50) — matching the "blurry, no CFG" symptom. - Fix routes correctly.
KyleShao/Cosmos-Predict2.5-2B-Diffusersis inhf_model_paths, so_get_config_inforeturns the 2B entry via the exact-path match (registry.py:180-183) — no detector/network — now carryingmodel_family="cosmos25"+default_preset="cosmos25_predict2_2b". - Preset values match intent.
cosmos25_predict2_2b=guidance_scale=7.0,num_inference_steps=35(fastvideo/pipelines/basic/cosmos/presets.py:78-79); identical to the test asserts.__post_init__only setsdata_type, so it doesn't clobber them. - No other variant affected. The 2B detector excludes
"14b"; the 14B path is exact-matched by its own entry and already had both kwargs — unchanged. - Test runs in CI (not just collected).
run_unit_testrunspytest ./fastvideo/tests/api/ ...; themicroscope-unit-testsleg is green, sotest_cosmos25_2b_path_resolves_to_presetpassed. It's offline-safe (exact-path match short-circuits before any download).
The regression test closes the actual gap (prior tests checked preset existence, not model-path resolution).
NIT (non-blocking, pre-commit owns it): fastvideo/tests/api/test_presets.py:472 — docstring closing """ shares the last line (copilot noted this too).
Context for a maintainer, not a finding against this PR: the 14B entry's default_preset is also cosmos25_predict2_2b (a 2B-named preset on the 14B model) — pre-existing on main, untouched here; may be intentional preset sharing or a latent naming smell.
— Gob (@SolitaryThinker's AI reviewer).
Summary
The Cosmos-Predict2.5 2B registry entry (
KyleShao/Cosmos-Predict2.5-2B-Diffusers) was missingmodel_family/default_preset, soSamplingParam.from_pretrainedfound no preset and fell back to the generic default (guidance_scale=1.0, i.e. no CFG) — producing blurry output. This points it at the existingcosmos25_predict2_2bpreset (guidance_scale=7.0,num_inference_steps=35) — the same wiring the 14B entry already uses.Root cause
In
fastvideo/registry.py, the 14B Cosmos-2.5 entry setsmodel_family="cosmos25"anddefault_preset="cosmos25_predict2_2b", but the 2B entry set neither. Soget_preset_selection()returned no preset for the 2B path andfrom_pretrainedsilently used library defaults (guidance_scale=1.0). The correct preset already existed infastvideo/pipelines/basic/cosmos/presets.py— it just wasn't connected for the 2B model.Fix
Two lines: add
model_family="cosmos25"+default_preset="cosmos25_predict2_2b"to the 2B entry. Pure registry config — platform-independent.Test
test_cosmos25_2b_path_resolves_to_presettofastvideo/tests/api/test_presets.py, asserting the 2B model path resolves toguidance_scale=7.0/num_inference_steps=35(runs in the existingfastvideo/tests/apiunit suite). The prior tests covered preset existence but not model-path resolution, which is the gap that allowed this.guidance_scale=1.0produced blurry text-to-world output (mean per-frame Laplacian-variance sharpness ~92). Re-running withguidance_scale=7.0restored sharpness to ~431, matching known-good Wan clips. This change makes 7.0 the default, so no manual override is needed.