diff --git a/fastvideo/registry.py b/fastvideo/registry.py index 6fa1a28c9..9dfe3b5ca 100644 --- a/fastvideo/registry.py +++ b/fastvideo/registry.py @@ -881,8 +881,9 @@ def _register_configs() -> None: "nvidia/Cosmos-Predict2-2B-Video2World", ], model_detectors=[ - lambda path: "cosmos" in path.lower() and ("2.5" not in path.lower() and "2_5" not in path.lower() and "25" - not in path.lower() and "gen3c" not in path.lower()), + lambda path: "cosmos" in path.lower() and + ("2.5" not in path.lower() and "2_5" not in path.lower() and "25" not in path.lower() and "gen3c" not in + path.lower() and "cosmos3" not in path.lower() and "cosmos-3" not in path.lower()), ], model_family="cosmos", default_preset="cosmos_predict2_2b", diff --git a/tests/local_tests/pipelines/test_cosmos3_pipeline_parity.py b/tests/local_tests/pipelines/test_cosmos3_pipeline_parity.py index 254ddf8ba..20c968620 100644 --- a/tests/local_tests/pipelines/test_cosmos3_pipeline_parity.py +++ b/tests/local_tests/pipelines/test_cosmos3_pipeline_parity.py @@ -128,3 +128,20 @@ def test_cosmos3_registry_exposes_both_video_workloads() -> None: for workload in ("t2v", "i2v"): registered = get_registered_models_with_workloads(workload) assert any(model["id"] == "nvidia/Cosmos3-Nano" for model in registered) + + +def test_cosmos3_local_snapshot_registry_is_unambiguous(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None: + from fastvideo.registry import get_preset_selection + + model_dir = tmp_path / "snapshot" + (model_dir / "transformer").mkdir(parents=True) + (model_dir / "model_index.json").write_text( + json.dumps({ + "_class_name": "Cosmos3OmniDiffusersPipeline", + "_diffusers_version": "0.39.0", + }), + encoding="utf-8", + ) + + assert get_preset_selection(str(model_dir)) == ("cosmos3_nano", "cosmos3") + assert "Multiple models matched" not in caplog.text