@@ -468,11 +468,26 @@ def test_default_generation_steps_match_reference_app() -> None:
468468 assert pipeline .default_generation_params ["num_inference_steps" ] == 28
469469
470470
471- def test_fasth3_generation_steps_follow_inference_contract () -> None :
471+ @pytest .mark .parametrize (
472+ "manifest, expected_steps" ,
473+ [
474+ (None , 28 ),
475+ ({"schema_version" : "fasth3-inference-contract-v1" , "num_inference_steps" : 5 }, 5 ),
476+ ({"schema_version" : "fasth3-inference-contract-v1" }, 28 ),
477+ ({"schema_version" : "other-model-v1" , "num_inference_steps" : 5 }, 28 ),
478+ ],
479+ )
480+ def test_fasth3_generation_steps_follow_inference_contract (
481+ tmp_path : Path , manifest : dict | None , expected_steps : int
482+ ) -> None :
483+ if manifest is not None :
484+ (tmp_path / "fastvideo_inference.json" ).write_text (json .dumps (manifest ))
472485 pipeline = _SyntheticMiniMaxH3Pipeline ()
473- pipeline .pipeline_config .extra_attrs = {"fastvideo_inference" : {"num_inference_steps" : 5 }}
486+ pipeline .load_standard_components (
487+ str (tmp_path ), torch .device ("cpu" ), skip_components = list (PipelineComponent )
488+ )
474489
475- assert pipeline .default_generation_params ["num_inference_steps" ] == 5
490+ assert pipeline .default_generation_params ["num_inference_steps" ] == expected_steps
476491
477492
478493def test_hf_download_is_scoped_to_the_supported_h3_components (
@@ -564,7 +579,13 @@ def test_fasth3_manifest_metadata_controls_pipeline_defaults(tmp_path: Path) ->
564579
565580 config = DiffusionPipelineConfig .from_pretrained (str (tmp_path ))
566581
567- assert config .extra_attrs ["fastvideo_inference" ]["num_inference_steps" ] == 5
582+ assert "fastvideo_inference" not in config .extra_attrs
583+ pipeline = _SyntheticMiniMaxH3Pipeline ()
584+ pipeline .pipeline_config = config
585+ pipeline .load_standard_components (
586+ str (tmp_path ), torch .device ("cpu" ), skip_components = list (PipelineComponent )
587+ )
588+ assert pipeline .default_generation_params ["num_inference_steps" ] == 5
568589
569590
570591def test_infer_supports_a_last_frame_without_a_first_frame (
0 commit comments