diff --git a/.agents/skills/add-model-09-pipeline/templates/pipeline_parity_test.py b/.agents/skills/add-model-09-pipeline/templates/pipeline_parity_test.py index 34c260923..100fbe861 100644 --- a/.agents/skills/add-model-09-pipeline/templates/pipeline_parity_test.py +++ b/.agents/skills/add-model-09-pipeline/templates/pipeline_parity_test.py @@ -80,11 +80,17 @@ def _run_fastvideo_pipeline(model_path: Path, params: dict[str, Any]) -> Any: generator = VideoGenerator.from_pretrained( str(model_path), - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": False, + }, + }, + }, ) try: return generator.generate({ diff --git a/README.md b/README.md index a580fa7d1..f9590bc87 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ def main(): # Create a video generator with a pre-trained model generator = VideoGenerator.from_pretrained( "FastVideo/FastWan2.1-T2V-1.3B-Diffusers", - num_gpus=1, # Adjust based on your hardware + {"engine": {"num_gpus": 1}}, # Adjust based on your hardware ) # Define a prompt for your video diff --git a/apps/dreamverse/dreamverse/ltx2_generation.py b/apps/dreamverse/dreamverse/ltx2_generation.py index ea70a11f5..91a7bd942 100644 --- a/apps/dreamverse/dreamverse/ltx2_generation.py +++ b/apps/dreamverse/dreamverse/ltx2_generation.py @@ -310,7 +310,7 @@ class LTX2GenerationBackend: ), ) - self.generator = VideoGenerator.from_pretrained(config=generator_config) + self.generator = VideoGenerator.from_config(generator_config) print(f"[GPU {self.gpu_id}] After model load: {self._gpu_mem()}") lora_stack = DREAMVERSE_LORA_STACK or ([(DREAMVERSE_LORA_PATH, diff --git a/docs/contributing/coding_agents.md b/docs/contributing/coding_agents.md index 450f52d4b..257e3ca86 100644 --- a/docs/contributing/coding_agents.md +++ b/docs/contributing/coding_agents.md @@ -59,7 +59,7 @@ Minimal usage example (based on `examples/inference/basic/basic.py`): from fastvideo import VideoGenerator model_id = "Wan-AI/Wan2.1-T2V-1.3B-Diffusers" # or official_weights// -generator = VideoGenerator.from_pretrained(model_id, num_gpus=1) +generator = VideoGenerator.from_pretrained(model_id, {"engine": {"num_gpus": 1}}) video = generator.generate({ "prompt": "A vibrant city street at sunset.", diff --git a/docs/design/inference_schema_parity_inventory.yaml b/docs/design/inference_schema_parity_inventory.yaml index 2427f17cf..7c3391552 100644 --- a/docs/design/inference_schema_parity_inventory.yaml +++ b/docs/design/inference_schema_parity_inventory.yaml @@ -2,7 +2,6 @@ status_definitions: kept: "Public field remains on a public adapter surface with the same meaning." moved: "Public field remains supported but normalizes into a different nested path." preset_owned: "Public field remains supported only through a model/preset-specific surface." - from_pretrained_keyword: "Typed config field that an argument of VideoGenerator.from_pretrained also sets; the entry value names that argument." compatibility_only: "Public field that an adapter or an open mapping accepts outside the typed fields of the canonical schema." private_only: "Field should only be handled by private adapters and is not a public FastVideo compatibility promise." internal_only: "Field is runtime/config plumbing that model code, config resolution, or the runtime fills; it is not a public input." @@ -10,37 +9,37 @@ status_definitions: surfaces: generator_config: - from_pretrained_keyword: - model_path: "model_path (positional argument)" - revision: revision - trust_remote_code: trust_remote_code - engine.num_gpus: num_gpus - engine.execution_backend: distributed_executor_backend - engine.parallelism.tp_size: tp_size - engine.parallelism.sp_size: sp_size - engine.parallelism.hsdp_replicate_dim: hsdp_replicate_dim - engine.parallelism.hsdp_shard_dim: hsdp_shard_dim - engine.parallelism.dist_timeout: dist_timeout - engine.offload.dit: dit_cpu_offload - engine.offload.dit_layerwise: dit_layerwise_offload - engine.offload.text_encoder: text_encoder_cpu_offload - engine.offload.image_encoder: image_encoder_cpu_offload - engine.offload.vae: vae_cpu_offload - engine.offload.pin_cpu_memory: pin_cpu_memory - engine.compile.enabled: enable_torch_compile - engine.compile.backend: "torch_compile_kwargs['backend']" - engine.compile.fullgraph: "torch_compile_kwargs['fullgraph']" - engine.compile.mode: "torch_compile_kwargs['mode']" - engine.compile.dynamic: "torch_compile_kwargs['dynamic']" - engine.compile.extras: "torch_compile_kwargs keys other than backend, fullgraph, mode, and dynamic" - engine.enable_stage_verification: enable_stage_verification - engine.use_fsdp_inference: use_fsdp_inference - engine.disable_autocast: disable_autocast - pipeline.components.lora_path: lora_path - pipeline.components.lora_strength: lora_strength - pipeline.output_type: output_type kept: + - model_path - mode + - revision + - trust_remote_code + - engine.num_gpus + - engine.execution_backend + - engine.parallelism.tp_size + - engine.parallelism.sp_size + - engine.parallelism.hsdp_replicate_dim + - engine.parallelism.hsdp_shard_dim + - engine.parallelism.dist_timeout + - engine.offload.dit + - engine.offload.dit_layerwise + - engine.offload.text_encoder + - engine.offload.image_encoder + - engine.offload.vae + - engine.offload.pin_cpu_memory + - engine.compile.enabled + - engine.compile.backend + - engine.compile.fullgraph + - engine.compile.mode + - engine.compile.dynamic + - engine.compile.extras + - engine.enable_stage_verification + - engine.use_fsdp_inference + - engine.disable_autocast + - engine.attention.nvfp4_fa4 + - pipeline.components.lora_path + - pipeline.components.lora_strength + - pipeline.output_type - engine.parallelism.master_port - engine.offload.lazy_module_load - engine.compile.text_encoder_enabled diff --git a/docs/design/overview.md b/docs/design/overview.md index 8a88475f8..a1d2b5af2 100644 --- a/docs/design/overview.md +++ b/docs/design/overview.md @@ -30,7 +30,7 @@ Minimal usage (from `examples/inference/basic/basic.py`): from fastvideo import VideoGenerator model_id = "Wan-AI/Wan2.1-T2V-1.3B-Diffusers" # or official_weights// -generator = VideoGenerator.from_pretrained(model_id, num_gpus=1) +generator = VideoGenerator.from_pretrained(model_id, {"engine": {"num_gpus": 1}}) video = generator.generate({ "prompt": "A vibrant city street at sunset.", diff --git a/docs/design/server_contracts/dynamo.md b/docs/design/server_contracts/dynamo.md index c163cab2e..5600b0fd4 100644 --- a/docs/design/server_contracts/dynamo.md +++ b/docs/design/server_contracts/dynamo.md @@ -32,7 +32,7 @@ from fastvideo.api import ( | Surface | Availability | Notes | | --- | --- | --- | -| `VideoGenerator.from_pretrained(model_path, **typed_kwargs)` | Today | `typed_kwargs` is a stable subset from `GeneratorConfig` — no flat legacy LTX-2 kwargs (guaranteed after PR 6) | +| `VideoGenerator.from_pretrained(model_path, config)` | Today | `config` is a nested `GeneratorConfig` mapping without `model_path`; no flat keywords | | `VideoGenerator.generate(request: GenerationRequest) -> GenerationResult` | Today | Aggregated; Dynamo wraps in `asyncio.to_thread` under `asyncio.Lock` | | `VideoGenerator.generate_async(request) -> AsyncGenerator[VideoEvent, None]` | **PR 7.10** | Canonical execution substrate; sync wrapper reroutes through this | | `VideoGenerator.default_health_check_request() -> GenerationRequest` | **PR 7.10** | 256x256 / 8 frames / 1 step; lets Dynamo build its health payload without knowing any FastVideo internals | @@ -225,7 +225,7 @@ async def init_video_generation(runtime, config, shutdown_endpoints): from fastvideo.api import config_to_dict server_args, dynamo_args = config.server_args, config.dynamo_args - generator = VideoGenerator.from_pretrained(**config.fastvideo_kwargs()) + generator = VideoGenerator.from_config(build_generator_config(server_args)) dump_config(dynamo_args.dump_config_to, config) @@ -309,11 +309,11 @@ re-chase FastVideo drift: 2. `ContinuationState.payload` is JSON-serializable or references opaque blob ids. Dynamo can round-trip it through RPC without special-casing torch tensors. -3. `VideoGenerator.from_pretrained` accepts a typed `GeneratorConfig`. - Its only flat keywords are the convenience keywords in - `fastvideo.api.compat.FROM_PRETRAINED_KWARGS`; any other keyword - raises `TypeError` that points to `VideoGenerator.from_config(...)`, - which takes every setting at its typed config path. +3. `VideoGenerator.from_pretrained(model_path, config)` takes a typed + `GeneratorConfig` or its nested mapping; any flat keyword raises + `TypeError` that points to the nested config. + `VideoGenerator.from_config(...)` takes the same settings with + `model_path` inside. 4. `generate_async` (PR 7.10+) emits events in order `Progress* → Partial* → Final`; the final event always has exactly one occurrence per request. diff --git a/docs/getting_started/installation/spark_pair.md b/docs/getting_started/installation/spark_pair.md index 1d63aa1f1..d4d8b1c7a 100644 --- a/docs/getting_started/installation/spark_pair.md +++ b/docs/getting_started/installation/spark_pair.md @@ -17,7 +17,7 @@ xDiT vendor. Do not install xDiT for this path. | Goal | How | Use two Sparks? | |---|---|---| -| Two independent videos at once | One process per box, `num_gpus=1` | Throughput only. Each clip still takes the 1-GPU time for that size. | +| Two independent videos at once | One process per box, `engine.num_gpus: 1` | Throughput only. Each clip still takes the 1-GPU time for that size. | | One clip, faster | Ray + `sp_size=2` + parallel VAE | **Yes.** One 768×1344×124 recipe was 292 s vs 374 s on one GB10. | | One clip, longer | Same, more frames | **Yes.** 345 frames (~14.4 s at 24 fps) finished in 587 s at 768×1344. | @@ -35,7 +35,7 @@ over ~21 GB/s RoCE. QSFP; do not download 100+ GB twice over Wi-Fi. - Ray in the FastVideo venv (`uv pip install ray` if it is not already there). -Each Spark has **one** GPU. `num_gpus=2` therefore means two nodes, which is +Each Spark has **one** GPU. `engine.num_gpus: 2` therefore means two nodes, which is why the executor must be Ray (`mp` only works inside one process tree). ## 1. Put IPv4 on the QSFP NICs @@ -198,7 +198,7 @@ sm_100a VSA kernel is not on this chip, so denoise is slower than a GB200 | Gloo `connectFullMesh` / `remote=[127.0.0.1]` | Two 1-GPU nodes must not use loopback as the Gloo store. Source `spark_pair_env.sh` so `GLOO_SOCKET_IFNAME` is the QSFP NIC on **each** box. FastVideo no longer copies that NIC name from the driver onto workers. | | Second `generate()` crashes `NoneType.parameters` | Sequential load used to drop the text encoder without reloading it. This branch reloads Qwen for later requests so `--warmup --repeats N` works. | | OOM / `earlyoom` prefers Python | Lazy module load must stay on (do not pass `--no-lazy-module-load` to `basic_fasth3.py` or set `engine.offload.lazy_module_load: false`). Peak GPU during 345-frame denoise is ~90 GiB/node. | -| `num_gpus=2` on one Spark | Each Spark has one GPU. Use Ray across two nodes, or `num_gpus=1` on one box. | +| `engine.num_gpus: 2` on one Spark | Each Spark has one GPU. Use Ray across two nodes, or `engine.num_gpus: 1` on one box. | ## What we are not claiming diff --git a/docs/inference/architecture.md b/docs/inference/architecture.md index e22913cda..84783952e 100644 --- a/docs/inference/architecture.md +++ b/docs/inference/architecture.md @@ -376,8 +376,8 @@ modules are skipped. ```python generator = VideoGenerator.from_pretrained( - model_path="Wan-AI/Wan2.1-T2V-14B-Diffusers", - num_gpus=1, tp_size=1, sp_size=1, + "Wan-AI/Wan2.1-T2V-14B-Diffusers", + {"engine": {"num_gpus": 1, "parallelism": {"tp_size": 1, "sp_size": 1}}}, ) result = generator.generate({ "prompt": "A cat dancing", @@ -414,7 +414,7 @@ registry, applies a JSON config if provided, and freezes it. ## End-to-End Inference Flow ``` -User: VideoGenerator.from_pretrained(model_path, **kwargs) +User: VideoGenerator.from_pretrained(model_path, config) │ ├─ resolve_inference_config() → PipelineConfig resolved via registry ├─ get_model_info() → ModelInfo(pipeline_cls, sampling_param_cls, ...) diff --git a/docs/inference/configuration.md b/docs/inference/configuration.md index 767bb7d99..1f4b2b6a6 100644 --- a/docs/inference/configuration.md +++ b/docs/inference/configuration.md @@ -8,7 +8,7 @@ FastVideo automatically distributes the generation process when multiple GPUs ar # Will use 4 GPUs in parallel for faster generation generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - num_gpus=4, + {"engine": {"num_gpus": 4}}, ) ``` @@ -30,10 +30,10 @@ bring-up: [Pair two NVIDIA DGX Sparks](../getting_started/installation/spark_pai ## Customizing Generation -`VideoGenerator.from_pretrained` accepts only common engine and offload -keywords, such as `num_gpus` and `dit_cpu_offload`. The full list is -`fastvideo.api.compat.FROM_PRETRAINED_KWARGS`. Pass every other startup -setting to `VideoGenerator.from_config` at its config path, and pass +`VideoGenerator.from_pretrained(model_path, config)` takes the startup +settings as a nested mapping at their typed config paths, such as +`{"engine": {"num_gpus": 2, "offload": {"dit": False}}}`; it is +`VideoGenerator.from_config` with `model_path` added to the mapping. Pass generation settings to `VideoGenerator.generate` as a request: ```python @@ -137,8 +137,8 @@ result.resolved_request.provenance("sampling.num_frames") # PathProvenance(..., value=81, source='fill_sampling_defaults[preset wan_t2v_1_3b]', explicit=False) ``` -`resolved_config.provenance_table()` lists every path. After startup, `resolved_config` is read-only; a later -change is a recorded override (`resolved_config.with_override(source, values)`) that returns a new object. +`resolved_config.provenance_table()` lists every path. Every value is decided before resolution ends, including the +device offload policy and the checkpoint defaults; after that, `resolved_config` is read-only. ## Performance Optimization diff --git a/docs/inference/inference_quick_start.md b/docs/inference/inference_quick_start.md index 3224408f9..8e9ab03d2 100644 --- a/docs/inference/inference_quick_start.md +++ b/docs/inference/inference_quick_start.md @@ -38,7 +38,7 @@ def main(): # Create a video generator with a pre-trained model generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - num_gpus=1, # Adjust based on your hardware + {"engine": {"num_gpus": 1}}, # Adjust based on your hardware ) # Define a prompt for your video @@ -82,7 +82,7 @@ from fastvideo import VideoGenerator def main(): # Create the generator model_name = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers" - generator = VideoGenerator.from_pretrained(model_name, num_gpus=1) + generator = VideoGenerator.from_pretrained(model_name, {"engine": {"num_gpus": 1}}) # Generate video based on the image prompt = "A photograph coming to life with gentle movement" @@ -109,12 +109,12 @@ Common issues and their solutions: If you encounter CUDA out of memory errors: - Reduce `num_frames` or video resolution -- Enable FastVideo offloading options such as `dit_layerwise_offload=True` - (single GPU) or `use_fsdp_inference=True` (multi-GPU) +- Enable FastVideo offloading options such as `engine.offload.dit_layerwise: true` + (single GPU) or `engine.use_fsdp_inference: true` (multi-GPU) - Try a smaller model or use distilled versions -- Use `num_gpus` > 1 if multiple GPUs are available -- Try enabling FSDP inference with `use_fsdp_inference=True` (may slow down generation) -- Try enabling DiT layerwise offload with `dit_layerwise_offload=True` (now only a few models support this, but may introduce less overhead than FSDP) +- Use `engine.num_gpus` > 1 if multiple GPUs are available +- Try enabling FSDP inference with `engine.use_fsdp_inference: true` (may slow down generation) +- Try enabling DiT layerwise offload with `engine.offload.dit_layerwise: true` (now only a few models support this, but may introduce less overhead than FSDP) ### Slow Generation diff --git a/docs/inference/offloading.md b/docs/inference/offloading.md index af4035f5d..f57785fab 100644 --- a/docs/inference/offloading.md +++ b/docs/inference/offloading.md @@ -208,15 +208,21 @@ from fastvideo import VideoGenerator generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - num_gpus=1, - # Recommended for single GPU - dit_layerwise_offload=True, - # Enable if OOM happens - vae_cpu_offload=True, - image_encoder_cpu_offload=True, - text_encoder_cpu_offload=True, - # Speeds up CPU-GPU transfer - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "offload": { + # Recommended for single GPU + "dit_layerwise": True, + # Enable if OOM happens + "vae": True, + "image_encoder": True, + "text_encoder": True, + # Speeds up CPU-GPU transfer + "pin_cpu_memory": True, + }, + }, + }, ) prompt = "A curious raccoon peers through a vibrant field of yellow sunflowers." @@ -230,16 +236,22 @@ from fastvideo import VideoGenerator generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - num_gpus=2, - # Recommended for multi-GPU - use_fsdp_inference=True, - dit_layerwise_offload=False, - dit_cpu_offload=False, - # Enable if OOM happens - vae_cpu_offload=True, - image_encoder_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 2, + # Recommended for multi-GPU + "use_fsdp_inference": True, + "offload": { + "dit_layerwise": False, + "dit": False, + # Enable if OOM happens + "vae": True, + "image_encoder": True, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) prompt = "A majestic lion strides across the golden savanna." diff --git a/docs/inference/optimizations.md b/docs/inference/optimizations.md index 0ae7309e0..91a1da8e4 100644 --- a/docs/inference/optimizations.md +++ b/docs/inference/optimizations.md @@ -166,22 +166,26 @@ Enable FP4 attention via the `--nvfp4_fa4` flag: python examples/inference/optimizations/fp4_attn_wan2_1_1_3b.py --nvfp4_fa4 ``` -Or in Python via the `nvfp4_fa4` kwarg (sets env vars automatically): +Or in Python via the `engine.attention.nvfp4_fa4` field (resolution sets the env vars): ```python from fastvideo import VideoGenerator gen = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - nvfp4_fa4=True, - num_gpus=1, - use_fsdp_inference=False, # FSDP is incompatible with FP4 pointer path + { + "engine": { + "attention": {"nvfp4_fa4": True}, + "num_gpus": 1, + "use_fsdp_inference": False, # FSDP is incompatible with FP4 pointer path + }, + }, ) gen.generate(request={"prompt": "A raccoon in sunflowers", "output": {"save_video": True}}) ``` #### Known Limitations -- `use_fsdp_inference=True` is incompatible with the FP4 path (FSDP shards invalidate tensor pointers) +- `engine.use_fsdp_inference: true` is incompatible with the FP4 path (FSDP shards invalidate tensor pointers) - Per-call cosine similarity vs BF16: ~0.99 (slight quantization error accumulates over denoising steps) - Only supports `headdim >= 128` @@ -354,7 +358,7 @@ end-to-end speedup. It is **off by default** and enabled per-run. ```python generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - enable_torch_compile=True, + {"engine": {"compile": {"enabled": True}}}, ) ``` @@ -405,7 +409,7 @@ compile wins for the DiT. ### What to expect from generic compile The Wan result below measures the existing generic -`enable_torch_compile=True` path. It is useful evidence that compile can help, +`engine.compile.enabled: true` path. It is useful evidence that compile can help, but it is **not** a benchmark or numerical gate for the stricter regional fullgraph path above. @@ -448,12 +452,12 @@ not asserted by any standing SSIM regression here — the SSIM tests in run with `enable_torch_compile` disabled. If you depend on compile output staying close to eager (or your previous compiled run), run an MS-SSIM gate on *your* config, especially when combining -`enable_torch_compile=True` with other numerics-affecting flags +`engine.compile.enabled: true` with other numerics-affecting flags (quantized attention backends, FP4, layerwise offload edge cases). ### Known interactions -- **Layerwise CPU offload** (`dit_layerwise_offload=True`, the default): +- **Layerwise CPU offload** (`engine.offload.dit_layerwise: true`, the default): the offload hook previously caused an implicit graph break once per transformer layer, fragmenting the compiled region. Addressed in hao-ai-lab/FastVideo#1365 — keep that fix to get a clean compiled @@ -468,19 +472,17 @@ MS-SSIM gate on *your* config, especially when combining grad-enabled path remain outside it. Use the default inductor mode shown above unless your exact configuration has its own gate. -Extra `torch.compile` options are passed through `torch_compile_kwargs` -(a dict), accepted by `VideoGenerator.from_pretrained(...)`. In a config -file or a CLI dotted override, set them at `engine.compile.backend`, -`fullgraph`, `mode`, and `dynamic`, and put any other `torch.compile` -kwargs in `engine.compile.extras` (for example +Extra `torch.compile` options live at `engine.compile.backend`, +`fullgraph`, `mode`, and `dynamic`; any other `torch.compile` kwargs go in +`engine.compile.extras`. Set them in the nested config, in a config file, +or as a CLI dotted override (for example `--generator.engine.compile.mode reduce-overhead`). Example (currently **not** recommended — see the CUDA-graphs caveat above): ```python VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - enable_torch_compile=True, - torch_compile_kwargs={"mode": "reduce-overhead"}, # may error today + {"engine": {"compile": {"enabled": True, "mode": "reduce-overhead"}}}, # may error today ) ``` @@ -493,7 +495,7 @@ config; **discard the first generation** (graph build): import time from fastvideo import VideoGenerator -gen = VideoGenerator.from_pretrained("your-model-id", enable_torch_compile=True) +gen = VideoGenerator.from_pretrained("your-model-id", {"engine": {"compile": {"enabled": True}}}) req = {"prompt": "Your prompt", "sampling": {"seed": 1024}, "output": {"save_video": False}} gen.generate(req) # warmup: graph build, discard diff --git a/examples/inference/basic/README.md b/examples/inference/basic/README.md index 2544fe48f..16f926d2b 100644 --- a/examples/inference/basic/README.md +++ b/examples/inference/basic/README.md @@ -177,7 +177,7 @@ from fastvideo import VideoGenerator def main(): generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - num_gpus=1, + {"engine": {"num_gpus": 1}}, ) prompt = ("A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " diff --git a/examples/inference/basic/basic.py b/examples/inference/basic/basic.py index 428c38f17..2cae41493 100644 --- a/examples/inference/basic/basic.py +++ b/examples/inference/basic/basic.py @@ -11,13 +11,19 @@ def main(): generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" + # "image_encoder": False, + }, + }, + }, ) # Generate videos with the same simple API, regardless of GPU count diff --git a/examples/inference/basic/basic_cosmos2_5_i2w.py b/examples/inference/basic/basic_cosmos2_5_i2w.py index 366f2b862..7b7768a06 100644 --- a/examples/inference/basic/basic_cosmos2_5_i2w.py +++ b/examples/inference/basic/basic_cosmos2_5_i2w.py @@ -8,12 +8,18 @@ def main(): generator = VideoGenerator.from_pretrained( model_path, - num_gpus=1, - use_fsdp_inference=False, # set True if GPU is out of memory - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set True if GPU is out of memory + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) # image2world example from official repo diff --git a/examples/inference/basic/basic_cosmos2_5_t2w.py b/examples/inference/basic/basic_cosmos2_5_t2w.py index 84e9b178f..aa522d42e 100644 --- a/examples/inference/basic/basic_cosmos2_5_t2w.py +++ b/examples/inference/basic/basic_cosmos2_5_t2w.py @@ -7,12 +7,18 @@ def main(): generator = VideoGenerator.from_pretrained( model_path, - num_gpus=1, - use_fsdp_inference=False, # set True if GPU is out of memory - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set True if GPU is out of memory + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) prompt = ( diff --git a/examples/inference/basic/basic_cosmos2_5_v2w.py b/examples/inference/basic/basic_cosmos2_5_v2w.py index 45a689c3e..1cc21cd01 100644 --- a/examples/inference/basic/basic_cosmos2_5_v2w.py +++ b/examples/inference/basic/basic_cosmos2_5_v2w.py @@ -8,12 +8,18 @@ def main(): generator = VideoGenerator.from_pretrained( model_path, - num_gpus=1, - use_fsdp_inference=False, # set True if GPU is out of memory - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set True if GPU is out of memory + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) # video2world example from official repo diff --git a/examples/inference/basic/basic_gamecraft.py b/examples/inference/basic/basic_gamecraft.py index 2782827ea..4a442df1a 100644 --- a/examples/inference/basic/basic_gamecraft.py +++ b/examples/inference/basic/basic_gamecraft.py @@ -56,12 +56,18 @@ def main(): # FastVideo will automatically download weights from HuggingFace generator = VideoGenerator.from_pretrained( MODEL_PATH, - num_gpus=1, - use_fsdp_inference=True, - dit_cpu_offload=True, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": True, + "offload": { + "dit": True, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) # Video parameters diff --git a/examples/inference/basic/basic_gen3c.py b/examples/inference/basic/basic_gen3c.py index 05b1ea57b..ee444565d 100644 --- a/examples/inference/basic/basic_gen3c.py +++ b/examples/inference/basic/basic_gen3c.py @@ -60,12 +60,18 @@ def main(): generator = VideoGenerator.from_pretrained( args.model_path, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) video = generator.generate({ diff --git a/examples/inference/basic/basic_hy15.py b/examples/inference/basic/basic_hy15.py index eda138126..54ee55eb4 100644 --- a/examples/inference/basic/basic_hy15.py +++ b/examples/inference/basic/basic_hy15.py @@ -13,13 +13,19 @@ def main(): generator = VideoGenerator.from_pretrained( "hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_t2v", # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" + # "image_encoder": False, + }, + }, + }, ) prompt = ("A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " diff --git a/examples/inference/basic/basic_hy15_1080p.py b/examples/inference/basic/basic_hy15_1080p.py index 439da4a98..a326d9f2c 100644 --- a/examples/inference/basic/basic_hy15_1080p.py +++ b/examples/inference/basic/basic_hy15_1080p.py @@ -14,13 +14,19 @@ def main(): "weizhou03/HunyuanVideo-1.5-Diffusers-1080p-2SR", # 480p -> 720p -> 1080p # or "weizhou03/HunyuanVideo-1.5-Diffusers-1080p" # 720p -> 1080p # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" + # "image_encoder": False, + }, + }, + }, ) prompt = ("A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " diff --git a/examples/inference/basic/basic_hyworld.py b/examples/inference/basic/basic_hyworld.py index 9a99ed6f5..68e251142 100644 --- a/examples/inference/basic/basic_hyworld.py +++ b/examples/inference/basic/basic_hyworld.py @@ -35,13 +35,19 @@ def main(): print("\nInitializing VideoGenerator for HYWorld...") generator = VideoGenerator.from_pretrained( "FastVideo/HY-WorldPlay-Bidirectional-Diffusers", - num_gpus=1, - use_fsdp_inference=True, - dit_cpu_offload=True, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, - image_encoder_cpu_offload=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": True, + "offload": { + "dit": True, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": True, + "image_encoder": True, + }, + }, + }, ) # Generate video diff --git a/examples/inference/basic/basic_kandinsky5_i2v.py b/examples/inference/basic/basic_kandinsky5_i2v.py index 86579913c..b64625e16 100644 --- a/examples/inference/basic/basic_kandinsky5_i2v.py +++ b/examples/inference/basic/basic_kandinsky5_i2v.py @@ -10,13 +10,19 @@ def main(): "kandinskylab/Kandinsky-5.0-I2V-Pro-distilled-5s-Diffusers", # "kandinskylab/Kandinsky-5.0-I2V-Pro-sft-5s-Diffusers" # "kandinskylab/Kandinsky-5.0-I2V-Lite-5s-Diffusers" - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) prompt = ("A woman stands up and walks away") diff --git a/examples/inference/basic/basic_kandinsky5_t2v.py b/examples/inference/basic/basic_kandinsky5_t2v.py index a4dcc175a..b5d9481f7 100644 --- a/examples/inference/basic/basic_kandinsky5_t2v.py +++ b/examples/inference/basic/basic_kandinsky5_t2v.py @@ -9,13 +9,19 @@ def main(): # "kandinskylab/Kandinsky-5.0-T2V-Pro-sft-5s-Diffusers" # "kandinskylab/Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers" # "kandinskylab/Kandinsky-5.0-T2V-Pro-distilled-5s-Diffusers" - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) prompt = ("A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " diff --git a/examples/inference/basic/basic_lingbot_video.py b/examples/inference/basic/basic_lingbot_video.py index a39fd0b4f..a57d81757 100644 --- a/examples/inference/basic/basic_lingbot_video.py +++ b/examples/inference/basic/basic_lingbot_video.py @@ -29,11 +29,17 @@ def main() -> None: args = parse_args() generator = VideoGenerator.from_pretrained( str(args.model_path), - num_gpus=1, - use_fsdp_inference=False, - text_encoder_cpu_offload=True, - vae_cpu_offload=False, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "text_encoder": True, + "vae": False, + "pin_cpu_memory": True, + }, + }, + }, ) try: generator.generate({ diff --git a/examples/inference/basic/basic_lingbotworld_base_cam.py b/examples/inference/basic/basic_lingbotworld_base_cam.py index 7f586ab79..766788ad9 100644 --- a/examples/inference/basic/basic_lingbotworld_base_cam.py +++ b/examples/inference/basic/basic_lingbotworld_base_cam.py @@ -13,14 +13,20 @@ def main(): generator = VideoGenerator.from_pretrained( "FastVideo/LingBot-World-Base-Cam-Diffusers", # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, # DiT need to be offloaded for MoE - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, # DiT need to be offloaded for MoE + "vae": False, + "text_encoder": True, + # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) num_frames = 81 diff --git a/examples/inference/basic/basic_ltx2.py b/examples/inference/basic/basic_ltx2.py index b1da6b0ec..fd11cc59f 100644 --- a/examples/inference/basic/basic_ltx2.py +++ b/examples/inference/basic/basic_ltx2.py @@ -17,7 +17,11 @@ def main() -> None: # Uses FastVideo default sampling settings for LTX2 base. generator = VideoGenerator.from_pretrained( "Davids048/LTX2-Base-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) output_path = "outputs_video/ltx2_basic/output_ltx2_base_t2v_1088_1920_1.1.mp4" diff --git a/examples/inference/basic/basic_ltx2_distilled.py b/examples/inference/basic/basic_ltx2_distilled.py index 817522b14..a6d2bf696 100644 --- a/examples/inference/basic/basic_ltx2_distilled.py +++ b/examples/inference/basic/basic_ltx2_distilled.py @@ -19,7 +19,11 @@ os.environ["FASTVIDEO_ATTENTION_BACKEND"] = "FLASH_ATTN" def main() -> None: generator = VideoGenerator.from_pretrained( "FastVideo/LTX2-Distilled-Diffusers", - num_gpus=4, + { + "engine": { + "num_gpus": 4, + }, + }, ) output_path = "outputs_video/ltx2_basic/output_ltx2_distilled_t2v.mp4" diff --git a/examples/inference/basic/basic_lucy_edit.py b/examples/inference/basic/basic_lucy_edit.py index 6329c4846..42bda0f4c 100644 --- a/examples/inference/basic/basic_lucy_edit.py +++ b/examples/inference/basic/basic_lucy_edit.py @@ -6,12 +6,18 @@ OUTPUT_PATH = "video_samples_lucy_edit" def main(): generator = VideoGenerator.from_pretrained( "decart-ai/Lucy-Edit-Dev", - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=True, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": True, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) prompt = ("Change the apron and blouse to a classic clown costume: satin " diff --git a/examples/inference/basic/basic_matrixgame2.py b/examples/inference/basic/basic_matrixgame2.py index bab669d80..5343611d8 100644 --- a/examples/inference/basic/basic_matrixgame2.py +++ b/examples/inference/basic/basic_matrixgame2.py @@ -51,14 +51,20 @@ def main(): generator = VideoGenerator.from_pretrained( config["model_path"], # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, # DiT need to be offloaded for MoE - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, # DiT need to be offloaded for MoE + "vae": False, + "text_encoder": True, + # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) num_frames = 597 diff --git a/examples/inference/basic/basic_matrixgame2_streaming.py b/examples/inference/basic/basic_matrixgame2_streaming.py index 454dafb29..c795c01b9 100644 --- a/examples/inference/basic/basic_matrixgame2_streaming.py +++ b/examples/inference/basic/basic_matrixgame2_streaming.py @@ -58,14 +58,20 @@ async def main(): generator = StreamingVideoGenerator.from_pretrained( config["model_path"], # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, # DiT need to be offloaded for MoE - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, # DiT need to be offloaded for MoE + "vae": False, + "text_encoder": True, + # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) max_blocks = 50 diff --git a/examples/inference/basic/basic_matrixgame3.py b/examples/inference/basic/basic_matrixgame3.py index e3d8fa2f7..c5c8cdd0d 100644 --- a/examples/inference/basic/basic_matrixgame3.py +++ b/examples/inference/basic/basic_matrixgame3.py @@ -9,12 +9,18 @@ OUTPUT_PATH = "video_samples_matrixgame3" def main(): generator = VideoGenerator.from_pretrained( MODEL_PATH, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) generator.generate({ diff --git a/examples/inference/basic/basic_ray.py b/examples/inference/basic/basic_ray.py index 05f2a558f..a05f1a202 100644 --- a/examples/inference/basic/basic_ray.py +++ b/examples/inference/basic/basic_ray.py @@ -13,14 +13,20 @@ def main(): generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", # FastVideo will automatically handle distributed setup - num_gpus=2, - use_fsdp_inference=True, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" - distributed_executor_backend="ray", - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 2, + "use_fsdp_inference": True, + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" + # "image_encoder": False, + }, + "execution_backend": "ray", + }, + }, ) # Generate videos with the same simple API, regardless of GPU count diff --git a/examples/inference/basic/basic_self_forcing_causal.py b/examples/inference/basic/basic_self_forcing_causal.py index 1ea839882..7bbe940c0 100644 --- a/examples/inference/basic/basic_self_forcing_causal.py +++ b/examples/inference/basic/basic_self_forcing_causal.py @@ -14,10 +14,16 @@ def main(): generator = VideoGenerator.from_pretrained( model_name, # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - text_encoder_cpu_offload=False, - dit_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "text_encoder": False, + "dit": False, + }, + }, + }, ) prompt = ("A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " diff --git a/examples/inference/basic/basic_stable_audio.py b/examples/inference/basic/basic_stable_audio.py index 5142c49e9..2e31c0b09 100644 --- a/examples/inference/basic/basic_stable_audio.py +++ b/examples/inference/basic/basic_stable_audio.py @@ -58,7 +58,11 @@ PROMPT = "Lo-fi hip hop instrumental with vinyl crackle and gentle piano." def main() -> None: generator = VideoGenerator.from_pretrained( "FastVideo/stable-audio-open-1.0-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) output_path = "outputs_audio/stable_audio_basic/output_stable_audio.wav" generator.generate({ diff --git a/examples/inference/basic/basic_stable_audio_a2a.py b/examples/inference/basic/basic_stable_audio_a2a.py index fc2e0096c..c83b36fe7 100644 --- a/examples/inference/basic/basic_stable_audio_a2a.py +++ b/examples/inference/basic/basic_stable_audio_a2a.py @@ -60,7 +60,11 @@ INIT_AUDIO_STRENGTH = 0.6 def main() -> None: generator = VideoGenerator.from_pretrained( "FastVideo/stable-audio-open-1.0-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) generator.generate({ "prompt": PROMPT, diff --git a/examples/inference/basic/basic_stable_audio_inpaint.py b/examples/inference/basic/basic_stable_audio_inpaint.py index 459192cd1..3f01fc916 100644 --- a/examples/inference/basic/basic_stable_audio_inpaint.py +++ b/examples/inference/basic/basic_stable_audio_inpaint.py @@ -65,7 +65,11 @@ def main() -> None: "m4a/flac) before running.") generator = VideoGenerator.from_pretrained( "FastVideo/stable-audio-open-1.0-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) generator.generate({ "prompt": PROMPT, diff --git a/examples/inference/basic/basic_stable_audio_small.py b/examples/inference/basic/basic_stable_audio_small.py index 94bbd97f8..dfce9a5d2 100644 --- a/examples/inference/basic/basic_stable_audio_small.py +++ b/examples/inference/basic/basic_stable_audio_small.py @@ -35,7 +35,11 @@ PROMPT = "Lo-fi hip hop instrumental with vinyl crackle and gentle piano." def main() -> None: generator = VideoGenerator.from_pretrained( "FastVideo/stable-audio-open-small-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) output_path = "outputs_audio/stable_audio_small/output_stable_audio_small.wav" generator.generate({ diff --git a/examples/inference/basic/basic_turbodiffusion.py b/examples/inference/basic/basic_turbodiffusion.py index 608ad91e4..9fbd8ccfe 100644 --- a/examples/inference/basic/basic_turbodiffusion.py +++ b/examples/inference/basic/basic_turbodiffusion.py @@ -14,11 +14,16 @@ def main() -> None: generator = VideoGenerator.from_pretrained( "loayrashid/TurboWan2.1-T2V-1.3B-Diffusers", # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - - # set to false if using RTX 4090 - # pin_cpu_memory=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + # set to false if using RTX 4090 + # "pin_cpu_memory": False, + }, + }, + }, ) # Generate videos with the same simple API, regardless of GPU count diff --git a/examples/inference/basic/basic_turbodiffusion_14b.py b/examples/inference/basic/basic_turbodiffusion_14b.py index 0daaaf262..e29d6f9df 100644 --- a/examples/inference/basic/basic_turbodiffusion_14b.py +++ b/examples/inference/basic/basic_turbodiffusion_14b.py @@ -14,7 +14,11 @@ def main() -> None: generator = VideoGenerator.from_pretrained( "loayrashid/TurboWan2.1-T2V-14B-Diffusers", # 14B model needs more GPUs - num_gpus=2, + { + "engine": { + "num_gpus": 2, + }, + }, ) prompt = ("A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " diff --git a/examples/inference/basic/basic_turbodiffusion_i2v.py b/examples/inference/basic/basic_turbodiffusion_i2v.py index 0a874a614..4030e98d9 100644 --- a/examples/inference/basic/basic_turbodiffusion_i2v.py +++ b/examples/inference/basic/basic_turbodiffusion_i2v.py @@ -14,7 +14,11 @@ def main() -> None: # TurboDiffusion I2V: 1-4 step image-to-video generation generator = VideoGenerator.from_pretrained( MODEL_PATH, - num_gpus=2, + { + "engine": { + "num_gpus": 2, + }, + }, ) # Example prompt and image for I2V diff --git a/examples/inference/basic/basic_wan2_2.py b/examples/inference/basic/basic_wan2_2.py index 26366700c..aabe03d7f 100644 --- a/examples/inference/basic/basic_wan2_2.py +++ b/examples/inference/basic/basic_wan2_2.py @@ -11,14 +11,20 @@ def main(): generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.2-T2V-A14B-Diffusers", # FastVideo will automatically handle distributed setup - num_gpus=2, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, # DiT need to be offloaded for MoE - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 2, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, # DiT need to be offloaded for MoE + "vae": False, + "text_encoder": True, + # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) # Generate videos with the same simple API, regardless of GPU count diff --git a/examples/inference/basic/basic_wan2_2_Fun.py b/examples/inference/basic/basic_wan2_2_Fun.py index 9185e4766..c2d4fd847 100644 --- a/examples/inference/basic/basic_wan2_2_Fun.py +++ b/examples/inference/basic/basic_wan2_2_Fun.py @@ -15,14 +15,20 @@ def main(): "IRMChen/Wan2.1-Fun-1.3B-Control-Diffusers", # "alibaba-pai/Wan2.2-Fun-A14B-Control", # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, # DiT need to be offloaded for MoE - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, # DiT need to be offloaded for MoE + "vae": False, + "text_encoder": True, + # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) prompt = "一位年轻女性穿着一件粉色的连衣裙,裙子上有白色的装饰和粉色的纽扣。她的头发是紫色的,头上戴着一个红色的大蝴蝶结,显得非常可爱和精致。她还戴着一个红色的领结,整体造型充满了少女感和活力。她的表情温柔,双手轻轻交叉放在身前,姿态优雅。背景是简单的灰色,没有任何多余的装饰,使得人物更加突出。她的妆容清淡自然,突显了她的清新气质。整体画面给人一种甜美、梦幻的感觉,仿佛置身于童话世界中。" diff --git a/examples/inference/basic/basic_wan2_2_i2v.py b/examples/inference/basic/basic_wan2_2_i2v.py index fe7f653ad..39e9538b0 100644 --- a/examples/inference/basic/basic_wan2_2_i2v.py +++ b/examples/inference/basic/basic_wan2_2_i2v.py @@ -13,14 +13,20 @@ def main(): generator = VideoGenerator.from_pretrained( "Wan-AI/Wan2.2-I2V-A14B-Diffusers", # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, # DiT need to be offloaded for MoE - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer - pin_cpu_memory=True, - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, # DiT need to be offloaded for MoE + "vae": False, + "text_encoder": True, + # Set pin_cpu_memory to false if CPU RAM is limited and there're no frequent CPU-GPU transfer + "pin_cpu_memory": True, + # "image_encoder": False, + }, + }, + }, ) prompt = "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." diff --git a/examples/inference/basic/basic_wan2_2_ti2v.py b/examples/inference/basic/basic_wan2_2_ti2v.py index 40b82eaad..02f459797 100644 --- a/examples/inference/basic/basic_wan2_2_ti2v.py +++ b/examples/inference/basic/basic_wan2_2_ti2v.py @@ -12,13 +12,19 @@ def main(): generator = VideoGenerator.from_pretrained( model_name, # FastVideo will automatically handle distributed setup - num_gpus=1, - use_fsdp_inference=False, # set to True if GPU is out of memory - dit_cpu_offload=True, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" - # image_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, # set to True if GPU is out of memory + "offload": { + "dit": True, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" + # "image_encoder": False, + }, + }, + }, ) # I2V is triggered just by passing in an image_path argument diff --git a/examples/inference/eval/all_metrics_demo.py b/examples/inference/eval/all_metrics_demo.py index d7c7a6c4b..62f4483bc 100644 --- a/examples/inference/eval/all_metrics_demo.py +++ b/examples/inference/eval/all_metrics_demo.py @@ -55,7 +55,11 @@ def generate_one_ltx2_video() -> str: # audio track is silence/noise — unusable for audio.* metrics). generator = VideoGenerator.from_pretrained( "Davids048/LTX2-Base-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) generator.generate({ "prompt": PROMPT, diff --git a/examples/inference/eval/basic_ltx2_audio_eval.py b/examples/inference/eval/basic_ltx2_audio_eval.py index ec9aacd0e..6bc454d8d 100644 --- a/examples/inference/eval/basic_ltx2_audio_eval.py +++ b/examples/inference/eval/basic_ltx2_audio_eval.py @@ -39,7 +39,11 @@ METRICS = [ def main() -> None: generator = VideoGenerator.from_pretrained( "Davids048/LTX2-Base-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) output_path = "outputs_video/ltx2_audio_eval/output.mp4" diff --git a/examples/inference/eval/basic_ltx2_eval.py b/examples/inference/eval/basic_ltx2_eval.py index 43cf58774..66c0c5beb 100644 --- a/examples/inference/eval/basic_ltx2_eval.py +++ b/examples/inference/eval/basic_ltx2_eval.py @@ -58,7 +58,11 @@ def main() -> None: # ----- generation (matches examples/inference/basic/basic_ltx2.py) ----- generator = VideoGenerator.from_pretrained( "Davids048/LTX2-Base-Diffusers", - num_gpus=1, + { + "engine": { + "num_gpus": 1, + }, + }, ) output_path = "outputs_video/ltx2_basic/output_ltx2_base_t2v_1088_1920_1.1.mp4" diff --git a/examples/inference/eval/bench_physics_iq.py b/examples/inference/eval/bench_physics_iq.py index 018c198b9..9eb5f4ea9 100644 --- a/examples/inference/eval/bench_physics_iq.py +++ b/examples/inference/eval/bench_physics_iq.py @@ -54,7 +54,14 @@ def _generate_videos(rows: list[dict], videos_dir: Path, model: str, num_gpus: i print(f"[gen] {len(todo)}/{len(rows)} scenarios to render with {model} " f"({num_frames}x{height}x{width})...") - gen = VideoGenerator.from_pretrained(model, num_gpus=num_gpus) + gen = VideoGenerator.from_pretrained( + model, + { + "engine": { + "num_gpus": num_gpus, + }, + }, + ) try: for row, out_path in todo: gen.generate({ diff --git a/examples/inference/eval/bench_vbench.py b/examples/inference/eval/bench_vbench.py index c87095cad..61a2898cf 100644 --- a/examples/inference/eval/bench_vbench.py +++ b/examples/inference/eval/bench_vbench.py @@ -52,7 +52,14 @@ def _generate_videos(prompts: list[str], videos_dir: Path, model: str, num_gpus: print(f"[gen] {len(todo)}/{len(prompts)} prompts to render with {model} " f"({num_frames}x{height}x{width})...") - gen = VideoGenerator.from_pretrained(model, num_gpus=num_gpus) + gen = VideoGenerator.from_pretrained( + model, + { + "engine": { + "num_gpus": num_gpus, + }, + }, + ) try: for prompt, out_path in todo: gen.generate({ diff --git a/examples/inference/eval/eval_ltx2_vbench.py b/examples/inference/eval/eval_ltx2_vbench.py index 0a1af5f76..6d7f43a75 100644 --- a/examples/inference/eval/eval_ltx2_vbench.py +++ b/examples/inference/eval/eval_ltx2_vbench.py @@ -97,7 +97,14 @@ def generate(args: argparse.Namespace) -> Path: out.parent.mkdir(parents=True, exist_ok=True) print(f"[gen] loading {args.model} ({args.num_gpus} GPU)...") - generator = VideoGenerator.from_pretrained(args.model, num_gpus=args.num_gpus) + generator = VideoGenerator.from_pretrained( + args.model, + { + "engine": { + "num_gpus": args.num_gpus, + }, + }, + ) try: print(f"[gen] generating to {out}...") generator.generate({ diff --git a/examples/inference/gradio/local/gradio_local_demo_matrixgame2.py b/examples/inference/gradio/local/gradio_local_demo_matrixgame2.py index f39c1b81b..6676a99b0 100644 --- a/examples/inference/gradio/local/gradio_local_demo_matrixgame2.py +++ b/examples/inference/gradio/local/gradio_local_demo_matrixgame2.py @@ -581,12 +581,18 @@ def main(): setup_model_environment(model_path) generator = StreamingVideoGenerator.from_pretrained( model_path, - num_gpus=1, - use_fsdp_inference=True, - dit_cpu_offload=True, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": True, + "offload": { + "dit": True, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, + }, ) generators = {model_path: generator} diff --git a/examples/inference/optimizations/attention_example.py b/examples/inference/optimizations/attention_example.py index ea2a23601..d7e466254 100644 --- a/examples/inference/optimizations/attention_example.py +++ b/examples/inference/optimizations/attention_example.py @@ -10,12 +10,18 @@ def main(): start_time = time.perf_counter() gen = VideoGenerator.from_pretrained( - model_path="Wan-AI/Wan2.1-T2V-1.3B-Diffusers", - num_gpus=1, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" + "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", + { + "engine": { + "num_gpus": 1, + "offload": { + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, # set to false if low CPU RAM or hit obscure "CUDA error: Invalid argument" + }, + }, + }, ) load_time = time.perf_counter() - start_time print(f"Model loading time: {load_time:.2f} seconds") diff --git a/examples/inference/optimizations/fp4_attn_wan2_1_1_3b.py b/examples/inference/optimizations/fp4_attn_wan2_1_1_3b.py index 1221e27c1..a3292d563 100644 --- a/examples/inference/optimizations/fp4_attn_wan2_1_1_3b.py +++ b/examples/inference/optimizations/fp4_attn_wan2_1_1_3b.py @@ -38,14 +38,24 @@ def main(): generator = VideoGenerator.from_pretrained( args.model, - num_gpus=args.num_gpus, - nvfp4_fa4=args.nvfp4_fa4, - use_fsdp_inference=not args.nvfp4_fa4, - dit_cpu_offload=False, - dit_layerwise_offload=False, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - enable_torch_compile=args.compile, + { + "engine": { + "num_gpus": args.num_gpus, + "attention": { + "nvfp4_fa4": args.nvfp4_fa4, + }, + "use_fsdp_inference": not args.nvfp4_fa4, + "offload": { + "dit": False, + "dit_layerwise": False, + "vae": True, + "text_encoder": True, + }, + "compile": { + "enabled": args.compile, + }, + }, + }, ) prompt = ("A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " diff --git a/examples/inference/optimizations/torch_compile_example.py b/examples/inference/optimizations/torch_compile_example.py index f9c39ce03..a49634e4c 100644 --- a/examples/inference/optimizations/torch_compile_example.py +++ b/examples/inference/optimizations/torch_compile_example.py @@ -1,6 +1,6 @@ """torch.compile A/B example for FastVideo. -`enable_torch_compile=True` compiles the DiT submodules that declare +`engine.compile.enabled: true` compiles the DiT submodules that declare `_compile_conditions` for a substantial end-to-end speedup (e.g. Wan2.1-T2V-1.3B on A100: ~-24% e2e). It is off by default. @@ -35,14 +35,20 @@ def main() -> None: args = parser.parse_args() mode = "COMPILE" if args.compile else "BASELINE" - print(f"Mode: {mode} (enable_torch_compile={args.compile})") + print(f"Mode: {mode} (engine.compile.enabled={args.compile})") os.makedirs("video_samples", exist_ok=True) generator = VideoGenerator.from_pretrained( args.model, - num_gpus=args.num_gpus, - enable_torch_compile=args.compile, + { + "engine": { + "num_gpus": args.num_gpus, + "compile": { + "enabled": args.compile, + }, + }, + }, ) def _run(tag: str) -> float: diff --git a/fastvideo/api/checkpoint_defaults.py b/fastvideo/api/checkpoint_defaults.py new file mode 100644 index 000000000..ada415fba --- /dev/null +++ b/fastvideo/api/checkpoint_defaults.py @@ -0,0 +1,215 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Resolution steps that fill typed fields from files that a checkpoint bundles. + +Distilled LTX-2 checkpoints carry ``fastvideo_refine_*`` defaults in ``model_index.json``, and distilled MiniMax-H3 +checkpoints carry their trained DMD schedule in ``fastvideo_inference.json``. The steps here read those files during +resolution, so the frozen config already holds the checkpoint's values when the pipeline loads. Each field fills only +while it is ``None``: a value from the input always wins. + +A local ``model_path`` is read from disk. A Hub id downloads only the files that the steps need: the manifest through +``fastvideo.registry.maybe_download_model_index`` (the download that the test isolation blocks), and the schedule file +or the component ``config.json`` files through ``huggingface_hub``. When the manifest download fails, the steps leave +their fields unset; the pipeline's own download reports the error. +""" +from __future__ import annotations + +import json +import os +from typing import Any + +from fastvideo.api.resolution import ResolutionStep, ResolutionView +from fastvideo.logger import init_logger +from fastvideo.utils import _split_hf_repo_subfolder, maybe_download_model, verify_model_config_and_directory + +logger = init_logger(__name__) + +# Refine component paths, by the model_index.json key that supplies the checkpoint's default. +LTX2_REFINE_PATH_KEYS = { + "pipeline.ltx2.refine.transformer_path": "fastvideo_refine_transformer_path", + "pipeline.ltx2.refine.lora_path": "fastvideo_refine_lora_path", + "pipeline.ltx2.refine.noise_path": "fastvideo_refine_noise_path", + "pipeline.ltx2.refine.audio_noise_path": "fastvideo_refine_audio_noise_path", +} +# Refine switches, by the model_index.json key that supplies the checkpoint's default and the value's type. +LTX2_REFINE_SWITCH_KEYS = ( + ("pipeline.ltx2.refine.num_inference_steps", "fastvideo_refine_num_inference_steps", int), + ("pipeline.ltx2.refine.guidance_scale", "fastvideo_refine_guidance_scale", float), + ("pipeline.ltx2.refine.add_noise", "fastvideo_refine_add_noise", bool), +) +# Directory names under which published LTX-2 checkpoints bundle the refine upsampler without declaring it. +_UPSAMPLER_DIRECTORY_NAMES = ("spatial_upscaler", "spatial_upsampler") +# The MiniMax-H3 schedule file; the pipeline validates its contents against the loaded schedulers. +H3_SCHEDULE_FILENAME = "fastvideo_inference.json" + + +def _local_manifest(model_path: str) -> dict[str, Any] | None: + """The manifest of a local checkpoint directory, or ``None`` when the directory has no manifest file.""" + manifest_names = ("model_index.json", "modular_model_index.json") + if not any(os.path.isfile(os.path.join(model_path, name)) for name in manifest_names): + return None + return verify_model_config_and_directory(model_path, required_component_dirs=[]) + + +def _hub_manifest(model_path: str, revision: str | None) -> dict[str, Any] | None: + """The manifest of a Hub checkpoint, or ``None`` when its download fails. + + The download goes through ``fastvideo.registry`` so that a test isolation which blocks registry downloads blocks + this one too; the steps then leave their fields unset. + """ + import fastvideo.registry as registry + + try: + return registry.maybe_download_model_index(model_path, revision=revision) + except Exception as error: + logger.debug("Skipping the checkpoint defaults of %s: the manifest is unavailable (%s)", model_path, error) + return None + + +def _checkpoint_manifest(model_path: str, revision: str | None) -> dict[str, Any] | None: + """The checkpoint manifest of ``model_path``, or ``None`` when it cannot be read.""" + if os.path.exists(model_path): + return _local_manifest(model_path) + return _hub_manifest(model_path, revision) + + +def _resolve_refine_path(root: str, value: str | None) -> str | None: + """A refine component path; a relative value that exists inside the checkpoint root becomes that path.""" + if value is None: + return None + if os.path.isabs(value): + return value + candidate = os.path.join(root, value) + if os.path.exists(candidate): + return candidate + return value + + +def _resolve_refine_upsampler_path(root: str, model_index: dict[str, Any]) -> str | None: + """The refine upsampler directory of a checkpoint. + + The ``model_index.json`` keys ``fastvideo_refine_upsampler_path`` and then ``spatial_upsampler`` are the documented + override and win when present. Otherwise the checkpoint root is probed: published LTX-2 distilled checkpoints + bundle the upsampler weights on disk (spelled ``spatial_upscaler``) without declaring them in ``model_index.json``. + """ + path = _resolve_refine_path(root, model_index.get("fastvideo_refine_upsampler_path")) + if path is None and "spatial_upsampler" in model_index: + path = _resolve_refine_path(root, "spatial_upsampler") + if path is None: + for dirname in _UPSAMPLER_DIRECTORY_NAMES: + candidate = os.path.join(root, dirname) + if os.path.isdir(candidate): + return candidate + return path + + +def _ltx2_checkpoint_root(model_path: str, revision: str | None, model_index: dict[str, Any]) -> str: + """The directory that relative refine paths of ``model_index`` resolve against. + + A local ``model_path`` is that directory. For a Hub id, a partial snapshot with every component ``config.json`` + and every relative refine path of the manifest is downloaded; its directory is the one that the pipeline's full + download fills later, so the resolved paths stay valid. + """ + if os.path.exists(model_path): + return model_path + relative_values = [ + value for key in (*LTX2_REFINE_PATH_KEYS.values(), "fastvideo_refine_upsampler_path") + for value in (model_index.get(key), ) if isinstance(value, str) and not os.path.isabs(value) + ] + return maybe_download_model(model_path, revision=revision, allow_patterns=["*/config.json", *relative_values]) + + +def ltx2_refine_checkpoint_step(defaults: Any) -> ResolutionStep: + """Build the step that fills the unset LTX-2 refine fields from the checkpoint's ``model_index.json``. + + ``defaults`` is the model's ``PipelineConfig``; the step decides nothing for a model that is not LTX-2. + ``fastvideo_refine_enabled`` can only turn refine on. The upsampler falls back to a directory of the checkpoint. + """ + + def fill_ltx2_refine_from_checkpoint(view: ResolutionView) -> dict[str, Any]: + from fastvideo.pipelines.basic.ltx2.pipeline_configs import LTX2T2VConfig + + if not isinstance(defaults, LTX2T2VConfig): + return {} + model_path, revision = view.get("model_path"), view.get("revision") + model_index = _checkpoint_manifest(model_path, revision) + if model_index is None: + return {} + root = _ltx2_checkpoint_root(model_path, revision, model_index) + values: dict[str, Any] = {} + if model_index.get("fastvideo_refine_enabled") is True and view.get("pipeline.ltx2.refine.enabled") is None: + values["pipeline.ltx2.refine.enabled"] = True + if view.get("pipeline.components.upsampler_weights") is None: + upsampler_path = _resolve_refine_upsampler_path(root, model_index) + if upsampler_path is not None: + values["pipeline.components.upsampler_weights"] = upsampler_path + for path, key in LTX2_REFINE_PATH_KEYS.items(): + if view.get(path) is None: + component_path = _resolve_refine_path(root, model_index.get(key)) + if component_path is not None: + values[path] = component_path + for path, key, convert in LTX2_REFINE_SWITCH_KEYS: + if view.get(path) is None and model_index.get(key) is not None: + values[path] = convert(model_index[key]) + return values + + fill_ltx2_refine_from_checkpoint.__qualname__ = "fill_ltx2_refine_from_checkpoint" + return fill_ltx2_refine_from_checkpoint + + +def _checkpoint_json(model_path: str, revision: str | None, filename: str) -> Any: + """The parsed JSON file ``filename`` of the checkpoint, or ``None`` when the checkpoint does not have it. + + For a Hub id, the manifest download gates the file download (see :func:`_hub_manifest`). + """ + if os.path.exists(model_path): + path = os.path.join(model_path, filename) + else: + if _hub_manifest(model_path, revision) is None: + return None + from huggingface_hub import hf_hub_download + from huggingface_hub.utils import EntryNotFoundError + + repo_id, subfolder = _split_hf_repo_subfolder(model_path) + try: + path = hf_hub_download(repo_id=repo_id, + filename=f"{subfolder}/{filename}" if subfolder else filename, + revision=revision) + except EntryNotFoundError: + return None + if not os.path.isfile(path): + return None + with open(path, encoding="utf-8") as handle: + return json.load(handle) + + +def dmd_schedule_checkpoint_step(defaults: Any) -> ResolutionStep: + """Build the step that fills an unset ``pipeline.dmd_denoising_steps`` from a MiniMax-H3 checkpoint's + ``fastvideo_inference.json``. + + ``defaults`` is the model's ``PipelineConfig``; the step decides nothing for a model that is not MiniMax-H3. The + step copies the ``dmd_denoising_steps`` list as written; the pipeline validates the file against the loaded + schedulers and raises on a malformed or conflicting schedule. + """ + + def fill_dmd_schedule_from_checkpoint(view: ResolutionView) -> dict[str, Any]: + from fastvideo.configs.pipelines.minimax_h3 import MiniMaxH3PipelineConfig + + if not isinstance(defaults, MiniMaxH3PipelineConfig) or view.get("pipeline.dmd_denoising_steps") is not None: + return {} + contract = _checkpoint_json(view.get("model_path"), view.get("revision"), H3_SCHEDULE_FILENAME) + steps = contract.get("dmd_denoising_steps") if isinstance(contract, dict) else None + if not isinstance(steps, list) or not steps: + return {} + return {"pipeline.dmd_denoising_steps": list(steps)} + + fill_dmd_schedule_from_checkpoint.__qualname__ = "fill_dmd_schedule_from_checkpoint" + return fill_dmd_schedule_from_checkpoint + + +__all__ = [ + "H3_SCHEDULE_FILENAME", + "LTX2_REFINE_PATH_KEYS", + "LTX2_REFINE_SWITCH_KEYS", + "dmd_schedule_checkpoint_step", + "ltx2_refine_checkpoint_step", +] diff --git a/fastvideo/api/compat.py b/fastvideo/api/compat.py index 6a29be034..1447a6771 100644 --- a/fastvideo/api/compat.py +++ b/fastvideo/api/compat.py @@ -1,11 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations -from collections.abc import Iterator, Mapping +from collections.abc import Mapping from copy import deepcopy -from dataclasses import fields, is_dataclass +from dataclasses import is_dataclass from pathlib import Path -from typing import Any, get_args, get_type_hints +from typing import Any from fastvideo.api.overrides import apply_overrides, normalize_overrides from fastvideo.api.parser import config_to_dict, load_raw_config, parse_config @@ -16,7 +16,6 @@ from fastvideo.api.request_metadata import ( reset_tracking_roots, ) from fastvideo.api.schema import ( - FLAT_NAME, ContinuationState, GenerationRequest, GeneratorConfig, @@ -34,36 +33,6 @@ REQUEST_BATCH_EXTRA_PASSTHROUGH_FIELDS = ( "vsa_dense_first_n_steps", "vsa_dense_layers", ) -# The VideoGenerator.from_pretrained keywords besides model_path, config, and log_queue. Every other setting goes -# through VideoGenerator.from_config at its typed path. -FROM_PRETRAINED_KWARGS = frozenset({ - "num_gpus", - "revision", - "trust_remote_code", - "distributed_executor_backend", - "tp_size", - "sp_size", - "hsdp_replicate_dim", - "hsdp_shard_dim", - "dist_timeout", - "use_fsdp_inference", - "disable_autocast", - "enable_stage_verification", - "dit_cpu_offload", - "dit_layerwise_offload", - "text_encoder_cpu_offload", - "image_encoder_cpu_offload", - "vae_cpu_offload", - "pin_cpu_memory", - "enable_torch_compile", - "torch_compile_kwargs", - "lora_path", - "lora_strength", - "output_type", - "nvfp4_fa4", -}) -# torch.compile kwargs that map to first-class CompileConfig fields. -_COMPILE_TYPED_KEYS = ("backend", "fullgraph", "mode", "dynamic") def normalize_generator_config(config: GeneratorConfig | Mapping[str, Any], ) -> GeneratorConfig: @@ -93,38 +62,6 @@ def load_generator_config_from_file( return parse_config(GeneratorConfig, raw) -def from_pretrained_kwargs_to_config( - model_path: str, - kwargs: Mapping[str, Any], -) -> GeneratorConfig: - """Build a ``GeneratorConfig`` from ``VideoGenerator.from_pretrained`` keyword arguments. - - A keyword that a schema field declares as its ``from_pretrained`` keyword sets that field. ``torch_compile_kwargs`` - is split across ``engine.compile``, and the keywords without a field are kept in ``pipeline.experimental``. A - keyword outside ``FROM_PRETRAINED_KWARGS`` raises ``TypeError``. - """ - unsupported = sorted(set(kwargs) - FROM_PRETRAINED_KWARGS) - if unsupported: - raise TypeError(f"VideoGenerator.from_pretrained(...) does not accept {', '.join(unsupported)}. It accepts " - f"only these keywords: {', '.join(sorted(FROM_PRETRAINED_KWARGS))}. Pass every other setting " - "to VideoGenerator.from_config(...) at its config path.") - - raw: dict[str, Any] = {"model_path": model_path} - for key, value in kwargs.items(): - if key == "torch_compile_kwargs": - remaining: dict[str, Any] = (dict(deepcopy(value)) if isinstance(value, Mapping) else {}) - for first_class in _COMPILE_TYPED_KEYS: - if first_class in remaining: - _set_dotted_path(raw, ["engine", "compile", first_class], remaining.pop(first_class)) - if remaining: - _set_dotted_path(raw, ["engine", "compile", "extras"], remaining) - elif key in _FROM_PRETRAINED_FIELDS: - _set_dotted_path(raw, _FROM_PRETRAINED_FIELDS[key].split("."), value) - else: - _set_dotted_path(raw, ["pipeline", "experimental", key], deepcopy(value)) - return parse_config(GeneratorConfig, raw) - - def normalize_generation_request(request: GenerationRequest | Mapping[str, Any], ) -> GenerationRequest: normalized = (request if isinstance(request, GenerationRequest) else parse_config(GenerationRequest, request)) @@ -190,29 +127,6 @@ def _looks_like_run_or_serve_config(raw: Mapping[str, Any]) -> bool: return isinstance(raw.get("generator"), Mapping) -def _schema_fields(config_type: type, prefix: str = "") -> Iterator[tuple[str, Any]]: - """Yield ``(dotted path, field)`` for every field under ``config_type`` that is not a nested config. - - A field whose type is a dataclass, or an optional dataclass, is a nested config and is walked into. - """ - type_hints = get_type_hints(config_type) - for config_field in fields(config_type): - dotted_path = f"{prefix}{config_field.name}" - annotation = type_hints[config_field.name] - nested = [arg for arg in (annotation, *get_args(annotation)) if isinstance(arg, type) and is_dataclass(arg)] - if nested: - yield from _schema_fields(nested[0], f"{dotted_path}.") - else: - yield dotted_path, config_field - - -# ``from_pretrained`` keyword -> dotted path of the GeneratorConfig field that declares it. -_FROM_PRETRAINED_FIELDS: dict[str, str] = { - config_field.metadata[FLAT_NAME]: dotted_path - for dotted_path, config_field in _schema_fields(GeneratorConfig) if FLAT_NAME in config_field.metadata -} - - def request_to_batch_extra(request: GenerationRequest) -> dict[str, Any]: """Extract typed-request extensions consumed through ``ForwardBatch.extra``.""" return { @@ -405,11 +319,9 @@ def _validate_batched_input_length( __all__ = [ - "FROM_PRETRAINED_KWARGS", "REQUEST_BATCH_EXTRA_PASSTHROUGH_FIELDS", "explicit_request_raw", "explicit_request_updates", - "from_pretrained_kwargs_to_config", "load_generator_config_from_file", "normalize_generation_request", "normalize_generator_config", diff --git a/fastvideo/api/device_policy.py b/fastvideo/api/device_policy.py index 9b55f3f60..98bd47755 100644 --- a/fastvideo/api/device_policy.py +++ b/fastvideo/api/device_policy.py @@ -1,22 +1,35 @@ # SPDX-License-Identifier: Apache-2.0 -"""Offload decisions that depend on the device a worker binds, as overrides of a resolved config. +"""Offload decisions that depend on the device class of the local process, as resolution steps. -Resolution runs before any device is chosen, so it cannot tell whether host and device memory are one physical pool. -A worker calls :func:`finalize_device_offload_policy` once after it binds its device and keeps the returned config. -Each decision is a recorded override (``device_policy:``) on a new config object; the input is unchanged. +The steps run in the main process during resolution, so every worker starts from a config whose offload settings are +final. They query the platform for ``LOCAL_DEVICE_ID`` (device 0 of the local process) and assume that every device of +a node has the same memory class: a node mixes no unified-memory and discrete devices. Importing ``fastvideo`` +initializes the CUDA driver already, so the query adds no new initialization; when the platform cannot answer (for +example ``torch.cuda`` is unavailable), the steps decide "not unified". -:func:`offload_disabled_on_unified_memory` answers the same question without overriding, for a loader that chooses a -target device for one component. +``UNIFIED_MEMORY_OFFLOAD_PATHS`` names the offload settings that the unified-memory policy turns off, by the flag name +that loaders and log messages use. + +``APPLY_DEVICE_POLICY`` is the switch of every step here. The test isolation +(``fastvideo/tests/api/config_snapshot.py::isolated_environment``) sets it to ``False`` the same way it blocks +downloads, so the golden snapshots do not depend on the machine that produced them; the steps then decide nothing and +the offload settings keep their input values. """ from __future__ import annotations from typing import Any -from fastvideo.api.resolution import ResolvedGeneratorConfig +from fastvideo.api.resolution import ResolutionStep, ResolutionView +from fastvideo.api.schema import ExecutionMode from fastvideo.logger import init_logger logger = init_logger(__name__) +# The device whose memory class decides the policy: device 0 of the local process (see the module docstring). +LOCAL_DEVICE_ID = 0 +# Whether the device-policy steps decide anything; the test isolation turns it off (see the module docstring). +APPLY_DEVICE_POLICY = True + # Offload settings that trade device memory for host memory, by the flag name that loaders and log messages use. All # of them are a loss on a device whose host and device memory are the same physical pool. UNIFIED_MEMORY_OFFLOAD_PATHS = { @@ -40,107 +53,91 @@ def _device_name(device_id: int) -> str: return current_platform.device_name -def has_unified_memory(device_id: int) -> bool: - """Whether the bound device shares one memory pool with the host. - - CUDA's probe reads runtime device properties and may initialize a CUDA context, so call it only in a process - that owns ``device_id``. - """ +def has_unified_memory(device_id: int = LOCAL_DEVICE_ID) -> bool: + """Whether ``device_id`` shares one memory pool with the host; ``False`` when the platform cannot answer.""" from fastvideo.platforms import current_platform - return bool(current_platform.has_unified_memory(device_id)) - - -def offload_disabled_on_unified_memory(device_id: int, offload_flag: str | None = None) -> bool: - """Whether the unified-memory policy turns off ``offload_flag`` (any offload when ``None``) on ``device_id``.""" - if not has_unified_memory(device_id): + try: + return bool(current_platform.has_unified_memory(device_id)) + except Exception as error: + logger.debug("Treating device %d as discrete: the unified-memory query failed (%s)", device_id, error) return False - return offload_flag is None or offload_flag in UNIFIED_MEMORY_OFFLOAD_PATHS -def disable_offload_on_unified_memory(resolved_config: ResolvedGeneratorConfig, - device_id: int, - *, - unified: bool | None = None) -> ResolvedGeneratorConfig: - """Turn off every enabled host offload when ``device_id`` has unified memory. - - ``unified`` is the probe result when the caller already has it. The decision is the override - ``device_policy:unified_memory``. - """ - if unified is None: - unified = has_unified_memory(device_id) - if not unified: - return resolved_config - enabled = [flag for flag, path in UNIFIED_MEMORY_OFFLOAD_PATHS.items() if _typed_value(resolved_config, path)] +def apply_unified_memory_offload_policy(view: ResolutionView) -> dict[str, Any]: + """Every enabled host offload of ``UNIFIED_MEMORY_OFFLOAD_PATHS`` turns off when the local device has unified + memory: moving weights to the host duplicates them instead of freeing device memory.""" + if not APPLY_DEVICE_POLICY or not has_unified_memory(LOCAL_DEVICE_ID): + return {} + enabled = [flag for flag, path in UNIFIED_MEMORY_OFFLOAD_PATHS.items() if view.get(path)] if not enabled: - return resolved_config - device_name = _device_name(device_id) + return {} + device_name = _device_name(LOCAL_DEVICE_ID) for flag in enabled: logger.info( "Disabling %s: %s has unified memory, so moving weights to the host duplicates them rather than " "freeing device memory.", flag, device_name) - return resolved_config.with_override("device_policy:unified_memory", - {UNIFIED_MEMORY_OFFLOAD_PATHS[flag]: False - for flag in enabled}) + return {UNIFIED_MEMORY_OFFLOAD_PATHS[flag]: False for flag in enabled} -def resolve_device_offload_conflicts(resolved_config: ResolvedGeneratorConfig) -> ResolvedGeneratorConfig: - """Turn off offload modes that cannot run together on this platform. +def fill_lazy_module_load(view: ResolutionView) -> dict[str, Any]: + """An unset ``engine.offload.lazy_module_load`` becomes ``True`` on unified memory for inference and ``False`` + otherwise.""" + if not APPLY_DEVICE_POLICY or view.get("engine.offload.lazy_module_load") is not None: + return {} + training = view.get("mode") in (ExecutionMode.FINETUNING, ExecutionMode.DISTILLATION) + lazy_module_load = not training and has_unified_memory(LOCAL_DEVICE_ID) + if lazy_module_load: + logger.info( + "Enabling lazy_module_load: %s has unified memory, so encoder, DiT, and VAEs cannot stay resident " + "together. Set engine.offload.lazy_module_load to false to keep every component loaded.", + _device_name(LOCAL_DEVICE_ID), + ) + return {"engine.offload.lazy_module_load": lazy_module_load} - On MPS, FSDP inference and layerwise offload turn off. With layerwise offload on, FSDP inference and DiT CPU - offload turn off. - """ + +def apply_mps_offload_policy(view: ResolutionView) -> dict[str, Any]: + """On MPS, FSDP inference and layerwise offload turn off.""" + if not APPLY_DEVICE_POLICY: + return {} from fastvideo.platforms import current_platform - if current_platform.is_mps(): - resolved_config = resolved_config.with_override("device_policy:mps", { - "engine.use_fsdp_inference": False, - "engine.offload.dit_layerwise": False - }) - if _typed_value(resolved_config, "engine.offload.dit_layerwise"): - if _typed_value(resolved_config, "engine.use_fsdp_inference"): - logger.warning("dit_layerwise_offload is enabled, automatically disabling use_fsdp_inference.") - resolved_config = resolved_config.with_override("device_policy:layerwise_offload", - {"engine.use_fsdp_inference": False}) - if _typed_value(resolved_config, "engine.offload.dit"): - logger.warning("dit_layerwise_offload is enabled, automatically disabling dit_cpu_offload.") - resolved_config = resolved_config.with_override("device_policy:layerwise_offload", - {"engine.offload.dit": False}) - return resolved_config + if not current_platform.is_mps(): + return {} + return {"engine.use_fsdp_inference": False, "engine.offload.dit_layerwise": False} -def finalize_device_offload_policy(resolved_config: ResolvedGeneratorConfig, - device_id: int = 0) -> ResolvedGeneratorConfig: - """Apply the device-local memory policy of ``device_id``, then resolve incompatible offload modes. - - On unified memory every host offload turns off. An unset ``engine.offload.lazy_module_load`` becomes ``True`` on - unified memory for inference and ``False`` otherwise. Applying the policy to its own result changes nothing. - """ - unified = has_unified_memory(device_id) - resolved_config = disable_offload_on_unified_memory(resolved_config, device_id, unified=unified) - if _typed_value(resolved_config, "engine.offload.lazy_module_load") is None: - lazy_module_load = unified and not resolved_config.training_mode - resolved_config = resolved_config.with_override("device_policy:lazy_module_load", - {"engine.offload.lazy_module_load": lazy_module_load}) - if lazy_module_load: - logger.info( - "Enabling lazy_module_load: %s has unified memory, so encoder, DiT, and VAEs cannot stay " - "resident together. Set engine.offload.lazy_module_load to false to keep every component loaded.", - _device_name(device_id), - ) - return resolve_device_offload_conflicts(resolved_config) +def apply_layerwise_offload_conflicts(view: ResolutionView) -> dict[str, Any]: + """With layerwise offload on, FSDP inference and DiT CPU offload turn off.""" + if not APPLY_DEVICE_POLICY or not view.get("engine.offload.dit_layerwise"): + return {} + values: dict[str, Any] = {} + if view.get("engine.use_fsdp_inference"): + logger.warning("dit_layerwise_offload is enabled, automatically disabling use_fsdp_inference.") + values["engine.use_fsdp_inference"] = False + if view.get("engine.offload.dit"): + logger.warning("dit_layerwise_offload is enabled, automatically disabling dit_cpu_offload.") + values["engine.offload.dit"] = False + return values -def _typed_value(resolved_config: ResolvedGeneratorConfig, path: str) -> Any: - """The resolved value of a dotted path.""" - return resolved_config.provenance(path).value - +# The device-policy steps in the order that they run: the unified-memory policy first, so the conflict steps see the +# offload settings that survive it. +DEVICE_POLICY_STEPS: tuple[ResolutionStep, ...] = ( + apply_unified_memory_offload_policy, + fill_lazy_module_load, + apply_mps_offload_policy, + apply_layerwise_offload_conflicts, +) __all__ = [ + "APPLY_DEVICE_POLICY", + "DEVICE_POLICY_STEPS", + "LOCAL_DEVICE_ID", "UNIFIED_MEMORY_OFFLOAD_PATHS", - "disable_offload_on_unified_memory", - "finalize_device_offload_policy", + "apply_layerwise_offload_conflicts", + "apply_mps_offload_policy", + "apply_unified_memory_offload_policy", + "fill_lazy_module_load", "has_unified_memory", - "offload_disabled_on_unified_memory", - "resolve_device_offload_conflicts", ] diff --git a/fastvideo/api/inference_resolution.py b/fastvideo/api/inference_resolution.py index d9cc44206..e7c83d00d 100644 --- a/fastvideo/api/inference_resolution.py +++ b/fastvideo/api/inference_resolution.py @@ -11,9 +11,13 @@ precedence over a later one: user input, then environment variables, then model 1. Environment variables fill typed fields. 2. Model defaults from the model's ``PipelineConfig`` fill the typed fields of ``PIPELINE_CONFIG_MIRRORS`` that are still unset. -3. ``pipeline.preset_overrides.refine`` sets the LTX-2 refine fields. +3. ``pipeline.preset_overrides.refine`` sets the LTX-2 refine fields, and the checkpoint's bundled files fill the + LTX-2 refine fields and the MiniMax-H3 DMD schedule that are still unset (``fastvideo.api.checkpoint_defaults``). 4. Derived values replace placeholders and load the files that a path names. -5. Validation steps raise on inconsistent values and decide nothing. +5. The device policy settles the offload settings for the memory class of the local device + (``fastvideo.api.device_policy``). +6. Validation steps raise on inconsistent values and decide nothing. +7. ``fill_runtime_defaults`` gives every field that is still unset its runtime default. ``fastvideo.api.training_schema`` resolves the training and preprocessing roots with the same steps plus their own. """ @@ -27,6 +31,8 @@ from dataclasses import fields, is_dataclass from typing import Any import fastvideo.envs as envs +from fastvideo.api.checkpoint_defaults import dmd_schedule_checkpoint_step, ltx2_refine_checkpoint_step +from fastvideo.api.device_policy import DEVICE_POLICY_STEPS from fastvideo.api.parser import parse_config from fastvideo.api.resolution import (ResolutionStep, ResolutionView, ResolvedGeneratorConfig, resolve_generator_config, thaw) @@ -302,6 +308,18 @@ def warn_deprecated_environment_variables(view: ResolutionView) -> dict[str, Any return {} +def apply_nvfp4_fa4_env(view: ResolutionView) -> dict[str, Any]: + """``engine.attention.nvfp4_fa4`` exports the environment that the NVFP4 FlashAttention-4 path reads. + + Sets ``FASTVIDEO_NVFP4_FA4=1`` and the ``CUTE_DSL_ENABLE_TVM_FFI`` default of the CuTe DSL kernels when the field + is true; decides nothing. + """ + if view.get("engine.attention.nvfp4_fa4"): + envs.FASTVIDEO_NVFP4_FA4.set(True) + envs.setdefault_external("CUTE_DSL_ENABLE_TVM_FFI", "1") + return {} + + def torch_compile_kwargs(resolved_config: ResolvedGeneratorConfig) -> dict[str, Any]: """The keyword arguments for ``torch.compile`` that ``engine.compile`` describes. @@ -317,9 +335,8 @@ def torch_compile_kwargs(resolved_config: ResolvedGeneratorConfig) -> dict[str, return kwargs -# Values that runtime code uses for typed fields that no earlier step decided. ``pipeline.ltx2.refine.*`` and -# ``engine.offload.lazy_module_load`` are not listed: ``None`` there means "decide later" (the LTX-2 checkpoint defaults -# and the device policy). +# Values that runtime code uses for typed fields that no earlier step decided. The LTX-2 refine switches are the +# stage-2 defaults of the LTX-2 pipeline; the checkpoint's model_index.json fills them first when it declares them. RUNTIME_DEFAULTS: dict[str, Any] = { "engine.attention.vsa_sparsity": 0.0, "engine.attention.vsa_tile_size": 256, @@ -335,6 +352,10 @@ RUNTIME_DEFAULTS: dict[str, Any] = { "pipeline.minimax_h3.video_decode_backend": "h3-vae", "pipeline.ltx2.legacy_native_noise_order": False, "pipeline.ltx2.use_distilled_sigmas": True, + "pipeline.ltx2.refine.enabled": False, + "pipeline.ltx2.refine.add_noise": True, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, } @@ -356,6 +377,7 @@ VALIDATION_STEPS: tuple[ResolutionStep, ...] = ( validate_attention_backend, validate_vae_parallel_decode_strategy, warn_deprecated_environment_variables, + apply_nvfp4_fa4_env, ) @@ -368,9 +390,10 @@ def generator_resolution_steps( ) -> tuple[ResolutionStep, ...]: """The resolution steps of any generator root, in the order that they run. - ``before_placeholders`` runs after the refine copy and before ``derive_parallel_sizes``, for checks that need the - -1 placeholders; ``after`` runs last. ``validate_parallel_sizes`` checks the sizes before - ``derive_num_gpus_from_parallel_sizes`` raises ``num_gpus``. + ``before_placeholders`` runs after the checkpoint fills and before ``derive_parallel_sizes``, for checks that need + the -1 placeholders; ``after`` runs last. The device-policy steps run after every fill and derivation and before + the validations. ``validate_parallel_sizes`` checks the sizes before ``derive_num_gpus_from_parallel_sizes`` raises + ``num_gpus``. """ if defaults is None: defaults = build_model_pipeline_config(config) @@ -378,11 +401,14 @@ def generator_resolution_steps( *ENVIRONMENT_STEPS, pipeline_config_defaults_step(config, defaults), copy_refine_preset_overrides, + ltx2_refine_checkpoint_step(defaults), + dmd_schedule_checkpoint_step(defaults), *before_placeholders, derive_parallel_sizes, derive_vae_tiling_from_ltx2_tile_sizes, vae_tiling_default_step(defaults), load_moba_config, + *DEVICE_POLICY_STEPS, *VALIDATION_STEPS, validate_parallel_sizes, derive_num_gpus_from_parallel_sizes, @@ -537,6 +563,7 @@ __all__ = [ "ENVIRONMENT_STEPS", "PIPELINE_CONFIG_MIRRORS", "VALIDATION_STEPS", + "apply_nvfp4_fa4_env", "build_model_pipeline_config", "copy_refine_preset_overrides", "derive_num_gpus_from_parallel_sizes", diff --git a/fastvideo/api/schema.py b/fastvideo/api/schema.py index 64fab5b76..3d40df2c2 100644 --- a/fastvideo/api/schema.py +++ b/fastvideo/api/schema.py @@ -1,20 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations -from dataclasses import MISSING, dataclass, field +from dataclasses import dataclass, field from enum import Enum from typing import Any, Literal -# Field metadata key that holds the ``VideoGenerator.from_pretrained`` keyword that sets a field. -# ``fastvideo.api.compat.from_pretrained_kwargs_to_config`` maps each keyword of ``FROM_PRETRAINED_KWARGS`` to the -# field that declares it. -FLAT_NAME = "flat_name" - - -def flat_field(flat_name: str, default: Any = MISSING, *, default_factory: Any = MISSING) -> Any: - """Declare a dataclass field that the ``VideoGenerator.from_pretrained`` keyword ``flat_name`` sets.""" - return field(default=default, default_factory=default_factory, metadata={FLAT_NAME: flat_name}) - class ExecutionMode(str, Enum): """ @@ -69,23 +59,23 @@ class ServerConfig: @dataclass class ParallelismConfig: - tp_size: int = flat_field("tp_size", -1) - sp_size: int = flat_field("sp_size", -1) - hsdp_replicate_dim: int = flat_field("hsdp_replicate_dim", 1) - hsdp_shard_dim: int = flat_field("hsdp_shard_dim", -1) - dist_timeout: int | None = flat_field("dist_timeout", None) + tp_size: int = -1 + sp_size: int = -1 + hsdp_replicate_dim: int = 1 + hsdp_shard_dim: int = -1 + dist_timeout: int | None = None master_port: int | None = None """Port of the rendezvous that the executor opens for its workers. ``None`` picks an open port.""" @dataclass class OffloadConfig: - dit: bool = flat_field("dit_cpu_offload", True) - dit_layerwise: bool = flat_field("dit_layerwise_offload", True) - text_encoder: bool = flat_field("text_encoder_cpu_offload", True) - image_encoder: bool = flat_field("image_encoder_cpu_offload", True) - vae: bool = flat_field("vae_cpu_offload", True) - pin_cpu_memory: bool = flat_field("pin_cpu_memory", True) + dit: bool = True + dit_layerwise: bool = True + text_encoder: bool = True + image_encoder: bool = True + vae: bool = True + pin_cpu_memory: bool = True # Not a CPU offload: loads each heavy component on first use and frees it # after the last stage that needs it, so peak memory is the largest # overlapping set rather than the sum. Grouped here because it is the same @@ -111,7 +101,7 @@ class CompileConfig: leaving it empty inherits the master kwargs. """ - enabled: bool = flat_field("enable_torch_compile", False) + enabled: bool = False backend: str | None = None fullgraph: bool | None = None mode: str | None = None @@ -144,6 +134,9 @@ class AttentionConfig: """Path to a JSON config for V-MoBA attention.""" moba_config: dict[str, Any] | None = None """V-MoBA attention settings. Resolution loads them from ``moba_config_path`` when that path is set.""" + nvfp4_fa4: bool = False + """FlashAttention-4 with Q and K quantized to NVFP4. Resolution exports ``FASTVIDEO_NVFP4_FA4=1`` and the + ``CUTE_DSL_ENABLE_TVM_FFI`` default that the CuTe DSL kernels need when this is true.""" Precision = Literal["fp32", "fp16", "bf16"] @@ -169,16 +162,16 @@ class QuantizationConfig: @dataclass class EngineConfig: - num_gpus: int = flat_field("num_gpus", 1) - execution_backend: Literal["mp", "ray"] = flat_field("distributed_executor_backend", "mp") + num_gpus: int = 1 + execution_backend: Literal["mp", "ray"] = "mp" parallelism: ParallelismConfig = field(default_factory=ParallelismConfig) offload: OffloadConfig = field(default_factory=OffloadConfig) compile: CompileConfig = field(default_factory=CompileConfig) attention: AttentionConfig = field(default_factory=AttentionConfig) precision: PrecisionConfig = field(default_factory=PrecisionConfig) - enable_stage_verification: bool = flat_field("enable_stage_verification", True) - use_fsdp_inference: bool = flat_field("use_fsdp_inference", False) - disable_autocast: bool = flat_field("disable_autocast", False) + enable_stage_verification: bool = True + use_fsdp_inference: bool = False + disable_autocast: bool = False quantization: QuantizationConfig | None = None @@ -191,9 +184,9 @@ class ComponentConfig: transformer_2_weights: str | None = None vae_weights: str | None = None upsampler_weights: str | None = None - lora_path: str | None = flat_field("lora_path", None) + lora_path: str | None = None lora_nickname: str = "default" - lora_strength: float = flat_field("lora_strength", 1.0) + lora_strength: float = 1.0 lora_target_modules: list[str] | None = None """Module name substrings that restrict LoRA injection, such as ``["q_proj", "v_proj"]``. ``None`` adapts the default modules.""" @@ -205,10 +198,11 @@ class ComponentConfig: class LTX2RefineOptions: """Stage-2 refine settings. ``pipeline.components.upsampler_weights`` holds the refine upsampler. - Resolution copies ``pipeline.preset_overrides.refine`` into the fields of the same name. When the pipeline loads, - the ``fastvideo_refine_*`` defaults of the checkpoint's ``model_index.json`` fill each field that is still ``None`` - (``fastvideo_refine_enabled`` can only turn refine on); ``enabled``, ``add_noise``, ``guidance_scale``, and - ``num_inference_steps`` that are still ``None`` then become ``False``, ``True``, 1.0, and 3. + Resolution copies ``pipeline.preset_overrides.refine`` into the fields of the same name; then the step + ``fill_ltx2_refine_from_checkpoint`` fills each field that is still ``None`` from the ``fastvideo_refine_*`` + defaults of the checkpoint's ``model_index.json`` (``fastvideo_refine_enabled`` can only turn refine on); and + ``fill_runtime_defaults`` gives ``enabled``, ``add_noise``, ``guidance_scale``, and ``num_inference_steps`` that + are still ``None`` the values ``False``, ``True``, 1.0, and 3. """ enabled: bool | None = None @@ -305,7 +299,7 @@ class PipelineSelection: """Timesteps of a few-step distilled (DMD) sampler. ``None`` keeps the model's default.""" boundary_ratio: float | None = None """Mixture-of-experts switch point of a two-transformer model. ``None`` keeps the model's default.""" - output_type: str = flat_field("output_type", "pil") + output_type: str = "pil" """Output of the decoding stage: ``pil`` for decoded frames, ``latent`` to skip the VAE decode.""" dit: dict[str, Any] = field(default_factory=dict) """Overrides for fields of the model's DiT config, such as ``prefix``.""" @@ -323,8 +317,8 @@ class GeneratorConfig: model_path: str mode: ExecutionMode = ExecutionMode.INFERENCE """What the run does: inference, preprocessing, finetuning, or distillation.""" - revision: str | None = flat_field("revision", None) - trust_remote_code: bool = flat_field("trust_remote_code", False) + revision: str | None = None + trust_remote_code: bool = False engine: EngineConfig = field(default_factory=EngineConfig) pipeline: PipelineSelection = field(default_factory=PipelineSelection) diff --git a/fastvideo/api/training_schema.py b/fastvideo/api/training_schema.py index 229a077dd..172caeda2 100644 --- a/fastvideo/api/training_schema.py +++ b/fastvideo/api/training_schema.py @@ -226,27 +226,6 @@ class PreprocessRunConfig(GeneratorConfig): preprocess: PreprocessConfig = field(default_factory=PreprocessConfig) -def resolve_training_offload_conflicts(view: ResolutionView) -> dict[str, Any]: - """Settle offload modes that cannot run together in training, before any device is bound. - - On MPS, FSDP inference and layerwise offload turn off. With layerwise offload on, FSDP inference and DiT CPU - offload turn off. - """ - from fastvideo.platforms import current_platform - - values: dict[str, Any] = {} - if current_platform.is_mps(): - values.update({"engine.use_fsdp_inference": False, "engine.offload.dit_layerwise": False}) - if values.get("engine.offload.dit_layerwise", view.get("engine.offload.dit_layerwise")): - if view.get("engine.use_fsdp_inference"): - logger.warning("dit_layerwise_offload is enabled, automatically disabling use_fsdp_inference.") - values["engine.use_fsdp_inference"] = False - if view.get("engine.offload.dit"): - logger.warning("dit_layerwise_offload is enabled, automatically disabling dit_cpu_offload.") - values["engine.offload.dit"] = False - return values - - def keep_training_dit_on_device(view: ResolutionView) -> dict[str, Any]: """A finetuning or distillation run keeps the DiT on the device, so ``engine.offload.dit`` turns off.""" training = view.get("mode") in (ExecutionMode.FINETUNING, ExecutionMode.DISTILLATION) @@ -297,13 +276,12 @@ def validate_preprocess_options(view: ResolutionView) -> dict[str, Any]: def training_resolution_steps(config: GeneratorConfig, defaults: Any = None) -> tuple[ResolutionStep, ...]: """The resolution steps of a ``TrainingRunConfig``, in the order that they run. - The offload conflicts and the parallel-size check run on the placeholders, before ``derive_parallel_sizes`` - replaces them. + The parallel-size check runs on the placeholders, before ``derive_parallel_sizes`` replaces them. The offload + conflicts are settled by the device-policy steps of the generator list. """ return generator_resolution_steps(config, defaults, - before_placeholders=(resolve_training_offload_conflicts, - validate_training_parallel_sizes), + before_placeholders=(validate_training_parallel_sizes, ), after=(derive_lora_alpha_from_rank, keep_training_dit_on_device)) @@ -391,7 +369,6 @@ __all__ = [ "preprocess_resolution_steps", "resolve_preprocess_config", "resolve_training_config", - "resolve_training_offload_conflicts", "training_resolution_steps", "validate_preprocess_options", "validate_training_parallel_sizes", diff --git a/fastvideo/attention/backends/flash_attn.py b/fastvideo/attention/backends/flash_attn.py index 5ff725a40..5f6f2dd85 100644 --- a/fastvideo/attention/backends/flash_attn.py +++ b/fastvideo/attention/backends/flash_attn.py @@ -36,7 +36,7 @@ logger.info("Worker %s Using FlashAttention-%s backend", local_main_process_only=False) # FP4 FA4 support: quantize Q/K to NVFP4 E2M1 for block-scaled MMA on Blackwell. -# Requires: flash-attention-fp4, flashinfer, cutlass-dsl. Enable via nvfp4_fa4=True kwarg. +# Requires: flash-attention-fp4, flashinfer, cutlass-dsl. Enable via ``engine.attention.nvfp4_fa4``. # The FP4 path uses a dedicated custom_op wrapper (flash_attn_fp4_func) so that # torch.compile treats the CuTeDSL kernel as an opaque boundary. try: diff --git a/fastvideo/configs/pipelines/base.py b/fastvideo/configs/pipelines/base.py index 7f20a8b36..184f4c423 100644 --- a/fastvideo/configs/pipelines/base.py +++ b/fastvideo/configs/pipelines/base.py @@ -90,8 +90,8 @@ class PipelineConfig: def __setattr__(self, name: str, value: Any) -> None: if self.__dict__.get("_frozen") and name in self.__dataclass_fields__: raise AttributeError(f"{type(self).__name__}.{name} was decided by config resolution and is read-only; " - f"to change pipeline_config.{name}, override its typed path with " - "resolved_config.with_override(source, {path: value}) and use the returned config") + f"set the typed path of pipeline_config.{name} in the input config, or decide it in a " + "resolution step") super().__setattr__(name, value) def freeze(self) -> None: diff --git a/fastvideo/dataset/__init__.py b/fastvideo/dataset/__init__.py index 30f36bab0..36881e54f 100644 --- a/fastvideo/dataset/__init__.py +++ b/fastvideo/dataset/__init__.py @@ -9,9 +9,9 @@ from fastvideo.dataset.transform import (CenterCropResizeVideo, Normalize255, Te from fastvideo.dataset.validation_dataset import ValidationDataset -def getdataset(preprocess_config) -> VideoCaptionMergedDataset: +def getdataset(preprocess_config, model_path: str) -> VideoCaptionMergedDataset: """Build the video-caption dataset of ``preprocess_config``, the ``preprocess`` section of a resolved - ``PreprocessRunConfig``.""" + ``PreprocessRunConfig``. ``model_path`` is the local checkpoint directory that holds the tokenizer.""" temporal_sample = (TemporalRandomCrop(preprocess_config.num_frames) if preprocess_config.do_temporal_sample else None) # 16 x norm_fun = Lambda(lambda x: 2.0 * x - 1.0) @@ -32,15 +32,19 @@ def getdataset(preprocess_config) -> VideoCaptionMergedDataset: ]) return VideoCaptionMergedDataset(data_merge_path=preprocess_config.data_merge_path, preprocess_config=preprocess_config, + model_path=model_path, transform=transform, temporal_sample=temporal_sample, transform_topcrop=transform_topcrop, seed=preprocess_config.seed) -def gettextdataset(preprocess_config) -> TextDataset: +def gettextdataset(preprocess_config, model_path: str) -> TextDataset: + """Build the text dataset of ``preprocess_config``; ``model_path`` is the local checkpoint directory that holds + the tokenizer.""" return TextDataset(data_merge_path=preprocess_config.data_merge_path, preprocess_config=preprocess_config, + model_path=model_path, seed=preprocess_config.seed) diff --git a/fastvideo/dataset/preprocessing_datasets.py b/fastvideo/dataset/preprocessing_datasets.py index 8d7cf9c6c..71060c243 100644 --- a/fastvideo/dataset/preprocessing_datasets.py +++ b/fastvideo/dataset/preprocessing_datasets.py @@ -387,6 +387,7 @@ class VideoCaptionMergedDataset(torch.utils.data.IterableDataset, torch.distribu def __init__(self, data_merge_path: str, preprocess_config, + model_path: str, transform, temporal_sample, transform_topcrop, @@ -397,8 +398,8 @@ class VideoCaptionMergedDataset(torch.utils.data.IterableDataset, torch.distribu self.temporal_sample = temporal_sample self.seed = seed - # Initialize tokenizer - tokenizer_path = os.path.join(preprocess_config.model_path, "tokenizer") + # Initialize tokenizer from the local checkpoint directory + tokenizer_path = os.path.join(model_path, "tokenizer") tokenizer = None if os.path.exists(tokenizer_path): try: @@ -565,13 +566,13 @@ class TextDataset(torch.utils.data.IterableDataset, torch.distributed.checkpoint This dataset processes text data through text encoding stages only. """ - def __init__(self, data_merge_path: str, preprocess_config, start_idx: int = 0, seed: int = 42): + def __init__(self, data_merge_path: str, preprocess_config, model_path: str, start_idx: int = 0, seed: int = 42): self.data_merge_path = data_merge_path self.start_idx = start_idx self.seed = seed - # Initialize tokenizer - tokenizer_path = os.path.join(preprocess_config.model_path, "tokenizer") + # Initialize tokenizer from the local checkpoint directory + tokenizer_path = os.path.join(model_path, "tokenizer") tokenizer = AutoTokenizer.from_pretrained(tokenizer_path, cache_dir=preprocess_config.cache_dir) # Initialize text encoding stage diff --git a/fastvideo/entrypoints/streaming/server.py b/fastvideo/entrypoints/streaming/server.py index cabecf614..911314713 100644 --- a/fastvideo/entrypoints/streaming/server.py +++ b/fastvideo/entrypoints/streaming/server.py @@ -189,7 +189,7 @@ def run_server(serve_config: ServeConfig, *, generator: _GeneratorProto | None = if generator is None: from fastvideo import VideoGenerator # lazy to avoid boot cost - generator = VideoGenerator.from_pretrained(config=serve_config.generator) + generator = VideoGenerator.from_config(serve_config.generator) app = build_app(serve_config, generator) uvicorn.run( app, diff --git a/fastvideo/entrypoints/streaming/worker.py b/fastvideo/entrypoints/streaming/worker.py index d90ddb2a3..bbd96a8ad 100644 --- a/fastvideo/entrypoints/streaming/worker.py +++ b/fastvideo/entrypoints/streaming/worker.py @@ -56,7 +56,7 @@ def worker_main( try: from fastvideo import VideoGenerator - generator = VideoGenerator.from_pretrained(config=generator_config) + generator = VideoGenerator.from_config(generator_config) if warmup_config.enabled: _warmup_worker(generator, warmup_config) result_queue.put({"kind": "ready", "worker_id": worker_id}) diff --git a/fastvideo/entrypoints/video_generator.py b/fastvideo/entrypoints/video_generator.py index 283be9ec9..eb50199da 100644 --- a/fastvideo/entrypoints/video_generator.py +++ b/fastvideo/entrypoints/video_generator.py @@ -29,7 +29,6 @@ import fastvideo.envs as envs from fastvideo.api.compat import ( REQUEST_BATCH_EXTRA_PASSTHROUGH_FIELDS, expand_request_prompt_batch, - from_pretrained_kwargs_to_config, load_generator_config_from_file, normalize_generation_request, normalize_generator_config, @@ -150,49 +149,41 @@ class VideoGenerator: @classmethod def from_pretrained( cls, - model_path: str | GeneratorConfig | Mapping[str, Any] | None = None, - **kwargs, + model_path: str, + config: GeneratorConfig | Mapping[str, Any] | None = None, + *, + log_queue=None, + **flat_keywords, ) -> "VideoGenerator": """ Create a video generator from a pretrained model. + ``from_pretrained(model_path, config)`` is ``from_config({"model_path": model_path, **config})``. + Args: model_path: Path or identifier for the pretrained model - **kwargs: The common engine and offload keywords in - ``fastvideo.api.compat.FROM_PRETRAINED_KWARGS``, such as - ``num_gpus`` and ``dit_cpu_offload``. Pass any other setting - through ``VideoGenerator.from_config(...)``. + config: The settings besides ``model_path``, as a nested mapping such as + ``{"engine": {"num_gpus": 2, "offload": {"dit": False}}}`` or a ``GeneratorConfig``. A + ``model_path`` inside it must equal ``model_path``. + log_queue: Optional multiprocessing.Queue to forward worker logs to Returns: The created video generator """ - log_queue = kwargs.pop("log_queue", None) - if kwargs.pop("nvfp4_fa4", False): - import os - os.environ["FASTVIDEO_NVFP4_FA4"] = "1" - envs.setdefault_external("CUTE_DSL_ENABLE_TVM_FFI", "1") - typed_config = kwargs.pop("config", None) - if typed_config is not None: - if model_path is not None: - raise TypeError("Pass either model_path or config to from_pretrained, not both") - if kwargs: - unexpected = ", ".join(sorted(kwargs)) - raise TypeError(f"Unexpected keyword arguments with config: {unexpected}") - return cls.from_config(typed_config, log_queue=log_queue) - - if isinstance(model_path, GeneratorConfig | Mapping): - if kwargs: - unexpected = ", ".join(sorted(kwargs)) - raise TypeError(f"Unexpected keyword arguments with typed config: {unexpected}") - return cls.from_config(model_path, log_queue=log_queue) - - if model_path is None: - raise TypeError("model_path or config is required") - - return cls.from_config( - from_pretrained_kwargs_to_config(model_path, kwargs), - log_queue=log_queue, - ) + if flat_keywords: + unexpected = ", ".join(sorted(flat_keywords)) + raise TypeError(f"VideoGenerator.from_pretrained(...) does not accept {unexpected}. Pass settings as a " + "nested config at their typed paths, for example " + "from_pretrained(model_path, {'engine': {'num_gpus': 2, 'offload': {'dit': False}}}).") + if config is None: + return cls.from_config({"model_path": model_path}, log_queue=log_queue) + if isinstance(config, GeneratorConfig): + if config.model_path != model_path: + raise ValueError(f"config.model_path {config.model_path!r} differs from model_path {model_path!r}") + return cls.from_config(config, log_queue=log_queue) + if config.get("model_path", model_path) != model_path: + raise ValueError(f"config['model_path'] {config['model_path']!r} differs from model_path {model_path!r}") + return cls.from_config({**config, "model_path": model_path}, log_queue=log_queue) @classmethod def from_config( diff --git a/fastvideo/models/loader/component_loader.py b/fastvideo/models/loader/component_loader.py index 906f0af4e..1e5e9beb1 100644 --- a/fastvideo/models/loader/component_loader.py +++ b/fastvideo/models/loader/component_loader.py @@ -19,7 +19,7 @@ from torch.distributed import init_device_mesh from transformers import AutoImageProcessor, AutoProcessor, AutoTokenizer from transformers.utils import SAFE_WEIGHTS_INDEX_NAME -from fastvideo.api.device_policy import UNIFIED_MEMORY_OFFLOAD_PATHS, offload_disabled_on_unified_memory +from fastvideo.api.device_policy import UNIFIED_MEMORY_OFFLOAD_PATHS from fastvideo.api.inference_resolution import torch_compile_kwargs from fastvideo.api.resolution import ResolvedGeneratorConfig from fastvideo.attention.selector import ( @@ -358,27 +358,12 @@ class TextEncoderLoader(ComponentLoader): offload_flag: str = "text_encoder_cpu_offload", ): runtime_device = get_local_torch_device() - device_id = runtime_device.index if runtime_device.index is not None else 0 if cpu_offload is None: - # offload_flag names the device-policy switch of this component; its value is the - # engine.offload field at the same path (text_encoder_cpu_offload -> engine.offload.text_encoder). + # offload_flag names the device-policy switch of this component; its value is the engine.offload field + # at the same path (text_encoder_cpu_offload -> engine.offload.text_encoder), which resolution already + # settled for the memory class of this device. offload_field = UNIFIED_MEMORY_OFFLOAD_PATHS[offload_flag].rsplit(".", 1)[1] - requested_cpu_offload = getattr(resolved_config.engine.offload, offload_field) - else: - requested_cpu_offload = cpu_offload - # The resolved config already carries the worker's offload policy, so only ask whether the policy covers - # this component. - disable_cpu_offload = offload_disabled_on_unified_memory(device_id, offload_flag) - - if requested_cpu_offload and disable_cpu_offload: - # Direct loader callers can choose a CPU target before the worker - # applies its device-local policy. Reset both the request and the - # target so the model is never constructed on the host first. - logger.info("Disabling %s on unified-memory device %d", offload_flag, device_id) - cpu_offload = False - target_device = runtime_device - else: - cpu_offload = requested_cpu_offload + cpu_offload = getattr(resolved_config.engine.offload, offload_field) use_cpu_offload = (cpu_offload and len(getattr(model_config, "_fsdp_shard_conditions", [])) > 0) from fastvideo.platforms import current_platform @@ -1050,11 +1035,14 @@ class TransformerLoader(ComponentLoader): def load(self, model_path: str, resolved_config: ResolvedGeneratorConfig, - loading_teacher_critic_model: bool = False): + loading_teacher_critic_model: bool = False, + override_transformer_cls_name: str | None = None): """Load the transformer based on the model path, and inference args. ``loading_teacher_critic_model`` marks a DMD teacher (real_score) or critic (fake_score) transformer, which - loads its checkpoint weights in full precision with dense attention. + loads its checkpoint weights in full precision with dense attention. ``override_transformer_cls_name`` is the + model class to build for this load; it takes precedence over + ``pipeline.components.override_transformer_cls_name``. """ config = get_diffusers_config(model=model_path) hf_config = deepcopy(config) @@ -1065,7 +1053,8 @@ class TransformerLoader(ComponentLoader): "Only diffusers format is supported.") logger.info("transformer cls_name: %s", cls_name) - override_transformer_cls_name = resolved_config.pipeline.components.override_transformer_cls_name + if override_transformer_cls_name is None: + override_transformer_cls_name = resolved_config.pipeline.components.override_transformer_cls_name if override_transformer_cls_name is not None: cls_name = override_transformer_cls_name logger.info("Overriding transformer cls_name to %s", cls_name) @@ -1392,6 +1381,7 @@ class PipelineComponentLoader: transformers_or_diffusers: str, resolved_config: ResolvedGeneratorConfig, loading_teacher_critic_model: bool = False, + override_transformer_cls_name: str | None = None, ): """ Load a pipeline module. @@ -1403,6 +1393,9 @@ class PipelineComponentLoader: resolved_config: The resolved runtime config loading_teacher_critic_model: Whether a transformer is a DMD teacher or critic; passed to ``TransformerLoader.load`` and ignored by the other loaders + override_transformer_cls_name: The model class to build for a transformer, over + ``pipeline.components.override_transformer_cls_name``; passed to ``TransformerLoader.load`` and + ignored by the other loaders Returns: The loaded module @@ -1438,5 +1431,6 @@ class PipelineComponentLoader: if isinstance(loader, TransformerLoader): return loader.load(component_model_path, resolved_config, - loading_teacher_critic_model=loading_teacher_critic_model) + loading_teacher_critic_model=loading_teacher_critic_model, + override_transformer_cls_name=override_transformer_cls_name) return loader.load(component_model_path, resolved_config) diff --git a/fastvideo/models/pinned_offload.py b/fastvideo/models/pinned_offload.py index 08c45802a..faf56dd14 100644 --- a/fastvideo/models/pinned_offload.py +++ b/fastvideo/models/pinned_offload.py @@ -63,7 +63,7 @@ def load(module: nn.Module, device: torch.device, pin: bool = True) -> nn.Module return module.to(device) missing = [(name, t) for name, t in _tensors(module) if t.data.device != device] if not missing: - # Already resident, which is what ``vae_cpu_offload=False`` leaves. Taking + # Already resident, which is what ``engine.offload.vae: false`` leaves. Taking # host copies here would pull the whole module back over PCIe once and keep # a pinned mirror of it for the life of the process, for a module that never # leaves the device. diff --git a/fastvideo/pipelines/basic/ltx2/ltx2_pipeline.py b/fastvideo/pipelines/basic/ltx2/ltx2_pipeline.py index 75014e674..82d75888e 100644 --- a/fastvideo/pipelines/basic/ltx2/ltx2_pipeline.py +++ b/fastvideo/pipelines/basic/ltx2/ltx2_pipeline.py @@ -18,88 +18,6 @@ from fastvideo.pipelines.stages import (DecodingStage, InputValidationStage, LTX logger = init_logger(__name__) -# Values of the stage-2 refine settings that neither the input nor the checkpoint's model_index.json decided. -_REFINE_DEFAULTS: dict[str, Any] = { - "pipeline.ltx2.refine.enabled": False, - "pipeline.ltx2.refine.add_noise": True, - "pipeline.ltx2.refine.guidance_scale": 1.0, - "pipeline.ltx2.refine.num_inference_steps": 3, -} -# Refine component paths, by the model_index.json key that supplies the checkpoint's default. -_REFINE_PATH_KEYS = { - "pipeline.ltx2.refine.transformer_path": "fastvideo_refine_transformer_path", - "pipeline.ltx2.refine.lora_path": "fastvideo_refine_lora_path", - "pipeline.ltx2.refine.noise_path": "fastvideo_refine_noise_path", - "pipeline.ltx2.refine.audio_noise_path": "fastvideo_refine_audio_noise_path", -} - - -def _resolve_refine_path(model_path: str, value: str | None) -> str | None: - """Resolve a refine component path, preferring paths inside the local - model snapshot when the value is relative.""" - if value is None: - return None - if os.path.isabs(value): - return value - candidate = os.path.join(model_path, value) - if os.path.exists(candidate): - return candidate - return value - - -def _resolve_refine_upsampler_path(model_path: str, model_index: dict[str, Any]) -> str | None: - """Resolve the refine upsampler directory for a local model snapshot. - - model_index.json keys ("fastvideo_refine_upsampler_path", then - "spatial_upsampler") are the documented override and win when present. - Otherwise probe the snapshot root: published LTX-2 distilled checkpoints - bundle the upsampler weights on disk (spelled "spatial_upscaler") - without declaring them in model_index.json. - """ - path = _resolve_refine_path(model_path, model_index.get("fastvideo_refine_upsampler_path")) - if path is None and "spatial_upsampler" in model_index: - path = _resolve_refine_path(model_path, "spatial_upsampler") - if path is None: - for dirname in ("spatial_upscaler", "spatial_upsampler"): - candidate = os.path.join(model_path, dirname) - if os.path.isdir(candidate): - return candidate - return path - - -def _checkpoint_refine_values(resolved_config: ResolvedGeneratorConfig, model_path: str, - model_index: dict[str, Any]) -> dict[str, Any]: - """The refine settings that the checkpoint's ``model_index.json`` and the refine defaults change. - - Distilled checkpoints bundle ``fastvideo_refine_*`` defaults so the pipeline can configure itself. Each one fills - its setting only while the setting is ``None``, so a value from the input always wins; ``fastvideo_refine_enabled`` - can only turn refine on. The upsampler falls back to a directory in the snapshot. The four switches that are still - ``None`` afterwards take ``_REFINE_DEFAULTS``. The result holds only the paths whose value changes. - """ - - def current(path: str) -> Any: - return resolved_config.provenance(path).value - - values: dict[str, Any] = {} - if model_index.get("fastvideo_refine_enabled") is True and current("pipeline.ltx2.refine.enabled") is None: - values["pipeline.ltx2.refine.enabled"] = True - if current("pipeline.components.upsampler_weights") is None: - values["pipeline.components.upsampler_weights"] = _resolve_refine_upsampler_path(model_path, model_index) - for path, key in _REFINE_PATH_KEYS.items(): - if current(path) is None: - values[path] = _resolve_refine_path(model_path, model_index.get(key)) - for path, key, convert in ( - ("pipeline.ltx2.refine.num_inference_steps", "fastvideo_refine_num_inference_steps", int), - ("pipeline.ltx2.refine.guidance_scale", "fastvideo_refine_guidance_scale", float), - ("pipeline.ltx2.refine.add_noise", "fastvideo_refine_add_noise", bool), - ): - if current(path) is None and model_index.get(key) is not None: - values[path] = convert(model_index[key]) - for path, default in _REFINE_DEFAULTS.items(): - if values.get(path, current(path)) is None: - values[path] = default - return {path: value for path, value in values.items() if value != current(path)} - class LTX2Pipeline(LoRAPipeline): @@ -238,13 +156,6 @@ class LTX2Pipeline(LoRAPipeline): model_index = self._load_config(self.model_path) logger.info("Loading pipeline modules from config: %s", model_index) - # Apply the refine defaults bundled in model_index.json, then the remaining refine defaults. The pipeline owns - # its config; later stages read the rebound one. - refine_values = _checkpoint_refine_values(resolved_config, self.model_path, model_index) - if refine_values: - resolved_config = resolved_config.with_override("checkpoint:model_index.json", refine_values) - self.resolved_config = resolved_config - model_index.pop("_class_name") model_index.pop("_diffusers_version") model_index.pop("workload_type", None) diff --git a/fastvideo/pipelines/basic/minimax_h3/minimax_h3_pipeline.py b/fastvideo/pipelines/basic/minimax_h3/minimax_h3_pipeline.py index 8a3f5da90..071ccdf2d 100644 --- a/fastvideo/pipelines/basic/minimax_h3/minimax_h3_pipeline.py +++ b/fastvideo/pipelines/basic/minimax_h3/minimax_h3_pipeline.py @@ -160,10 +160,15 @@ class MiniMaxH3BasePipeline(LoRAPipeline, ComposedPipelineBase): shift = getattr(self.get_module(module_name), "shift", None) if shift is None or not math.isfinite(float(shift)) or float(shift) <= 0: raise ValueError(f"MiniMax-H3 {modality} scheduler must expose a positive finite shift, got {shift}.") - self._load_checkpoint_schedule(resolved_config) + self._validate_checkpoint_schedule(resolved_config) - def _load_checkpoint_schedule(self, resolved_config: ResolvedGeneratorConfig) -> None: - """A distilled export's schedule is explicit; never silently use a uniform grid.""" + def _validate_checkpoint_schedule(self, resolved_config: ResolvedGeneratorConfig) -> None: + """Check the checkpoint's ``fastvideo_inference.json`` against the loaded schedulers and the resolved schedule. + + Resolution fills ``pipeline.dmd_denoising_steps`` from that file (``fill_dmd_schedule_from_checkpoint``); a + distilled export's schedule is explicit, so a config that disagrees with the file, or that has no schedule + although the file declares one, raises rather than silently using a uniform grid. + """ path = Path(self.model_path) / "fastvideo_inference.json" if not path.is_file(): return @@ -190,10 +195,12 @@ class MiniMaxH3BasePipeline(LoRAPipeline, ComposedPipelineBase): or declared <= 0 or float(self.get_module(name).shift) != float(declared)): raise ValueError(f"FastH3 checkpoint {key}={declared!r} disagrees with {name}/scheduler_config.json.") configured_steps = resolved_config.pipeline.dmd_denoising_steps - if configured_steps is not None and list(configured_steps) != steps: + if configured_steps is None: + raise ValueError("The checkpoint's fastvideo_inference.json declares a DMD schedule but " + "pipeline.dmd_denoising_steps is unset; resolve the config with the checkpoint's " + "model_path so that fill_dmd_schedule_from_checkpoint fills it.") + if list(configured_steps) != steps: raise ValueError("Explicit DMD schedule disagrees with the checkpoint's trained DMD rungs.") - self.resolved_config = resolved_config.with_override("checkpoint:fastvideo_inference.json", - {"pipeline.dmd_denoising_steps": list(steps)}) logger.info("FastH3 checkpoint schedule: %d transformer forwards, DMD rungs=%s, video/audio shifts=%s/%s", len(steps), steps, self.get_module("scheduler").shift, @@ -412,7 +419,7 @@ class MiniMaxH3BasePipeline(LoRAPipeline, ComposedPipelineBase): self._add_denoise_stages(ref2va=ref2va) def forward(self, batch: ForwardBatch, resolved_config: ResolvedGeneratorConfig) -> ForwardBatch: - resolved_config = self._post_init_before_forward(resolved_config) + self._post_init_before_forward() # Sequential encode-then-release is the H3-only fallback. Lazy and the # fully-resident discrete-GPU path both keep a complete stage list and diff --git a/fastvideo/pipelines/basic/stable_audio/stages/latent_preparation.py b/fastvideo/pipelines/basic/stable_audio/stages/latent_preparation.py index febaa07f8..609a00b2e 100644 --- a/fastvideo/pipelines/basic/stable_audio/stages/latent_preparation.py +++ b/fastvideo/pipelines/basic/stable_audio/stages/latent_preparation.py @@ -94,7 +94,7 @@ class StableAudioLatentPreparationStage(PipelineStage): have to. """ assert self.vae is not None, "VAE required for init_audio / inpaint_audio encoding" - # VAE may be CPU-parked under `vae_cpu_offload=True`. + # VAE may be CPU-parked under `engine.offload.vae: true`. self.vae = self.vae.to(device) if isinstance(audio, str | os.PathLike): audio = _decode_audio_file(audio, target_sr=self.sample_rate) diff --git a/fastvideo/pipelines/composed_pipeline_base.py b/fastvideo/pipelines/composed_pipeline_base.py index bc7cc132d..7bb3967f1 100644 --- a/fastvideo/pipelines/composed_pipeline_base.py +++ b/fastvideo/pipelines/composed_pipeline_base.py @@ -13,11 +13,10 @@ from typing import Any, cast import torch -from fastvideo.api.device_policy import finalize_device_offload_policy from fastvideo.api.inference_resolution import torch_compile_kwargs from fastvideo.api.resolution import ResolvedGeneratorConfig, thaw from fastvideo.distributed import ( - get_local_torch_device, + get_local_torch_device, # noqa: F401 # the MiniMax-H3 pipeline reads the device through this module get_world_group, maybe_init_distributed_environment_and_model_parallel, ) @@ -155,16 +154,6 @@ class ComposedPipelineBase(ABC): maybe_init_distributed_environment_and_model_parallel(resolved_config.engine.parallelism.tp_size, resolved_config.engine.parallelism.sp_size) - # VideoGenerator applies this in each Worker before building the - # pipeline. Keep direct from_pretrained/build_pipeline callers aligned, - # but only after distributed setup has selected this process's device. - # On a config that the worker already decided, the policy changes nothing. - if resolved_config.inference_mode: - local_device = get_local_torch_device() - device_id = local_device.index if local_device.index is not None else 0 - resolved_config = finalize_device_offload_policy(resolved_config, device_id) - self.resolved_config = resolved_config - # Torch profiler. Enabled and configured through env vars: # FASTVIDEO_TORCH_PROFILER_DIR=/path/to/save/trace trace_dir = envs.FASTVIDEO_TORCH_PROFILER_DIR.get() @@ -727,17 +716,10 @@ class ComposedPipelineBase(ABC): stage_name) self._install_lazy_release_hooks() - def _post_init_before_forward(self, resolved_config: ResolvedGeneratorConfig) -> ResolvedGeneratorConfig: - """Run ``post_init`` before the first forward, and return the config that the stages read. - - ``post_init`` can rebind ``self.resolved_config`` to an override of it, such as a schedule from the - checkpoint. A caller that passed the pipeline's own config then runs with the rebound one. - """ - if self.post_init_called: - return resolved_config - passed_own_config = resolved_config is self.resolved_config - self.post_init() - return self.resolved_config if passed_own_config else resolved_config + def _post_init_before_forward(self) -> None: + """Run ``post_init`` once, before the first forward.""" + if not self.post_init_called: + self.post_init() # TODO(will): don't hardcode no_grad @torch.no_grad() @@ -755,7 +737,7 @@ class ComposedPipelineBase(ABC): Returns: ForwardBatch: The batch with the generated video or image. """ - resolved_config = self._post_init_before_forward(resolved_config) + self._post_init_before_forward() # Execute each stage logger.info("Running pipeline stages: %s", self._stage_name_mapping.keys()) diff --git a/fastvideo/pipelines/preprocess/matrixgame2/matrixgame2_preprocess_pipeline_ode_trajectory.py b/fastvideo/pipelines/preprocess/matrixgame2/matrixgame2_preprocess_pipeline_ode_trajectory.py index a5ebeaf1f..7ecc729dc 100644 --- a/fastvideo/pipelines/preprocess/matrixgame2/matrixgame2_preprocess_pipeline_ode_trajectory.py +++ b/fastvideo/pipelines/preprocess/matrixgame2/matrixgame2_preprocess_pipeline_ode_trajectory.py @@ -364,7 +364,7 @@ class PreprocessPipeline_MatrixGame2_ODE_Trajectory(BasePreprocessPipeline): os.makedirs(self.combined_parquet_dir, exist_ok=True) # Loading dataset - train_dataset = getdataset(preprocess_config) + train_dataset = getdataset(preprocess_config, self.model_path) self.preprocess_dataloader = DataLoader( train_dataset, diff --git a/fastvideo/pipelines/preprocess/preprocess_pipeline_base.py b/fastvideo/pipelines/preprocess/preprocess_pipeline_base.py index fcefb8f48..90366dfe5 100644 --- a/fastvideo/pipelines/preprocess/preprocess_pipeline_base.py +++ b/fastvideo/pipelines/preprocess/preprocess_pipeline_base.py @@ -251,7 +251,7 @@ class BasePreprocessPipeline(ComposedPipelineBase): start_idx += table.num_rows # Loading dataset - train_dataset = getdataset(preprocess_config) + train_dataset = getdataset(preprocess_config, self.model_path) train_dataloader = DataLoader( train_dataset, diff --git a/fastvideo/pipelines/preprocess/preprocess_pipeline_ode_trajectory.py b/fastvideo/pipelines/preprocess/preprocess_pipeline_ode_trajectory.py index 23cb12059..c0c029415 100644 --- a/fastvideo/pipelines/preprocess/preprocess_pipeline_ode_trajectory.py +++ b/fastvideo/pipelines/preprocess/preprocess_pipeline_ode_trajectory.py @@ -259,7 +259,7 @@ class PreprocessPipeline_ODE_Trajectory(BasePreprocessPipeline): os.makedirs(self.combined_parquet_dir, exist_ok=True) # Loading dataset - train_dataset = gettextdataset(preprocess_config) + train_dataset = gettextdataset(preprocess_config, self.model_path) self.preprocess_dataloader = DataLoader( train_dataset, diff --git a/fastvideo/pipelines/preprocess/preprocess_pipeline_text.py b/fastvideo/pipelines/preprocess/preprocess_pipeline_text.py index 73b701e21..0f94b7807 100644 --- a/fastvideo/pipelines/preprocess/preprocess_pipeline_text.py +++ b/fastvideo/pipelines/preprocess/preprocess_pipeline_text.py @@ -152,7 +152,7 @@ class PreprocessPipeline_Text(BasePreprocessPipeline): os.makedirs(self.combined_parquet_dir, exist_ok=True) # Loading text dataset - train_dataset = gettextdataset(preprocess_config) + train_dataset = gettextdataset(preprocess_config, self.model_path) self.preprocess_dataloader = DataLoader( train_dataset, diff --git a/fastvideo/pipelines/preprocess/v1_preprocess.py b/fastvideo/pipelines/preprocess/v1_preprocess.py index b44a96c3c..5947ab121 100644 --- a/fastvideo/pipelines/preprocess/v1_preprocess.py +++ b/fastvideo/pipelines/preprocess/v1_preprocess.py @@ -12,22 +12,16 @@ from fastvideo.pipelines.preprocess.preprocess_pipeline_text import (PreprocessP from fastvideo.pipelines.preprocess.matrixgame2.matrixgame2_preprocess_pipeline import (PreprocessPipeline_MatrixGame2) from fastvideo.pipelines.preprocess.matrixgame2.matrixgame2_preprocess_pipeline_ode_trajectory import ( PreprocessPipeline_MatrixGame2_ODE_Trajectory) -from fastvideo.utils import maybe_download_model logger = init_logger(__name__) def main(resolved_config: ResolvedGeneratorConfig) -> None: - """Download the model and run the pipeline of ``preprocess.preprocess_task`` on one GPU. + """Run the pipeline of ``preprocess.preprocess_task`` on one GPU. - The local checkpoint directory becomes ``model_path`` and ``preprocess.model_path``, which the pipelines and the - dataset tokenizer read. + The pipeline downloads the checkpoint of ``model_path`` and keeps the local directory as its ``model_path``, which + the dataset tokenizer reads too. """ - model_path = maybe_download_model(resolved_config.model_path) - resolved_config = resolved_config.with_override("v1_preprocess.main", { - "model_path": model_path, - "preprocess.model_path": model_path, - }) maybe_init_distributed_environment_and_model_parallel(1, 1) num_gpus = int(os.environ["WORLD_SIZE"]) assert num_gpus == 1, "Only support 1 GPU" @@ -61,8 +55,8 @@ def main(resolved_config: ResolvedGeneratorConfig) -> None: logger.info("Preprocess task: %s using %s", preprocess_task, PreprocessPipeline.__name__) - pipeline = PreprocessPipeline(model_path, resolved_config) - pipeline.forward(batch=None, resolved_config=pipeline.resolved_config) + pipeline = PreprocessPipeline(resolved_config.model_path, resolved_config) + pipeline.forward(batch=None, resolved_config=resolved_config) if __name__ == "__main__": diff --git a/fastvideo/pipelines/stages/kandinsky5.py b/fastvideo/pipelines/stages/kandinsky5.py index c126e2fb7..6065f1ca7 100644 --- a/fastvideo/pipelines/stages/kandinsky5.py +++ b/fastvideo/pipelines/stages/kandinsky5.py @@ -248,7 +248,7 @@ class Kandinsky5DenoisingStage(PipelineStage): transformer ``ValidationCallback`` reuses from training (whose ``engine.precision.dit`` reflects the fp32 master-weight load dtype, not the actual bf16 compute dtype) and multi-GPU - ``use_fsdp_inference=True`` runs. + ``engine.use_fsdp_inference: true`` runs. For that FSDP case, read the policy itself (``set_mixed_precision_policy`` records it right before diff --git a/fastvideo/tests/api/config_snapshot.py b/fastvideo/tests/api/config_snapshot.py index 3f9b450e5..92e25e848 100644 --- a/fastvideo/tests/api/config_snapshot.py +++ b/fastvideo/tests/api/config_snapshot.py @@ -9,10 +9,8 @@ resolution decisions; a request case records the ``SamplingParam`` and the reque - ``yaml``: every repository config file with a ``generator`` section, through ``load_generator_config_from_file`` and ``resolve_inference_config``; its ``request`` or ``default_request`` through the ``fastvideo generate`` and ``fastvideo serve`` loaders and ``request_to_sampling_param``. -- ``kwargs``: ``VideoGenerator.from_pretrained`` keywords, through ``from_pretrained_kwargs_to_config`` and the same - resolution. -- ``config``: typed ``GeneratorConfig`` mappings, as ``VideoGenerator.from_config`` receives them, through the same - resolution. +- ``config``: typed ``GeneratorConfig`` mappings, as ``VideoGenerator.from_config`` and + ``VideoGenerator.from_pretrained`` receive them, through the same resolution. - ``environment``: environment variables that resolution folds into typed fields. - ``request``: typed ``GenerationRequest`` values, through ``request_to_sampling_param``. @@ -187,13 +185,17 @@ def snapshot_request(request: Any, model_path: str) -> dict[str, Any]: @contextlib.contextmanager def isolated_environment(env_values: dict[str, Any] | None = None) -> Iterator[None]: - """Unset every registered FastVideo environment variable, set ``env_values``, and block model-index downloads. + """Unset every registered FastVideo environment variable, set ``env_values``, block model-index downloads, and + turn the device policy off. The registry's ``override`` context managers restore the previous values on exit. Downloads are blocked by - replacing ``fastvideo.registry.maybe_download_model_index``, the only network call on the configuration path. + replacing ``fastvideo.registry.maybe_download_model_index``, the only network call on the configuration path. The + device policy steps are turned off (``device_policy.APPLY_DEVICE_POLICY``) so that a snapshot does not depend on + the machine that produced it. """ import fastvideo.envs as envs import fastvideo.registry as registry + from fastvideo.api import device_policy def refuse_download(model_path: str, *args: Any, **kwargs: Any) -> dict[str, Any]: raise OfflineResolutionError(f"resolving {model_path!r} needs a model_index.json download") @@ -205,6 +207,9 @@ def isolated_environment(env_values: dict[str, Any] | None = None) -> Iterator[N original = registry.maybe_download_model_index registry.maybe_download_model_index = refuse_download stack.callback(setattr, registry, "maybe_download_model_index", original) + apply_policy = device_policy.APPLY_DEVICE_POLICY + device_policy.APPLY_DEVICE_POLICY = False + stack.callback(setattr, device_policy, "APPLY_DEVICE_POLICY", apply_policy) yield @@ -249,16 +254,6 @@ def _yaml_request(path: Path) -> Any: return build_serve_config(namespace).default_request -def _kwargs_case(model_path: str, kwargs: dict[str, Any]) -> Callable[[], dict[str, Any]]: - - def build() -> dict[str, Any]: - from fastvideo.api.compat import from_pretrained_kwargs_to_config - - return snapshot_resolved_generator_config(from_pretrained_kwargs_to_config(model_path, kwargs)) - - return build - - def _config_case(raw: dict[str, Any]) -> Callable[[], dict[str, Any]]: def build() -> dict[str, Any]: @@ -318,37 +313,46 @@ def collect_cases() -> list[SnapshotCase]: SnapshotCase("yaml", path.relative_to(REPO_ROOT).as_posix(), _yaml_case(path)) for path in _repository_config_files() ] - # One case per kind of branch in from_pretrained_kwargs_to_config: keywords of typed fields and compile sub-keys. - kwargs_cases = { - "typed_offload_and_parallelism": (WAN_T2V, { - "num_gpus": 2, - "sp_size": 2, - "dit_cpu_offload": False, - "vae_cpu_offload": False, - }), - "torch_compile_kwargs_typed_and_extra": (WAN_T2V, { - "enable_torch_compile": True, - "torch_compile_kwargs": { - "backend": "inductor", - "mode": "max-autotune", - "fullgraph": True, - "options": { - "triton.cudagraphs": False - }, - }, - }), - "disable_autocast": (WAN_T2V, { - "disable_autocast": True - }), - } - cases += [ - SnapshotCase("kwargs", name, _kwargs_case(model, kwargs)) for name, (model, kwargs) in kwargs_cases.items() - ] - # Typed configs for the settings that only from_config accepts: typed fields, a model-only PipelineConfig - # attribute and a key that code reads by name in pipeline.experimental, LTX-2 refine and VAE tile fields, and a - # pipeline config JSON path. + # Typed configs: engine, offload, parallelism, and compile fields, a model-only PipelineConfig attribute and a key + # that code reads by name in pipeline.experimental, LTX-2 refine and VAE tile fields, and a pipeline config JSON + # path. pipeline_json = str(REPO_ROOT / "fastvideo/configs/fasthunyuan_t2v.json") config_cases = { + "typed_offload_and_parallelism": { + "model_path": WAN_T2V, + "engine": { + "num_gpus": 2, + "parallelism": { + "sp_size": 2 + }, + "offload": { + "dit": False, + "vae": False + }, + }, + }, + "torch_compile_kwargs_typed_and_extra": { + "model_path": WAN_T2V, + "engine": { + "compile": { + "enabled": True, + "backend": "inductor", + "mode": "max-autotune", + "fullgraph": True, + "extras": { + "options": { + "triton.cudagraphs": False + } + }, + } + }, + }, + "disable_autocast": { + "model_path": WAN_T2V, + "engine": { + "disable_autocast": True + }, + }, "attention_precision_and_flow_shift": { "model_path": WAN_T2V, "engine": { diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/attention_precision_and_flow_shift.json b/fastvideo/tests/api/config_snapshot_goldens/config/attention_precision_and_flow_shift.json index 0034f1ea4..869069cbe 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/attention_precision_and_flow_shift.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/attention_precision_and_flow_shift.json @@ -318,6 +318,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -333,6 +337,7 @@ "backend": "TORCH_SDPA", "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.5, "vsa_tile_size": 256 }, @@ -421,14 +426,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/boundary_ratio.json b/fastvideo/tests/api/config_snapshot_goldens/config/boundary_ratio.json index 0c1271ba0..a961ee6f0 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/boundary_ratio.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/boundary_ratio.json @@ -332,6 +332,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -347,6 +351,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -440,14 +445,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/kwargs/disable_autocast.json b/fastvideo/tests/api/config_snapshot_goldens/config/disable_autocast.json similarity index 97% rename from fastvideo/tests/api/config_snapshot_goldens/kwargs/disable_autocast.json rename to fastvideo/tests/api/config_snapshot_goldens/config/disable_autocast.json index 3024fd03e..f2b877cd1 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/kwargs/disable_autocast.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/disable_autocast.json @@ -321,6 +321,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +340,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -424,14 +429,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/experimental_keys.json b/fastvideo/tests/api/config_snapshot_goldens/config/experimental_keys.json index 397922720..ef49fb4df 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/experimental_keys.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/experimental_keys.json @@ -321,6 +321,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +340,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -431,14 +436,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_disabled.json b/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_disabled.json index a7e147fd4..62f5c05aa 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_disabled.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_disabled.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": "", "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_path.json b/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_path.json index 69c59c336..0f22bc579 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_path.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_refine_lora_path.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": "/checkpoints/refine_lora.safetensors", "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_vae_tile_sizes.json b/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_vae_tile_sizes.json index 2fa548055..69cc9c2a3 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_vae_tile_sizes.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/ltx2_vae_tile_sizes.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/master_port_refine_enabled_boundary_ratio.json b/fastvideo/tests/api/config_snapshot_goldens/config/master_port_refine_enabled_boundary_ratio.json index 0507580ac..019154b48 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/master_port_refine_enabled_boundary_ratio.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/master_port_refine_enabled_boundary_ratio.json @@ -321,6 +321,9 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +339,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -424,14 +428,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, "enabled": true, - "guidance_scale": null, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/pipeline_config_json_path.json b/fastvideo/tests/api/config_snapshot_goldens/config/pipeline_config_json_path.json index 109b8f0d6..5afd20451 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/pipeline_config_json_path.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/pipeline_config_json_path.json @@ -349,6 +349,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -364,6 +368,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -453,14 +458,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/kwargs/torch_compile_kwargs_typed_and_extra.json b/fastvideo/tests/api/config_snapshot_goldens/config/torch_compile_kwargs_typed_and_extra.json similarity index 97% rename from fastvideo/tests/api/config_snapshot_goldens/kwargs/torch_compile_kwargs_typed_and_extra.json rename to fastvideo/tests/api/config_snapshot_goldens/config/torch_compile_kwargs_typed_and_extra.json index d6317c572..40cea3034 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/kwargs/torch_compile_kwargs_typed_and_extra.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/torch_compile_kwargs_typed_and_extra.json @@ -321,6 +321,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +340,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -428,14 +433,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/kwargs/typed_offload_and_parallelism.json b/fastvideo/tests/api/config_snapshot_goldens/config/typed_offload_and_parallelism.json similarity index 97% rename from fastvideo/tests/api/config_snapshot_goldens/kwargs/typed_offload_and_parallelism.json rename to fastvideo/tests/api/config_snapshot_goldens/config/typed_offload_and_parallelism.json index 0c4bc50fe..327f9f1ed 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/kwargs/typed_offload_and_parallelism.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/typed_offload_and_parallelism.json @@ -320,6 +320,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -335,6 +339,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -423,14 +428,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/config/vae_tiling_typed.json b/fastvideo/tests/api/config_snapshot_goldens/config/vae_tiling_typed.json index 504f1514f..54605cc41 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/config/vae_tiling_typed.json +++ b/fastvideo/tests/api/config_snapshot_goldens/config/vae_tiling_typed.json @@ -294,6 +294,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -309,6 +313,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -397,14 +402,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/environment/attention_backend.json b/fastvideo/tests/api/config_snapshot_goldens/environment/attention_backend.json index 023c6b062..6374444b7 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/environment/attention_backend.json +++ b/fastvideo/tests/api/config_snapshot_goldens/environment/attention_backend.json @@ -327,6 +327,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -342,6 +346,7 @@ "backend": "TORCH_SDPA", "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -430,14 +435,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/environment/explicit_argument_wins_over_attention_backend.json b/fastvideo/tests/api/config_snapshot_goldens/environment/explicit_argument_wins_over_attention_backend.json index 0961e7c10..1e5f23349 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/environment/explicit_argument_wins_over_attention_backend.json +++ b/fastvideo/tests/api/config_snapshot_goldens/environment/explicit_argument_wins_over_attention_backend.json @@ -321,6 +321,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +340,7 @@ "backend": "FLASH_ATTN", "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -424,14 +429,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/environment/inference_torch_compile.json b/fastvideo/tests/api/config_snapshot_goldens/environment/inference_torch_compile.json index ec9a588a6..4ce2ead10 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/environment/inference_torch_compile.json +++ b/fastvideo/tests/api/config_snapshot_goldens/environment/inference_torch_compile.json @@ -326,6 +326,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -341,6 +345,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -429,14 +434,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/environment/vae_parallel.json b/fastvideo/tests/api/config_snapshot_goldens/environment/vae_parallel.json index 5c93b8327..a17087131 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/environment/vae_parallel.json +++ b/fastvideo/tests/api/config_snapshot_goldens/environment/vae_parallel.json @@ -323,6 +323,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.video_decode_backend": "h3-vae", @@ -336,6 +340,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -424,14 +429,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Cam-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Cam-Diffusers.json index 9c45d73cf..dffb6f5a8 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Cam-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Cam-Diffusers.json @@ -388,6 +388,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -403,6 +407,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -491,14 +496,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Diffusers.json index c02918a05..6660f0bcc 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__DreamX-World-5B-Diffusers.json @@ -436,6 +436,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -451,6 +455,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -544,14 +549,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastHunyuan-diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastHunyuan-diffusers.json index b02828cac..aed9a49d0 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastHunyuan-diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastHunyuan-diffusers.json @@ -349,6 +349,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -364,6 +368,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -453,14 +458,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-FastH3-8-Step-V2.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-FastH3-8-Step-V2.json index a2febd6ea..ed78ef9ba 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-FastH3-8-Step-V2.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-FastH3-8-Step-V2.json @@ -429,6 +429,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -444,6 +448,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -532,14 +537,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-Minimax-FastH3-Preview-v0.2.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-Minimax-FastH3-Preview-v0.2.json index 43561d37a..9b083fdac 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-Minimax-FastH3-Preview-v0.2.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastVideo-Minimax-FastH3-Preview-v0.2.json @@ -429,6 +429,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -444,6 +448,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -532,14 +537,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-1.3B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-1.3B-Diffusers.json index c1903eaa9..493688f30 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-1.3B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-1.3B-Diffusers.json @@ -330,6 +330,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -345,6 +349,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -437,14 +442,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-14B-480P-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-14B-480P-Diffusers.json index ca5b98e9b..fd838b585 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-14B-480P-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.1-T2V-14B-480P-Diffusers.json @@ -330,6 +330,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -345,6 +349,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -437,14 +442,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-Diffusers.json index 3a0449d16..af80dba75 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-Diffusers.json @@ -331,6 +331,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -346,6 +350,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -438,14 +443,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-FullAttn-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-FullAttn-Diffusers.json index ea5a95ce4..012eda106 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-FullAttn-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__FastWan2.2-TI2V-5B-FullAttn-Diffusers.json @@ -331,6 +331,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -346,6 +350,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -438,14 +443,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__GEN3C-Cosmos-7B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__GEN3C-Cosmos-7B-Diffusers.json index 2091e2a58..0a669ad86 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__GEN3C-Cosmos-7B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__GEN3C-Cosmos-7B-Diffusers.json @@ -352,6 +352,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -367,6 +371,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -455,14 +460,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HY-WorldPlay-Bidirectional-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HY-WorldPlay-Bidirectional-Diffusers.json index 16f95f503..4184182c9 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HY-WorldPlay-Bidirectional-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HY-WorldPlay-Bidirectional-Diffusers.json @@ -406,6 +406,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -421,6 +425,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -510,14 +515,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HunyuanGameCraft-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HunyuanGameCraft-Diffusers.json index c0b142562..b87c98eb4 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HunyuanGameCraft-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__HunyuanGameCraft-Diffusers.json @@ -359,6 +359,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -374,6 +378,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -463,14 +468,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX-2.3-Distilled-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX-2.3-Distilled-Diffusers.json index e5c451cf2..f4e9473d0 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX-2.3-Distilled-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX-2.3-Distilled-Diffusers.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Diffusers.json index 045ac0f16..49dc1242e 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Diffusers.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Distilled-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Distilled-Diffusers.json index 542e8b142..ed65b43e6 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Distilled-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-Distilled-Diffusers.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-base.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-base.json index 467ea4046..ceff7624c 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-base.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2-base.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Diffusers.json index 65aa2531d..2b446a479 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Diffusers.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Distilled-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Distilled-Diffusers.json index 7f137d333..7a0e1dce4 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Distilled-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-Distilled-Diffusers.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-base.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-base.json index 646d47dbd..2480240c0 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-base.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LTX2.3-base.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-Dense-1.3B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-Dense-1.3B-Diffusers.json index 881abde1a..e51e5d3e1 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-Dense-1.3B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-Dense-1.3B-Diffusers.json @@ -328,6 +328,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -343,6 +347,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -431,14 +436,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-MoE-30B-A3B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-MoE-30B-A3B-Diffusers.json index 959eaa915..bf6fbfede 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-MoE-30B-A3B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-Video-MoE-30B-A3B-Diffusers.json @@ -328,6 +328,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -343,6 +347,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -431,14 +436,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-World-Base-Cam-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-World-Base-Cam-Diffusers.json index 3c6cf14e5..611cf9a1f 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-World-Base-Cam-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LingBot-World-Base-Cam-Diffusers.json @@ -352,6 +352,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -367,6 +371,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -455,14 +460,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-I2V-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-I2V-Diffusers.json index edd469360..871d41159 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-I2V-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-I2V-Diffusers.json @@ -320,6 +320,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -335,6 +339,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -423,14 +428,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-T2V-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-T2V-Diffusers.json index fc705e946..566f4af18 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-T2V-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-T2V-Diffusers.json @@ -320,6 +320,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -335,6 +339,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -423,14 +428,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-VC-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-VC-Diffusers.json index aaa0c9b8f..422b13519 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-VC-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__LongCat-Video-VC-Diffusers.json @@ -320,6 +320,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -335,6 +339,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -423,14 +428,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__MMAudio-large-44k-v2-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__MMAudio-large-44k-v2-Diffusers.json index 1d05b442f..bd6153dc6 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__MMAudio-large-44k-v2-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__MMAudio-large-44k-v2-Diffusers.json @@ -348,6 +348,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -363,6 +367,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -451,14 +456,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Diffusers.json index 2ae3d53ac..85fec65cf 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Diffusers.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Distilled-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Distilled-Diffusers.json index c5dbffcd5..4dfbd2343 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Distilled-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-Base-Distilled-Diffusers.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Diffusers.json index 8e465cae2..4f7c18811 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Diffusers.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Distilled-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Distilled-Diffusers.json index 8c01801e8..ea3c04958 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Distilled-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-GTA-Distilled-Diffusers.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Diffusers.json index e08371157..21ca3ffe4 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Diffusers.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Distilled-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Distilled-Diffusers.json index 2470cdf5b..7be07eb3d 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Distilled-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-2.0-TempleRun-Distilled-Diffusers.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-3.0-Base-Distilled-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-3.0-Base-Distilled-Diffusers.json index e84a971c9..46f85ff19 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-3.0-Base-Distilled-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Matrix-Game-3.0-Base-Distilled-Diffusers.json @@ -374,6 +374,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -389,6 +393,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -477,14 +482,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__SFWan2.2-I2V-A14B-Preview-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__SFWan2.2-I2V-A14B-Preview-Diffusers.json index d51f0b9af..fda2025e1 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__SFWan2.2-I2V-A14B-Preview-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__SFWan2.2-I2V-A14B-Preview-Diffusers.json @@ -341,6 +341,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -356,6 +360,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -453,14 +458,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Wan2.1-VSA-T2V-14B-720P-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Wan2.1-VSA-T2V-14B-720P-Diffusers.json index f58847010..f69f39243 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Wan2.1-VSA-T2V-14B-720P-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__Wan2.1-VSA-T2V-14B-720P-Diffusers.json @@ -321,6 +321,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +340,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -424,14 +429,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-1.0-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-1.0-Diffusers.json index 0fa19ee71..040a27692 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-1.0-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-1.0-Diffusers.json @@ -176,6 +176,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -191,6 +195,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -277,14 +282,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-small-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-small-Diffusers.json index f6cb88cb1..a6a88b747 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-small-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/FastVideo__stable-audio-open-small-Diffusers.json @@ -176,6 +176,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -191,6 +195,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -277,14 +282,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/IRMChen__Wan2.1-Fun-1.3B-Control-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/IRMChen__Wan2.1-Fun-1.3B-Control-Diffusers.json index 066c69951..5ab398873 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/IRMChen__Wan2.1-Fun-1.3B-Control-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/IRMChen__Wan2.1-Fun-1.3B-Control-Diffusers.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -370,6 +374,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/KyleShao__Cosmos-Predict2.5-2B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/KyleShao__Cosmos-Predict2.5-2B-Diffusers.json index 10f29036f..97bd7380c 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/KyleShao__Cosmos-Predict2.5-2B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/KyleShao__Cosmos-Predict2.5-2B-Diffusers.json @@ -317,6 +317,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -332,6 +336,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -420,14 +425,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.3.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.3.json index 1d44b0348..205d580ac 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.3.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.3.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.json index 5a15b4c6d..bcfb8ed90 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Lightricks__LTX-2.json @@ -300,6 +300,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -315,6 +319,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -403,14 +408,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/MiniMaxAI__MiniMax-H3.json b/fastvideo/tests/api/config_snapshot_goldens/registry/MiniMaxAI__MiniMax-H3.json index ba0d99d61..12036c38b 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/MiniMaxAI__MiniMax-H3.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/MiniMaxAI__MiniMax-H3.json @@ -429,6 +429,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -444,6 +448,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -532,14 +537,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Tongyi-MAI__Z-Image-Turbo.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Tongyi-MAI__Z-Image-Turbo.json index 6b064fa6b..3562b819f 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Tongyi-MAI__Z-Image-Turbo.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Tongyi-MAI__Z-Image-Turbo.json @@ -281,6 +281,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -296,6 +300,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -384,14 +389,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-480P-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-480P-Diffusers.json index 6a7bb64fa..93dec675d 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-480P-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-480P-Diffusers.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -370,6 +374,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-720P-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-720P-Diffusers.json index 22cddd381..c0df23ccd 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-720P-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-I2V-14B-720P-Diffusers.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -370,6 +374,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-1.3B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-1.3B-Diffusers.json index 208dc635c..7ec546182 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-1.3B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-1.3B-Diffusers.json @@ -321,6 +321,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +340,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -424,14 +429,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-14B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-14B-Diffusers.json index 01ebf35ce..deab0d45f 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-14B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.1-T2V-14B-Diffusers.json @@ -321,6 +321,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -336,6 +340,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -424,14 +429,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-I2V-A14B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-I2V-A14B-Diffusers.json index 966fac4db..cc844423a 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-I2V-A14B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-I2V-A14B-Diffusers.json @@ -356,6 +356,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -371,6 +375,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -459,14 +464,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-T2V-A14B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-T2V-A14B-Diffusers.json index 64315414d..85dd28973 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-T2V-A14B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-T2V-A14B-Diffusers.json @@ -333,6 +333,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -348,6 +352,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -441,14 +446,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-TI2V-5B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-TI2V-5B-Diffusers.json index 80321a01a..465969dbc 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-TI2V-5B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/Wan-AI__Wan2.2-TI2V-5B-Diffusers.json @@ -322,6 +322,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -337,6 +341,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -425,14 +430,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.1-dev.json b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.1-dev.json index 906166db6..86a9f5bdb 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.1-dev.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.1-dev.json @@ -341,6 +341,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -356,6 +360,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -445,14 +450,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-dev.json b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-dev.json index 6c1b4d49f..9d40afc9a 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-dev.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-dev.json @@ -249,6 +249,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -264,6 +268,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -352,14 +357,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-4B.json b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-4B.json index a589de4d0..6a76c2faf 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-4B.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-4B.json @@ -286,6 +286,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -301,6 +305,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -389,14 +394,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-9B.json b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-9B.json index c6480c185..d5cbe5678 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-9B.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/black-forest-labs__FLUX.2-klein-9B.json @@ -286,6 +286,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -301,6 +305,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -389,14 +394,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-1.1-Dev.json b/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-1.1-Dev.json index 982a44096..3ffc26329 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-1.1-Dev.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-1.1-Dev.json @@ -386,6 +386,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -401,6 +405,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -489,14 +494,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-Dev.json b/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-Dev.json index 5512b8d66..6be7b3131 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-Dev.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/decart-ai__Lucy-Edit-Dev.json @@ -386,6 +386,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -401,6 +405,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -489,14 +494,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_i2v_step_distilled.json b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_i2v_step_distilled.json index 403a8016d..c56c41ffd 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_i2v_step_distilled.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_i2v_step_distilled.json @@ -358,6 +358,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -373,6 +377,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -462,14 +467,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_t2v.json b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_t2v.json index b9335f0b4..bbbd67877 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_t2v.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-480p_t2v.json @@ -358,6 +358,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -373,6 +377,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -462,14 +467,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_i2v_distilled.json b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_i2v_distilled.json index 8f4e5e998..aa1421801 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_i2v_distilled.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_i2v_distilled.json @@ -358,6 +358,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -373,6 +377,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -462,14 +467,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_t2v.json b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_t2v.json index 8cdc905d1..319f4e025 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_t2v.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo-1.5-Diffusers-720p_t2v.json @@ -358,6 +358,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -373,6 +377,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -462,14 +467,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo.json b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo.json index 6252832a5..b89f5dc24 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/hunyuanvideo-community__HunyuanVideo.json @@ -349,6 +349,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -364,6 +368,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -453,14 +458,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Lite-5s-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Lite-5s-Diffusers.json index 24e59d4e5..7fb27721f 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Lite-5s-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Lite-5s-Diffusers.json @@ -354,6 +354,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -369,6 +373,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-distilled-5s-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-distilled-5s-Diffusers.json index 7a745ceee..69d5ae039 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-distilled-5s-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-distilled-5s-Diffusers.json @@ -354,6 +354,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -369,6 +373,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-sft-5s-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-sft-5s-Diffusers.json index 7d5abb656..1ff540278 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-sft-5s-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-I2V-Pro-sft-5s-Diffusers.json @@ -354,6 +354,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -369,6 +373,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers.json index 63b65a3dd..94c7c87c9 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers.json @@ -354,6 +354,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -369,6 +373,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers.json index 526910329..22ad48950 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers.json @@ -354,6 +354,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -369,6 +373,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-distilled-5s-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-distilled-5s-Diffusers.json index fa39de173..de085a957 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-distilled-5s-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-distilled-5s-Diffusers.json @@ -354,6 +354,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -369,6 +373,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-sft-5s-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-sft-5s-Diffusers.json index a002e881b..ba5e2dd9f 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-sft-5s-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/kandinskylab__Kandinsky-5.0-T2V-Pro-sft-5s-Diffusers.json @@ -354,6 +354,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -369,6 +373,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-1.3B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-1.3B-Diffusers.json index 70680d01a..71f57bbcb 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-1.3B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-1.3B-Diffusers.json @@ -320,6 +320,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -335,6 +339,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -423,14 +428,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-14B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-14B-Diffusers.json index 29dce7714..bcd9138de 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-14B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.1-T2V-14B-Diffusers.json @@ -320,6 +320,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -335,6 +339,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -423,14 +428,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.2-I2V-A14B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.2-I2V-A14B-Diffusers.json index 961666ad5..2b719bd82 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.2-I2V-A14B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/loayrashid__TurboWan2.2-I2V-A14B-Diffusers.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -370,6 +374,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_bidirectional_zelda.json b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_bidirectional_zelda.json index 88b4c8302..b52fabf0a 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_bidirectional_zelda.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_bidirectional_zelda.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_causal_zelda.json b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_causal_zelda.json index e5bf63cf3..f7c95eaa2 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_causal_zelda.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_causal_zelda.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_longtuning_distilled_zelda.json b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_longtuning_distilled_zelda.json index 7bf39331c..1e515289a 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_longtuning_distilled_zelda.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_longtuning_distilled_zelda.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda.json b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda.json index 312d82193..83a4b929c 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda_1k_steps.json b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda_1k_steps.json index 637e6e81a..05b1886b3 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda_1k_steps.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/mignonjia__mg_sf_distilled_zelda_1k_steps.json @@ -415,6 +415,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -430,6 +434,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -522,14 +527,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2-2B-Video2World.json b/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2-2B-Video2World.json index 3ac3dc945..929869c18 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2-2B-Video2World.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2-2B-Video2World.json @@ -324,6 +324,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -339,6 +343,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -427,14 +432,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2.5-14B.json b/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2.5-14B.json index 9d23f6898..1fc254a83 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2.5-14B.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/nvidia__Cosmos-Predict2.5-14B.json @@ -317,6 +317,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -332,6 +336,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -420,14 +425,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/rand0nmr__SFWan2.2-T2V-A14B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/rand0nmr__SFWan2.2-T2V-A14B-Diffusers.json index 94e567d11..161db9c7f 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/rand0nmr__SFWan2.2-T2V-A14B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/rand0nmr__SFWan2.2-T2V-A14B-Diffusers.json @@ -341,6 +341,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -356,6 +360,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -453,14 +458,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/robbyant__lingbot-world-v2-14b-causal-fast.json b/fastvideo/tests/api/config_snapshot_goldens/registry/robbyant__lingbot-world-v2-14b-causal-fast.json index 809676afe..46498e45a 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/robbyant__lingbot-world-v2-14b-causal-fast.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/robbyant__lingbot-world-v2-14b-causal-fast.json @@ -331,6 +331,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -346,6 +350,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -434,14 +439,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/stabilityai__stable-diffusion-3.5-medium.json b/fastvideo/tests/api/config_snapshot_goldens/registry/stabilityai__stable-diffusion-3.5-medium.json index e0e410858..056ad8573 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/stabilityai__stable-diffusion-3.5-medium.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/stabilityai__stable-diffusion-3.5-medium.json @@ -424,6 +424,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -439,6 +443,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -529,14 +534,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p-2SR.json b/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p-2SR.json index 8e405d214..d916c6e97 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p-2SR.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p-2SR.json @@ -379,6 +379,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -394,6 +398,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -483,14 +488,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p.json b/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p.json index b2d7b807e..3a4094931 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__HunyuanVideo-1.5-Diffusers-1080p.json @@ -379,6 +379,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -394,6 +398,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -483,14 +488,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__Wan2.1-Fun-1.3B-InP-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__Wan2.1-Fun-1.3B-InP-Diffusers.json index 5edc39991..be88f6bff 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__Wan2.1-Fun-1.3B-InP-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/weizhou03__Wan2.1-Fun-1.3B-InP-Diffusers.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -370,6 +374,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -458,14 +463,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/wlsaidhi__SFWan2.1-T2V-1.3B-Diffusers.json b/fastvideo/tests/api/config_snapshot_goldens/registry/wlsaidhi__SFWan2.1-T2V-1.3B-Diffusers.json index adbc5c742..bc63b1bf6 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/wlsaidhi__SFWan2.1-T2V-1.3B-Diffusers.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/wlsaidhi__SFWan2.1-T2V-1.3B-Diffusers.json @@ -332,6 +332,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -347,6 +351,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -440,14 +445,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/registry/zai-org__GLM-Image.json b/fastvideo/tests/api/config_snapshot_goldens/registry/zai-org__GLM-Image.json index 33806d453..3463821c3 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/registry/zai-org__GLM-Image.json +++ b/fastvideo/tests/api/config_snapshot_goldens/registry/zai-org__GLM-Image.json @@ -310,6 +310,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -325,6 +329,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -413,14 +418,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/apps__dreamverse__serve_configs__streaming_demo.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/apps__dreamverse__serve_configs__streaming_demo.yaml.json index 50d8ec181..ffcc68dcf 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/apps__dreamverse__serve_configs__streaming_demo.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/apps__dreamverse__serve_configs__streaming_demo.yaml.json @@ -332,6 +332,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1024x1536.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1024x1536.yaml.json index d234fc488..c414cf164 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1024x1536.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1024x1536.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1280x832.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1280x832.yaml.json index 14687404c..6cf9e820b 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1280x832.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_1280x832.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_512x768.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_512x768.yaml.json index 26b44f2fd..6b452ac62 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_512x768.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_512x768.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_768x1280.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_768x1280.yaml.json index 3e9a96c74..1aa0cfff6 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_768x1280.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_5s2_768x1280.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1024x1536.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1024x1536.yaml.json index e488c0900..a29edc88a 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1024x1536.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1024x1536.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1280x832.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1280x832.yaml.json index f95532959..35dce8891 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1280x832.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_1280x832.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_512x768.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_512x768.yaml.json index bbeee04bd..3bdf1e62e 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_512x768.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_512x768.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_768x1280.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_768x1280.yaml.json index c33d20319..438db02c0 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_768x1280.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__i2v_8s3_768x1280.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1024x1536.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1024x1536.yaml.json index c2fe17b64..a2421e7ab 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1024x1536.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1024x1536.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1280x832.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1280x832.yaml.json index 4dfbd800a..79ebe7d9b 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1280x832.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_1280x832.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_512x768.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_512x768.yaml.json index 2436c2b2d..ab6a29ad5 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_512x768.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_512x768.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_768x1280.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_768x1280.yaml.json index 0826a2c9c..3e099b4fc 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_768x1280.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_5s2_768x1280.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1024x1536.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1024x1536.yaml.json index d73d1384d..b326307d0 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1024x1536.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1024x1536.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1280x832.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1280x832.yaml.json index 8f66b0e9b..0c1f6145b 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1280x832.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_1280x832.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_512x768.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_512x768.yaml.json index b9f2fccd1..412fc02bf 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_512x768.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_512x768.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_768x1280.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_768x1280.yaml.json index 365c199ce..18f1ff7bb 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_768x1280.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__inference__ltx2_3__t2v_8s3_768x1280.yaml.json @@ -334,6 +334,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3.yaml.json index 13446a56b..e0bcba996 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3.yaml.json @@ -427,6 +427,10 @@ "engine.compile.audio_vae_enabled": false, "engine.compile.text_encoder_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_encode": false, @@ -440,6 +444,7 @@ "backend": "VIDEO_SPARSE_ATTN_H3", "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.9, "vsa_tile_size": 64 }, @@ -528,14 +533,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_8step.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_8step.yaml.json index ee9de467c..8aa74e152 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_8step.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_8step.yaml.json @@ -427,6 +427,10 @@ "engine.compile.audio_vae_enabled": false, "engine.compile.text_encoder_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_encode": false, @@ -440,6 +444,7 @@ "backend": "VIDEO_SPARSE_ATTN_H3", "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.8, "vsa_tile_size": 64 }, @@ -528,14 +533,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_lora.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_lora.yaml.json index 31797eadb..dc4b42289 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_lora.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fasth3_lora.yaml.json @@ -429,6 +429,10 @@ "engine.compile.audio_vae_enabled": false, "engine.compile.text_encoder_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_encode": false, @@ -442,6 +446,7 @@ "backend": "FLASH_ATTN", "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -530,14 +535,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fastwan21_1_3b.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fastwan21_1_3b.yaml.json index fbab8de3b..fca1fb729 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fastwan21_1_3b.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_fastwan21_1_3b.yaml.json @@ -333,6 +333,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -348,6 +352,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.8, "vsa_tile_size": 256 }, @@ -440,14 +445,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan21_i2v_14b.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan21_i2v_14b.yaml.json index ee854032f..677d029cb 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan21_i2v_14b.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan21_i2v_14b.yaml.json @@ -362,6 +362,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -376,6 +380,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -464,14 +469,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_t2v_a14b.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_t2v_a14b.yaml.json index d69de2a97..5b9e0ddc7 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_t2v_a14b.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_t2v_a14b.yaml.json @@ -345,6 +345,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -360,6 +364,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -453,14 +458,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_ti2v_5b.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_ti2v_5b.yaml.json index 8e3bd0e1c..ae324b2ec 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_ti2v_5b.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__openai_wan22_ti2v_5b.yaml.json @@ -333,6 +333,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -348,6 +352,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -436,14 +441,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__streaming_demo.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__streaming_demo.yaml.json index 50d8ec181..ffcc68dcf 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__streaming_demo.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/examples__serving__streaming_demo.yaml.json @@ -332,6 +332,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_fasthunyuan.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_fasthunyuan.yaml.json index 1db667365..d7a95be4f 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_fasthunyuan.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_fasthunyuan.yaml.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -370,6 +374,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -459,14 +464,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_flux2_klein.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_flux2_klein.yaml.json index 1d4f9f46f..02e9c04d8 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_flux2_klein.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_flux2_klein.yaml.json @@ -297,6 +297,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -311,6 +315,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -399,14 +404,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_hunyuan.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_hunyuan.yaml.json index 83fae4dd2..89dbe1d70 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_hunyuan.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_hunyuan.yaml.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -370,6 +374,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -459,14 +464,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat.yaml.json index 5b7759b51..2a379d447 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat.yaml.json @@ -327,6 +327,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -342,6 +346,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -430,14 +435,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_distill.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_distill.yaml.json index 5e0e31a72..e037ff0da 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_distill.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_distill.yaml.json @@ -327,6 +327,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -342,6 +346,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -430,14 +435,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_i2v.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_i2v.yaml.json index b92b7033a..48a585a33 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_i2v.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_i2v.yaml.json @@ -327,6 +327,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -341,6 +345,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -429,14 +434,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_refine_fromvideo.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_refine_fromvideo.yaml.json index c9829f3ff..58f2618db 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_refine_fromvideo.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_refine_fromvideo.yaml.json @@ -336,6 +336,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -351,6 +355,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -447,14 +452,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_vc.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_vc.yaml.json index 4c86455e4..c66037170 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_vc.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_longcat_vc.yaml.json @@ -327,6 +327,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -342,6 +346,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -430,14 +435,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan.yaml.json index 4c29997fc..9e680c3f8 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan.yaml.json @@ -328,6 +328,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -343,6 +347,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -431,14 +436,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_1.3B_VMoba.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_1.3B_VMoba.yaml.json index 0b1c1bbdf..ec8622dc4 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_1.3B_VMoba.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_1.3B_VMoba.yaml.json @@ -355,6 +355,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -392,6 +396,7 @@ "temporal_topk": 3 }, "moba_config_path": "fastvideo/configs/backend/vmoba/wan_1.3B_77_480_832.json", + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -480,14 +485,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA.yaml.json index dc2b1d906..e7b302bba 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA.yaml.json @@ -327,6 +327,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -342,6 +346,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.9, "vsa_tile_size": 256 }, @@ -430,14 +435,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_480P.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_480P.yaml.json index 8b3b30303..9d7bcbcf8 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_480P.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_480P.yaml.json @@ -333,6 +333,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -348,6 +352,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.9, "vsa_tile_size": 256 }, @@ -440,14 +445,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_720P.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_720P.yaml.json index 4ca024395..b9d13e5ce 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_720P.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_14B_720P.yaml.json @@ -333,6 +333,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -348,6 +352,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.9, "vsa_tile_size": 256 }, @@ -440,14 +445,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_1_3B.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_1_3B.yaml.json index 6606d5dfa..6edbb77a5 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_1_3B.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_1_3B.yaml.json @@ -333,6 +333,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -348,6 +352,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.8, "vsa_tile_size": 256 }, @@ -440,14 +445,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_5B_720P.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_5B_720P.yaml.json index 68a5e8e1b..13974826e 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_5B_720P.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_VSA_DMD_5B_720P.yaml.json @@ -335,6 +335,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -350,6 +354,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -442,14 +447,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_i2v.yaml.json b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_i2v.yaml.json index b835a35f4..97c5a1a32 100644 --- a/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_i2v.yaml.json +++ b/fastvideo/tests/api/config_snapshot_goldens/yaml/scripts__inference__inference_wan_i2v.yaml.json @@ -362,6 +362,10 @@ "engine.compile.text_encoder_enabled": false, "engine.compile.vae_enabled": false, "pipeline.ltx2.legacy_native_noise_order": false, + "pipeline.ltx2.refine.add_noise": true, + "pipeline.ltx2.refine.enabled": false, + "pipeline.ltx2.refine.guidance_scale": 1.0, + "pipeline.ltx2.refine.num_inference_steps": 3, "pipeline.ltx2.use_distilled_sigmas": true, "pipeline.minimax_h3.taeh3_chunk_size": 5, "pipeline.minimax_h3.vae_parallel_decode": false, @@ -376,6 +380,7 @@ "backend": null, "moba_config": {}, "moba_config_path": null, + "nvfp4_fa4": false, "vsa_sparsity": 0.0, "vsa_tile_size": 256 }, @@ -464,14 +469,14 @@ "initial_latent_path": null, "legacy_native_noise_order": false, "refine": { - "add_noise": null, + "add_noise": true, "audio_noise_path": null, - "enabled": null, - "guidance_scale": null, + "enabled": false, + "guidance_scale": 1.0, "image_crf": null, "lora_path": null, "noise_path": null, - "num_inference_steps": null, + "num_inference_steps": 3, "transformer_path": null, "video_position_offset_sec": null }, diff --git a/fastvideo/tests/api/test_compat_translation.py b/fastvideo/tests/api/test_compat_translation.py index 5eafffb38..4e66cbe06 100644 --- a/fastvideo/tests/api/test_compat_translation.py +++ b/fastvideo/tests/api/test_compat_translation.py @@ -1,52 +1,16 @@ # SPDX-License-Identifier: Apache-2.0 -"""Tests for the ``fastvideo.api.compat`` keyword and request helpers, and -for how resolution carries the typed CompileConfig and -PipelineSelection.vae_tiling surfaces promoted in PR 6. +"""Tests for the ``fastvideo.api.compat`` request helpers, and for how resolution carries the typed CompileConfig +and PipelineSelection.vae_tiling surfaces. """ from __future__ import annotations -import pytest - -from fastvideo.api.compat import ( - FROM_PRETRAINED_KWARGS, - _FROM_PRETRAINED_FIELDS, - from_pretrained_kwargs_to_config, - request_to_sampling_param, -) +from fastvideo.api.compat import request_to_sampling_param from fastvideo.api.inference_resolution import resolve_inference_config, torch_compile_kwargs from fastvideo.api.parser import parse_config from fastvideo.api.schema import CompileConfig, GenerationRequest, GeneratorConfig from fastvideo.api.sampling_param import SamplingParam -class TestFromPretrainedKwargsTranslation: - """The ``from_pretrained`` keyword ``torch_compile_kwargs={...}`` gets - split across the four first-class :class:`CompileConfig` fields and - anything unknown falls into ``extras``. Keywords outside the - ``from_pretrained`` set are rejected.""" - - def test_empty_kwargs_produces_empty_extras(self) -> None: - config = from_pretrained_kwargs_to_config( - "/models/ltx2", - {"torch_compile_kwargs": {}}, - ) - compile_config = config.engine.compile - assert compile_config.extras == {} - assert compile_config.backend is None - - def test_other_keyword_points_to_from_config(self) -> None: - with pytest.raises(TypeError, match=r"does not accept ltx2_vae_tiling\. It accepts only these keywords: " - r"(.|\n)*VideoGenerator\.from_config"): - from_pretrained_kwargs_to_config("/models/ltx2", {"ltx2_vae_tiling": True}) - - def test_keyword_fields_are_the_from_pretrained_keywords(self) -> None: - """Every keyword with a schema field sets one field; ``torch_compile_kwargs`` and ``nvfp4_fa4`` have none.""" - assert set(_FROM_PRETRAINED_FIELDS) == FROM_PRETRAINED_KWARGS - {"torch_compile_kwargs", "nvfp4_fa4"} - assert len(set(_FROM_PRETRAINED_FIELDS.values())) == len(_FROM_PRETRAINED_FIELDS) - config = from_pretrained_kwargs_to_config("/models/wan", {"dit_cpu_offload": False, "sp_size": 2}) - assert config.engine.offload.dit is False and config.engine.parallelism.sp_size == 2 - - class TestCompileConfigRoundTrip: """typed CompileConfig -> ``torch_compile_kwargs(resolved_config)`` reconstruction drops ``None`` typed fields and merges ``extras``.""" diff --git a/fastvideo/tests/api/test_inference_resolution_steps.py b/fastvideo/tests/api/test_inference_resolution_steps.py index a3e108a0e..b7f6a7893 100644 --- a/fastvideo/tests/api/test_inference_resolution_steps.py +++ b/fastvideo/tests/api/test_inference_resolution_steps.py @@ -110,16 +110,23 @@ def test_environment_takes_precedence_over_model_defaults(): "fill_vae_parallel_from_env", "fill_pipeline_config_defaults[WanT2V480PConfig]", "copy_refine_preset_overrides", + "fill_ltx2_refine_from_checkpoint", + "fill_dmd_schedule_from_checkpoint", "derive_parallel_sizes", "derive_vae_tiling_from_ltx2_tile_sizes", "fill_vae_tiling_default[WanT2V480PConfig]", "load_moba_config", + "apply_unified_memory_offload_policy", + "fill_lazy_module_load", + "apply_mps_offload_policy", + "apply_layerwise_offload_conflicts", "validate_unsupported_fields", "validate_experimental_keys", "validate_lora_strength", "validate_attention_backend", "validate_vae_parallel_decode_strategy", "warn_deprecated_environment_variables", + "apply_nvfp4_fa4_env", "validate_parallel_sizes", "derive_num_gpus_from_parallel_sizes", "fill_runtime_defaults", diff --git a/fastvideo/tests/api/test_ltx2_gpu_pool_translation.py b/fastvideo/tests/api/test_ltx2_gpu_pool_translation.py index 15007acd0..20ea7ee53 100644 --- a/fastvideo/tests/api/test_ltx2_gpu_pool_translation.py +++ b/fastvideo/tests/api/test_ltx2_gpu_pool_translation.py @@ -9,7 +9,7 @@ from __future__ import annotations import pytest -from fastvideo.api.compat import from_pretrained_kwargs_to_config +from fastvideo.api.compat import normalize_generator_config from fastvideo.api.inference_resolution import resolve_inference_config, torch_compile_kwargs from fastvideo.tests.api.config_snapshot import isolated_environment @@ -144,17 +144,21 @@ class TestCompileExtrasPreserved: round-trip through ``CompileConfig.extras``.""" def test_extras_preserved(self) -> None: - kwargs = { - "enable_torch_compile": True, - "torch_compile_kwargs": { - "backend": "inductor", - "options": { - "triton.cudagraphs": False - }, - "disable": False, + config = normalize_generator_config({ + "model_path": "FastVideo/LTX2-Distilled-Diffusers", + "engine": { + "compile": { + "enabled": True, + "backend": "inductor", + "extras": { + "options": { + "triton.cudagraphs": False + }, + "disable": False, + }, + } }, - } - config = from_pretrained_kwargs_to_config("FastVideo/LTX2-Distilled-Diffusers", kwargs) + }) assert config.engine.compile.backend == "inductor" assert config.engine.compile.extras == { "options": { diff --git a/fastvideo/tests/api/test_parser.py b/fastvideo/tests/api/test_parser.py index 854df3743..be34ae502 100644 --- a/fastvideo/tests/api/test_parser.py +++ b/fastvideo/tests/api/test_parser.py @@ -140,6 +140,7 @@ def test_load_run_config_supports_yaml_roundtrip(tmp_path) -> None: "vsa_tile_size": None, "moba_config_path": None, "moba_config": None, + "nvfp4_fa4": False, }, "precision": { "dit": None, diff --git a/fastvideo/tests/api/test_resolved_runtime_config.py b/fastvideo/tests/api/test_resolved_runtime_config.py index bc5fe59a8..68d0438cf 100644 --- a/fastvideo/tests/api/test_resolved_runtime_config.py +++ b/fastvideo/tests/api/test_resolved_runtime_config.py @@ -6,6 +6,7 @@ import json import pickle from contextlib import nullcontext from types import SimpleNamespace +from unittest.mock import patch import pytest import torch @@ -20,8 +21,6 @@ from fastvideo.api.training_schema import (PreprocessRunConfig, TrainingRunConfi from fastvideo.tests.api.config_snapshot import isolated_environment WAN_T2V = "Wan-AI/Wan2.1-T2V-1.3B-Diffusers" -LTX2 = "FastVideo/LTX2-Distilled-Diffusers" -FASTH3 = "FastVideo/FastVideo-FastH3-8-Step-V2" def _resolve(raw, env_values=None): @@ -29,6 +28,12 @@ def _resolve(raw, env_values=None): return resolve_inference_config(raw) +def _resolve_with_device_policy(raw): + """Resolve inside the isolation with the device-policy steps on, which the isolation turns off like downloads.""" + with isolated_environment(), patch.object(device_policy, "APPLY_DEVICE_POLICY", True): + return resolve_inference_config(raw) + + def test_resolution_builds_and_freezes_the_pipeline_config_once(monkeypatch): from fastvideo.configs.pipelines.base import PipelineConfig @@ -100,46 +105,56 @@ def test_override_of_a_typed_home_leaves_the_pipeline_config_unchanged(): assert overridden.provenance("pipeline.dmd_denoising_steps").source == "checkpoint:test" -def test_unified_memory_policy_returns_recorded_overrides_once(monkeypatch): - resolved = _resolve({"model_path": WAN_T2V, "engine": {"offload": {"dit_layerwise": False}}}) - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: device_id == 1) +def test_unified_memory_policy_is_decided_during_resolution(monkeypatch): + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: True) monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) - decided = device_policy.finalize_device_offload_policy(resolved, 1) - again = device_policy.finalize_device_offload_policy(decided, 1) + resolved = _resolve_with_device_policy({"model_path": WAN_T2V, "engine": {"offload": {"dit_layerwise": False}}}) - assert [source for source, _ in decided.override_log] == [ - "device_policy:unified_memory", - "device_policy:lazy_module_load", + device_decisions = [(source, values) for source, values in resolved.decisions + if source in ("apply_unified_memory_offload_policy", "fill_lazy_module_load")] + assert device_decisions == [ + ("apply_unified_memory_offload_policy", { + "engine.offload.dit": False, + "engine.offload.text_encoder": False, + "engine.offload.image_encoder": False, + "engine.offload.vae": False, + }), + ("fill_lazy_module_load", { + "engine.offload.lazy_module_load": True + }), ] - assert decided.override_log[0][1] == { + assert resolved.engine.offload.lazy_module_load is True and resolved.engine.offload.dit is False + assert resolved.override_log == () + assert resolved.provenance("engine.offload.dit").raw_value is True + + +def test_discrete_device_leaves_offload_requests_and_turns_lazy_module_load_off(monkeypatch): + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: False) + monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) + + resolved = _resolve_with_device_policy({"model_path": WAN_T2V, "engine": {"offload": {"dit_layerwise": False}}}) + + assert resolved.engine.offload.dit is True and resolved.engine.offload.text_encoder is True + assert resolved.engine.offload.lazy_module_load is False + assert resolved.provenance("engine.offload.lazy_module_load").source == "fill_lazy_module_load" + + +def test_layerwise_offload_turns_off_conflicting_modes(monkeypatch): + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: False) + monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) + + resolved = _resolve_with_device_policy({"model_path": WAN_T2V, "engine": {"use_fsdp_inference": True}}) + + assert [values for source, values in resolved.decisions if source == "apply_layerwise_offload_conflicts"] == [{ + "engine.use_fsdp_inference": False, "engine.offload.dit": False, - "engine.offload.text_encoder": False, - "engine.offload.image_encoder": False, - "engine.offload.vae": False, - } - assert decided.engine.offload.lazy_module_load is True and decided.engine.offload.dit is False - assert again.override_log == decided.override_log - assert resolved.override_log == () and resolved.engine.offload.dit is True - assert device_policy.offload_disabled_on_unified_memory(1, "text_encoder_cpu_offload") - assert not device_policy.offload_disabled_on_unified_memory(0, "text_encoder_cpu_offload") - assert device_policy.finalize_device_offload_policy(resolved, 0).engine.offload.lazy_module_load is False - - -def test_layerwise_offload_turns_off_conflicting_modes(): - resolved = _resolve({"model_path": WAN_T2V, "engine": {"use_fsdp_inference": True}}) - - decided = device_policy.resolve_device_offload_conflicts(resolved) - - assert [values for _, values in decided.override_log] == [{ - "engine.use_fsdp_inference": False - }, { - "engine.offload.dit": False }] + assert resolved.engine.use_fsdp_inference is False and resolved.engine.offload.dit is False -def test_direct_pipeline_keeps_the_policy_result_of_a_resolved_config(monkeypatch): +def test_direct_pipeline_keeps_the_resolved_config(monkeypatch): import fastvideo.pipelines.composed_pipeline_base as composed_pipeline_base from fastvideo.pipelines.composed_pipeline_base import ComposedPipelineBase @@ -159,14 +174,14 @@ def test_direct_pipeline_keeps_the_policy_result_of_a_resolved_config(monkeypatc monkeypatch.setattr(composed_pipeline_base, "get_world_group", lambda: SimpleNamespace(local_rank=2)) monkeypatch.setattr(composed_pipeline_base, "get_or_create_profiler", lambda trace_dir: profiler) monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: True) + monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) - resolved = _resolve({"model_path": WAN_T2V}) + resolved = _resolve_with_device_policy({"model_path": WAN_T2V}) pipeline = _Pipeline("unused", resolved, required_config_modules=[]) - assert pipeline.resolved_config is pipeline.loaded_with - assert pipeline.resolved_config.engine.offload.lazy_module_load is True - assert resolved.engine.offload.lazy_module_load is None + assert pipeline.resolved_config is resolved and pipeline.loaded_with is resolved + assert resolved.engine.offload.lazy_module_load is True def test_pipeline_records_component_paths_and_shares_its_component_state(monkeypatch, tmp_path): @@ -255,40 +270,41 @@ def test_training_resolution_keeps_the_dit_on_the_device(): assert built["resolved_config"] is resolved -def test_ltx2_checkpoint_refine_defaults_rebind_the_pipeline_config(tmp_path): - from fastvideo.pipelines.basic.ltx2.ltx2_pipeline import LTX2Pipeline +def test_ltx2_checkpoint_refine_defaults_are_resolved_from_a_local_checkpoint(tmp_path): + (tmp_path / "transformer").mkdir() + (tmp_path / "model_index.json").write_text( + json.dumps({ + "_class_name": "LTX2Pipeline", + "_diffusers_version": "0", + "transformer": ["diffusers", "Model"], + "fastvideo_refine_lora_path": "FastVideo/LTX2-Distilled-LoRA", + "fastvideo_refine_num_inference_steps": 2, + })) - resolved = _resolve({"model_path": LTX2}) - pipeline = object.__new__(LTX2Pipeline) - pipeline.model_path = str(tmp_path) - pipeline.resolved_config = resolved - pipeline._required_config_modules = list(LTX2Pipeline._required_config_modules) - model_index = {name: ["diffusers", "Model"] for name in pipeline._required_config_modules} - pipeline._load_config = lambda model_path: { - "_class_name": "LTX2Pipeline", - "_diffusers_version": "0", - "fastvideo_refine_lora_path": "FastVideo/LTX2-Distilled-LoRA", - "fastvideo_refine_num_inference_steps": 2, - **model_index, - } + from fastvideo.pipelines.basic.ltx2.pipeline_configs import LTX2T2VConfig - pipeline.load_modules(resolved, {name: object() for name in model_index}) + resolved = _resolve({ + "model_path": str(tmp_path), + "pipeline": { + "experimental": { + "pipeline_config": LTX2T2VConfig() + } + } + }) - rebound = pipeline.resolved_config - assert rebound is not resolved - assert rebound.override_log == (("checkpoint:model_index.json", { + refine_decisions = [values for source, values in resolved.decisions if source == "fill_ltx2_refine_from_checkpoint"] + assert refine_decisions == [{ "pipeline.ltx2.refine.lora_path": "FastVideo/LTX2-Distilled-LoRA", "pipeline.ltx2.refine.num_inference_steps": 2, - "pipeline.ltx2.refine.enabled": False, - "pipeline.ltx2.refine.add_noise": True, - "pipeline.ltx2.refine.guidance_scale": 1.0, - }), ) - assert rebound.pipeline.ltx2.refine.lora_path == "FastVideo/LTX2-Distilled-LoRA" - assert rebound.pipeline.ltx2.refine.num_inference_steps == 2 - assert resolved.pipeline.ltx2.refine.num_inference_steps is None + }] + refine = resolved.pipeline.ltx2.refine + assert (refine.lora_path, refine.num_inference_steps) == ("FastVideo/LTX2-Distilled-LoRA", 2) + assert (refine.enabled, refine.add_noise, refine.guidance_scale) == (False, True, 1.0) + assert resolved.provenance("pipeline.ltx2.refine.enabled").source == "fill_runtime_defaults" -def test_minimax_h3_checkpoint_schedule_rebinds_and_reaches_the_first_forward(tmp_path, monkeypatch): +def test_minimax_h3_checkpoint_schedule_is_resolved_and_reaches_the_first_forward(tmp_path, monkeypatch): + from fastvideo.configs.pipelines.minimax_h3 import MiniMaxH3PipelineConfig from fastvideo.models.schedulers.scheduling_minimax_h3 import MiniMaxH3Scheduler from fastvideo.pipelines.basic.minimax_h3.minimax_h3_pipeline import MiniMaxH3ModularPipeline from fastvideo.pipelines.composed_pipeline_base import ComposedPipelineBase @@ -301,7 +317,24 @@ def test_minimax_h3_checkpoint_schedule_rebinds_and_reaches_the_first_forward(tm "num_inference_steps": 9, "transformer_forwards": 8, })) - resolved = _resolve({"model_path": FASTH3}) + (tmp_path / "transformer").mkdir() + (tmp_path / "model_index.json").write_text( + json.dumps({ + "_class_name": "MiniMaxH3ModularPipeline", + "_diffusers_version": "0", + "transformer": ["diffusers", "Model"], + })) + resolved = _resolve({ + "model_path": str(tmp_path), + "pipeline": { + "experimental": { + "pipeline_config": MiniMaxH3PipelineConfig() + } + } + }) + assert resolved.pipeline.dmd_denoising_steps == tuple(steps) + assert resolved.provenance("pipeline.dmd_denoising_steps").source == "fill_dmd_schedule_from_checkpoint" + pipeline = object.__new__(MiniMaxH3ModularPipeline) pipeline.model_path = str(tmp_path) pipeline.resolved_config = resolved @@ -309,7 +342,7 @@ def test_minimax_h3_checkpoint_schedule_rebinds_and_reaches_the_first_forward(tm pipeline.post_init_called = False seen = [] monkeypatch.setattr(ComposedPipelineBase, "post_init", - lambda self: (setattr(self, "post_init_called", True), self._load_checkpoint_schedule( + lambda self: (setattr(self, "post_init_called", True), self._validate_checkpoint_schedule( self.resolved_config))) monkeypatch.setattr(MiniMaxH3ModularPipeline, "_defer_denoise_modules", lambda self, args: False) monkeypatch.setattr(ComposedPipelineBase, "_stages", [], raising=False) @@ -317,12 +350,9 @@ def test_minimax_h3_checkpoint_schedule_rebinds_and_reaches_the_first_forward(tm monkeypatch.setattr(ComposedPipelineBase, "stages", property(lambda self: [lambda batch, args: seen.append(args) or batch])) - pipeline.forward(SimpleNamespace(), pipeline.resolved_config) + pipeline.forward(SimpleNamespace(), resolved) - assert seen == [pipeline.resolved_config] and pipeline.resolved_config is not resolved - assert pipeline.resolved_config.pipeline.dmd_denoising_steps == tuple(steps) - assert pipeline.resolved_config.provenance("pipeline.dmd_denoising_steps").source == ( - "checkpoint:fastvideo_inference.json") + assert seen == [resolved] and pipeline.resolved_config is resolved def test_training_root_uses_command_line_defaults_and_typed_values(tmp_path): diff --git a/fastvideo/tests/contract/test_env_policy.py b/fastvideo/tests/contract/test_env_policy.py index c84eb44f2..f66e79eba 100644 --- a/fastvideo/tests/contract/test_env_policy.py +++ b/fastvideo/tests/contract/test_env_policy.py @@ -153,7 +153,6 @@ KNOWN_VIOLATIONS: dict[str, int] = { 'fastvideo/distributed/device_communicators/cpu_communicator.py: read VLLM_DIST_IDENT': 1, 'fastvideo/entrypoints/cli/utils.py: whole-environ': 1, 'fastvideo/entrypoints/openai/api_server.py: write FASTVIDEO_STAGE_LOGGING': 1, - 'fastvideo/entrypoints/video_generator.py: write FASTVIDEO_NVFP4_FA4': 1, 'fastvideo/mlx_runtime/memory.py: write ': 1, 'fastvideo/performance/hf_store.py: read HF_REPO_ID': 1, 'fastvideo/performance/hf_store.py: read PERFORMANCE_TRACKING_SYNC_REUSE_TTL_SECONDS': 1, diff --git a/fastvideo/tests/entrypoints/test_video_generator.py b/fastvideo/tests/entrypoints/test_video_generator.py index 192a4bc50..a4570451d 100644 --- a/fastvideo/tests/entrypoints/test_video_generator.py +++ b/fastvideo/tests/entrypoints/test_video_generator.py @@ -631,7 +631,7 @@ def test_from_file_loads_generator_from_run_config(tmp_path, monkeypatch): assert captured["resolved_config"].engine.num_gpus == 3 -def test_from_pretrained_convenience_kwargs_do_not_warn(monkeypatch): +def test_from_pretrained_nested_config_does_not_warn(monkeypatch): captured = _patch_from_resolved_config(monkeypatch) _skip_model_definition(monkeypatch) @@ -639,12 +639,18 @@ def test_from_pretrained_convenience_kwargs_do_not_warn(monkeypatch): warnings.simplefilter("always") generator = VideoGenerator.from_pretrained( "test-model", - num_gpus=4, - use_fsdp_inference=False, - text_encoder_cpu_offload=True, - pin_cpu_memory=True, - dit_cpu_offload=False, - vae_cpu_offload=False, + { + "engine": { + "num_gpus": 4, + "use_fsdp_inference": False, + "offload": { + "text_encoder": True, + "pin_cpu_memory": True, + "dit": False, + "vae": False, + }, + }, + }, ) assert not caught @@ -661,11 +667,11 @@ def test_from_pretrained_convenience_kwargs_do_not_warn(monkeypatch): assert generator.config.engine.num_gpus == 4 -def test_from_pretrained_rejects_other_kwargs_and_points_to_from_config(monkeypatch): +def test_from_pretrained_rejects_flat_keywords_and_points_to_a_nested_config(monkeypatch): captured = _patch_from_resolved_config(monkeypatch) _skip_model_definition(monkeypatch) - with pytest.raises(TypeError, match=r"does not accept workload_type\.(.|\n)*VideoGenerator\.from_config"): + with pytest.raises(TypeError, match=r"does not accept num_gpus, workload_type\.(.|\n)*nested config"): VideoGenerator.from_pretrained( "test-model", num_gpus=4, @@ -675,6 +681,16 @@ def test_from_pretrained_rejects_other_kwargs_and_points_to_from_config(monkeypa assert "resolved_config" not in captured +def test_from_pretrained_rejects_a_config_with_another_model_path(monkeypatch): + captured = _patch_from_resolved_config(monkeypatch) + _skip_model_definition(monkeypatch) + + with pytest.raises(ValueError, match="differs from model_path"): + VideoGenerator.from_pretrained("test-model", {"model_path": "other-model"}) + + assert "resolved_config" not in captured + + def test_generate_uses_typed_request_path(monkeypatch): generator = _new_runtime_video_generator() _patch_sampling_param_from_pretrained(monkeypatch) diff --git a/fastvideo/tests/loader/test_text_encoder_unified_memory_offload.py b/fastvideo/tests/loader/test_text_encoder_unified_memory_offload.py index a96a2c275..47966a7b6 100644 --- a/fastvideo/tests/loader/test_text_encoder_unified_memory_offload.py +++ b/fastvideo/tests/loader/test_text_encoder_unified_memory_offload.py @@ -1,14 +1,15 @@ # SPDX-License-Identifier: Apache-2.0 -"""Regression tests for encoder placement on unified memory.""" +"""Regression tests for encoder placement: the loader reads the offload decision that resolution made.""" from __future__ import annotations from types import SimpleNamespace -from unittest.mock import Mock +from unittest.mock import Mock, patch import pytest import torch import torch.nn as nn +from fastvideo.api import device_policy from fastvideo.api.inference_resolution import resolve_inference_config from fastvideo.models.loader.component_loader import ImageEncoderLoader, TextEncoderLoader from fastvideo.tests.api.config_snapshot import isolated_environment @@ -31,58 +32,57 @@ def _model_config(): return SimpleNamespace(architectures=["PassthroughEncoder"], _fsdp_shard_conditions=[], quant_config=None) -def _resolved_config(**offload): - """A resolved inference config for a registered model with the given ``engine.offload`` values.""" - with isolated_environment(): +def _resolved_config(monkeypatch, *, unified: bool, **offload): + """A resolved inference config for a registered model, resolved on a unified or discrete device.""" + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: unified) + monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") + monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) + with isolated_environment(), patch.object(device_policy, "APPLY_DEVICE_POLICY", True): return resolve_inference_config({"model_path": WAN_T2V, "engine": {"offload": offload}}) -@pytest.mark.parametrize( - ("cpu_offload", "requested_target"), - [ - (None, torch.device("cuda:5")), - (None, torch.device("cpu")), - (True, torch.device("cpu")), - ], -) -def test_unified_memory_uses_worker_device_before_model_construction(monkeypatch, tmp_path, cpu_offload, - requested_target) -> None: - probe = Mock(return_value=True) +@pytest.fixture +def passthrough_registry(monkeypatch): + monkeypatch.setattr( + "fastvideo.models.loader.component_loader.ModelRegistry.resolve_model_cls", + lambda architectures: (_PassthroughEncoder, None), + ) + + +@pytest.mark.parametrize("requested_target", [torch.device("cuda:5"), torch.device("cpu")]) +def test_unified_memory_decision_keeps_the_encoder_on_the_worker_device(monkeypatch, tmp_path, passthrough_registry, + requested_target) -> None: + resolved_config = _resolved_config(monkeypatch, unified=True, text_encoder=True) + assert resolved_config.engine.offload.text_encoder is False + probe = Mock(side_effect=AssertionError("device probe ran in the loader")) + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", probe) monkeypatch.setattr("fastvideo.models.loader.component_loader.get_local_torch_device", lambda: torch.device("cuda:5")) - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", probe) - monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") - monkeypatch.setattr( - "fastvideo.models.loader.component_loader.ModelRegistry.resolve_model_cls", - lambda architectures: (_PassthroughEncoder, None), - ) - resolved_config = _resolved_config(text_encoder=True) - model = TextEncoderLoader().load_model( - str(tmp_path), - _model_config(), - requested_target, - resolved_config, - cpu_offload=cpu_offload, - ) + model = TextEncoderLoader().load_model(str(tmp_path), _model_config(), requested_target, resolved_config) assert isinstance(model, _PassthroughEncoder) - assert _PassthroughEncoder.loaded_device == torch.device("cuda:5") - # The loader only queries the policy; the worker records the offload decisions on the config. - assert resolved_config.engine.offload.text_encoder is True + # cpu_offload is off, so the loader keeps the target that the caller chose. + assert _PassthroughEncoder.loaded_device == requested_target assert resolved_config.override_log == () - probe.assert_called_once_with(5) + probe.assert_not_called() -def test_discrete_memory_preserves_explicit_cpu_target(monkeypatch, tmp_path) -> None: +def test_discrete_memory_offloads_the_encoder_to_the_host(monkeypatch, tmp_path, passthrough_registry) -> None: + resolved_config = _resolved_config(monkeypatch, unified=False, text_encoder=True) + assert resolved_config.engine.offload.text_encoder is True + monkeypatch.setattr("fastvideo.models.loader.component_loader.get_local_torch_device", + lambda: torch.device("cuda:2")) + + TextEncoderLoader().load_model(str(tmp_path), _model_config(), torch.device("cuda:2"), resolved_config) + + assert _PassthroughEncoder.loaded_device == torch.device("cpu") + + +def test_discrete_memory_preserves_explicit_cpu_target(monkeypatch, tmp_path, passthrough_registry) -> None: + resolved_config = _resolved_config(monkeypatch, unified=False, text_encoder=False) monkeypatch.setattr("fastvideo.models.loader.component_loader.get_local_torch_device", lambda: torch.device("cuda:2")) - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: False) - monkeypatch.setattr( - "fastvideo.models.loader.component_loader.ModelRegistry.resolve_model_cls", - lambda architectures: (_PassthroughEncoder, None), - ) - resolved_config = _resolved_config(text_encoder=False) TextEncoderLoader().load_model( str(tmp_path), @@ -95,27 +95,20 @@ def test_discrete_memory_preserves_explicit_cpu_target(monkeypatch, tmp_path) -> assert _PassthroughEncoder.loaded_device == torch.device("cpu") -def test_image_encoder_explicit_offload_resets_cpu_target(monkeypatch, tmp_path) -> None: - probe = Mock(return_value=True) +def test_image_encoder_reads_its_own_offload_decision(monkeypatch, tmp_path, passthrough_registry) -> None: + resolved_config = _resolved_config(monkeypatch, unified=True, text_encoder=True, image_encoder=True) + assert resolved_config.engine.offload.image_encoder is False monkeypatch.setattr("fastvideo.models.loader.component_loader.get_local_torch_device", lambda: torch.device("cuda:4")) - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", probe) - monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") - monkeypatch.setattr( - "fastvideo.models.loader.component_loader.ModelRegistry.resolve_model_cls", - lambda architectures: (_PassthroughEncoder, None), - ) - resolved_config = _resolved_config(text_encoder=True, image_encoder=True) ImageEncoderLoader().load_model( str(tmp_path), _model_config(), - torch.device("cpu"), + torch.device("cuda:4"), resolved_config, - cpu_offload=True, + cpu_offload=resolved_config.engine.offload.image_encoder, offload_flag="image_encoder_cpu_offload", ) assert _PassthroughEncoder.loaded_device == torch.device("cuda:4") assert resolved_config.override_log == () - probe.assert_called_once_with(4) diff --git a/fastvideo/tests/loader/test_transformer_loader_config.py b/fastvideo/tests/loader/test_transformer_loader_config.py index d501e4fd7..83fa9f8fc 100644 --- a/fastvideo/tests/loader/test_transformer_loader_config.py +++ b/fastvideo/tests/loader/test_transformer_loader_config.py @@ -57,6 +57,7 @@ def test_transformer_loader_passes_the_typed_engine_settings(transformer_dir, fs "use_fsdp_inference": True, "offload": { "dit": False, + "dit_layerwise": False, "pin_cpu_memory": False }, "compile": { @@ -120,3 +121,22 @@ def test_teacher_critic_flag_loads_checkpoint_weights_without_quantization(monke assert teacher["weight_dir_list"] == [str(transformer_dir / "model.safetensors")] assert teacher["init_params"]["config"].quant_config is None assert resolved_config.pipeline_config.dit_config.quant_config is quant_config + + +def test_load_argument_overrides_the_transformer_class_name(monkeypatch, transformer_dir, fsdp_calls) -> None: + """``override_transformer_cls_name`` of the load call wins over the typed component setting.""" + resolved_config = _resolve({"pipeline": {"components": {"override_transformer_cls_name": "StudentModel"}}}) + requested = [] + monkeypatch.setattr(component_loader.ModelRegistry, "resolve_model_cls", + lambda name: requested.append(name) or (_FakeTransformer, None)) + + PipelineComponentLoader.load_module("transformer", str(transformer_dir), "diffusers", resolved_config) + PipelineComponentLoader.load_module("transformer", + str(transformer_dir), + "diffusers", + resolved_config, + loading_teacher_critic_model=True, + override_transformer_cls_name="TeacherModel") + + assert requested == ["StudentModel", "TeacherModel"] + assert resolved_config.pipeline.components.override_transformer_cls_name == "StudentModel" diff --git a/fastvideo/tests/pipelines/test_direct_pipeline_unified_memory.py b/fastvideo/tests/pipelines/test_direct_pipeline_unified_memory.py index 7cd7f0436..a0c93cae3 100644 --- a/fastvideo/tests/pipelines/test_direct_pipeline_unified_memory.py +++ b/fastvideo/tests/pipelines/test_direct_pipeline_unified_memory.py @@ -1,13 +1,15 @@ # SPDX-License-Identifier: Apache-2.0 -"""Direct pipeline construction applies offload policy after device setup.""" +"""Direct pipeline construction runs on the resolved config, whose offload settings resolution already settled.""" from __future__ import annotations from contextlib import nullcontext from types import SimpleNamespace +from unittest.mock import Mock, patch import torch import fastvideo.pipelines.composed_pipeline_base as composed_pipeline_base +from fastvideo.api import device_policy from fastvideo.api.device_policy import UNIFIED_MEMORY_OFFLOAD_PATHS from fastvideo.api.inference_resolution import resolve_inference_config from fastvideo.pipelines.composed_pipeline_base import ComposedPipelineBase @@ -35,10 +37,13 @@ class _Pipeline(ComposedPipelineBase): del resolved_config -def test_direct_pipeline_applies_policy_after_device_initialization(monkeypatch) -> None: +def test_direct_pipeline_loads_with_the_resolved_offload_policy(monkeypatch) -> None: events = [] monkeypatch.setattr(_Pipeline, "events", events) - with isolated_environment(): + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: True) + monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") + monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) + with isolated_environment(), patch.object(device_policy, "APPLY_DEVICE_POLICY", True): resolved_config = resolve_inference_config({ "model_path": "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", "engine": { @@ -46,28 +51,22 @@ def test_direct_pipeline_applies_policy_after_device_initialization(monkeypatch) }, }) - def classify_device(device_id): - events.append(("offload_policy", device_id)) - return True - + probe = Mock(side_effect=AssertionError("device probe ran while building the pipeline")) + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", probe) monkeypatch.setattr( composed_pipeline_base, "maybe_init_distributed_environment_and_model_parallel", lambda *args: events.append(("distributed", None)), ) - monkeypatch.setattr(composed_pipeline_base, "get_local_torch_device", lambda: torch.device("cuda:4")) monkeypatch.setattr(composed_pipeline_base, "get_world_group", lambda: SimpleNamespace(local_rank=4)) monkeypatch.setattr(composed_pipeline_base, "get_or_create_profiler", lambda trace_dir: _Profiler()) - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", classify_device) - monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") - monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) pipeline = _Pipeline("unused", resolved_config, required_config_modules=[]) assert pipeline.modules == {} + assert pipeline.resolved_config is resolved_config assert events == [ ("distributed", None), - ("offload_policy", 4), ( "load_modules", { @@ -76,3 +75,4 @@ def test_direct_pipeline_applies_policy_after_device_initialization(monkeypatch) }, ), ] + probe.assert_not_called() diff --git a/fastvideo/tests/pipelines/test_ltx2_refine_checkpoint_defaults.py b/fastvideo/tests/pipelines/test_ltx2_refine_checkpoint_defaults.py index 3d6d668b7..a69871800 100644 --- a/fastvideo/tests/pipelines/test_ltx2_refine_checkpoint_defaults.py +++ b/fastvideo/tests/pipelines/test_ltx2_refine_checkpoint_defaults.py @@ -1,9 +1,13 @@ # SPDX-License-Identifier: Apache-2.0 -"""LTX-2 refine settings after the checkpoint's model_index.json defaults are applied at load time.""" +"""LTX-2 refine settings after resolution fills them from the checkpoint's model_index.json.""" from __future__ import annotations -from fastvideo.api.inference_resolution import resolve_inference_config -from fastvideo.pipelines.basic.ltx2.ltx2_pipeline import LTX2Pipeline, _checkpoint_refine_values +import json + +from fastvideo.api.checkpoint_defaults import ltx2_refine_checkpoint_step +from fastvideo.api.inference_resolution import fill_runtime_defaults, resolve_inference_config +from fastvideo.api.resolution import resolve_generator_config +from fastvideo.pipelines.basic.ltx2.pipeline_configs import LTX2T2VConfig from fastvideo.tests.api.config_snapshot import isolated_environment LTX2 = "FastVideo/LTX2-Distilled-Diffusers" @@ -14,46 +18,90 @@ CHECKPOINT_REFINE = { "fastvideo_refine_add_noise": False, "fastvideo_refine_lora_path": "FastVideo/LTX2-Distilled-LoRA", } +REFINE_SWITCHES = ( + "pipeline.ltx2.refine.enabled", + "pipeline.ltx2.refine.num_inference_steps", + "pipeline.ltx2.refine.guidance_scale", + "pipeline.ltx2.refine.add_noise", +) -def _resolve(refine: dict | None = None): - raw = {"model_path": LTX2} +def _checkpoint(tmp_path, **manifest_entries) -> str: + """A local LTX-2 checkpoint directory whose model_index.json holds ``manifest_entries``.""" + (tmp_path / "transformer").mkdir() + (tmp_path / "model_index.json").write_text( + json.dumps({ + "_class_name": "LTX2Pipeline", + "_diffusers_version": "0", + "transformer": ["diffusers", "Model"], + **manifest_entries + })) + return str(tmp_path) + + +def _resolve_local(model_path: str, refine: dict | None = None, upsampler_weights: str | None = None): + """Resolve a local LTX-2 checkpoint through the checkpoint step and the runtime defaults only.""" + raw: dict = {"model_path": model_path, "pipeline": {"components": {"upsampler_weights": upsampler_weights}}} if refine is not None: - raw["pipeline"] = {"ltx2": {"refine": refine}} - with isolated_environment(): - return resolve_inference_config(raw) + raw["pipeline"]["ltx2"] = {"refine": refine} + return resolve_generator_config(raw, (ltx2_refine_checkpoint_step(LTX2T2VConfig()), fill_runtime_defaults)) -def test_load_fills_unset_refine_settings_from_the_checkpoint_then_the_defaults(tmp_path): - resolved = _resolve() - pipeline = object.__new__(LTX2Pipeline) - pipeline.model_path = str(tmp_path) - pipeline.resolved_config = resolved - pipeline._required_config_modules = list(LTX2Pipeline._required_config_modules) - model_index = {name: ["diffusers", "Model"] for name in pipeline._required_config_modules} - pipeline._load_config = lambda model_path: { - "_class_name": "LTX2Pipeline", - "_diffusers_version": "0", - "fastvideo_refine_num_inference_steps": 2, - **model_index, - } +def test_checkpoint_fills_unset_refine_settings_then_the_defaults_fill_the_rest(tmp_path): + model_path = _checkpoint(tmp_path, fastvideo_refine_num_inference_steps=2) + (tmp_path / "spatial_upscaler").mkdir() - pipeline.load_modules(resolved, {name: object() for name in model_index}) + resolved = _resolve_local(model_path) - refine = pipeline.resolved_config.pipeline.ltx2.refine + refine = resolved.pipeline.ltx2.refine switches = (refine.enabled, refine.num_inference_steps, refine.guidance_scale, refine.add_noise) assert switches == (False, 2, 1.0, True) - assert pipeline.resolved_config.provenance("pipeline.ltx2.refine.add_noise").source == "checkpoint:model_index.json" - assert resolved.pipeline.ltx2.refine.num_inference_steps is None + assert resolved.provenance("pipeline.ltx2.refine.num_inference_steps").source == "fill_ltx2_refine_from_checkpoint" + assert resolved.provenance("pipeline.ltx2.refine.add_noise").source == "fill_runtime_defaults" + assert resolved.pipeline.components.upsampler_weights == str(tmp_path / "spatial_upscaler") -def test_input_refine_settings_win_over_the_checkpoint(): - resolved = _resolve({"enabled": False, "num_inference_steps": 3, "guidance_scale": 2.0}) +def test_input_refine_settings_win_over_the_checkpoint(tmp_path): + model_path = _checkpoint(tmp_path, **CHECKPOINT_REFINE) - values = _checkpoint_refine_values(resolved, "/unused", dict(CHECKPOINT_REFINE)) + resolved = _resolve_local(model_path, {"enabled": False, "num_inference_steps": 3, "guidance_scale": 2.0}) - assert values == { + checkpoint_decisions = [ + values for source, values in resolved.decisions if source == "fill_ltx2_refine_from_checkpoint" + ] + assert checkpoint_decisions == [{ "pipeline.ltx2.refine.add_noise": False, "pipeline.ltx2.refine.lora_path": "FastVideo/LTX2-Distilled-LoRA", - } - assert _checkpoint_refine_values(_resolve(), "/unused", dict(CHECKPOINT_REFINE))["pipeline.ltx2.refine.enabled"] + }] + assert resolved.pipeline.ltx2.refine.enabled is False + assert _resolve_local(model_path).pipeline.ltx2.refine.enabled is True + + +def test_relative_refine_paths_resolve_inside_the_checkpoint(tmp_path): + (tmp_path / "transformer_refine").mkdir() + model_path = _checkpoint(tmp_path, + fastvideo_refine_transformer_path="transformer_refine", + fastvideo_refine_noise_path="/weights/noise.safetensors", + spatial_upsampler=["diffusers", "LTX2LatentUpsampler"]) + (tmp_path / "spatial_upsampler").mkdir() + + resolved = _resolve_local(model_path) + + assert resolved.pipeline.ltx2.refine.transformer_path == str(tmp_path / "transformer_refine") + assert resolved.pipeline.ltx2.refine.noise_path == "/weights/noise.safetensors" + assert resolved.pipeline.components.upsampler_weights == str(tmp_path / "spatial_upsampler") + + +def test_step_skips_other_models_and_blocked_downloads(tmp_path): + model_path = _checkpoint(tmp_path, **CHECKPOINT_REFINE) + other_model = resolve_generator_config({"model_path": model_path}, + (ltx2_refine_checkpoint_step(object()), fill_runtime_defaults)) + assert other_model.pipeline.ltx2.refine.enabled is False + assert other_model.pipeline.ltx2.refine.lora_path is None + + with isolated_environment(): + hub_model = resolve_inference_config({"model_path": LTX2}) + + assert [source for source, _ in hub_model.decisions if source == "fill_ltx2_refine_from_checkpoint"] == [] + assert tuple(hub_model.provenance(path).value for path in REFINE_SWITCHES) == (False, 3, 1.0, True) + assert hub_model.provenance("pipeline.ltx2.refine.enabled").source == "fill_runtime_defaults" diff --git a/fastvideo/tests/platforms/test_unified_memory_offload.py b/fastvideo/tests/platforms/test_unified_memory_offload.py index 959624e07..ab0223fd7 100644 --- a/fastvideo/tests/platforms/test_unified_memory_offload.py +++ b/fastvideo/tests/platforms/test_unified_memory_offload.py @@ -1,14 +1,14 @@ # SPDX-License-Identifier: Apache-2.0 -"""CPU tests for worker-local offload policy on unified-memory devices.""" +"""CPU tests for the device-policy resolution steps, which settle host offload for the local device's memory class.""" from __future__ import annotations import dataclasses -from unittest.mock import Mock +from unittest.mock import Mock, patch import pytest -from fastvideo.api.device_policy import (UNIFIED_MEMORY_OFFLOAD_PATHS, disable_offload_on_unified_memory, - finalize_device_offload_policy) +from fastvideo.api import device_policy +from fastvideo.api.device_policy import LOCAL_DEVICE_ID, UNIFIED_MEMORY_OFFLOAD_PATHS from fastvideo.api.inference_resolution import resolve_inference_config from fastvideo.api.schema import OffloadConfig from fastvideo.api.training_schema import resolve_training_config @@ -23,9 +23,14 @@ def _offload_field(flag: str) -> str: return UNIFIED_MEMORY_OFFLOAD_PATHS[flag].rsplit(".", 1)[1] +def _device_policy_enabled(): + """Turn the device-policy steps on inside the test isolation, which turns them off like downloads.""" + return patch.object(device_policy, "APPLY_DEVICE_POLICY", True) + + def _resolve(engine: dict | None = None): """A resolved inference config for a registered model with the given ``engine`` section.""" - with isolated_environment(): + with isolated_environment(), _device_policy_enabled(): return resolve_inference_config({"model_path": WAN_T2V, "engine": engine or {}}) @@ -42,6 +47,11 @@ def _enabled_flags(resolved_config) -> list[str]: ] +def _decisions_of(resolved_config, source: str) -> list[dict]: + """The values that the step ``source`` decided, in order.""" + return [values for decided_by, values in resolved_config.decisions if decided_by == source] + + @pytest.fixture def as_unified_cuda(monkeypatch): probe = Mock(return_value=True) @@ -51,22 +61,23 @@ def as_unified_cuda(monkeypatch): return probe -def test_resolving_an_inference_config_defers_device_policy(monkeypatch) -> None: - probe = Mock(side_effect=AssertionError("device probe ran in the driver")) +@pytest.fixture +def as_discrete_cuda(monkeypatch): + probe = Mock(return_value=False) monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", probe) - - resolved_config = _resolve({"use_fsdp_inference": True}) - - assert resolved_config.engine.use_fsdp_inference is True - assert resolved_config.engine.offload.dit_layerwise is True - assert resolved_config.engine.offload.dit is True - probe.assert_not_called() - - -def test_training_resolution_retains_offload_conflict_normalization(monkeypatch) -> None: monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) + return probe - with isolated_environment(): + +def test_resolution_queries_the_local_device(as_unified_cuda) -> None: + _resolve() + + assert as_unified_cuda.call_args_list + assert {call.args for call in as_unified_cuda.call_args_list} == {(LOCAL_DEVICE_ID, )} + + +def test_training_resolution_settles_offload_conflicts(as_discrete_cuda) -> None: + with isolated_environment(), _device_policy_enabled(): resolved_config = resolve_training_config({ "model_path": WAN_T2V, "engine": { @@ -85,6 +96,8 @@ def test_training_resolution_retains_offload_conflict_normalization(monkeypatch) assert resolved_config.engine.offload.dit_layerwise is True assert resolved_config.engine.offload.dit is False assert resolved_config.engine.use_fsdp_inference is False + assert resolved_config.provenance("engine.use_fsdp_inference").source == "apply_layerwise_offload_conflicts" + assert resolved_config.engine.offload.lazy_module_load is False def test_policy_list_covers_every_host_offload_field() -> None: @@ -96,145 +109,139 @@ def test_policy_list_covers_every_host_offload_field() -> None: def test_unified_device_disables_every_offload_flag(as_unified_cuda) -> None: resolved_config = _resolve() - decided = finalize_device_offload_policy(resolved_config, device_id=6) - - as_unified_cuda.assert_called_once_with(6) - assert not _enabled_flags(decided) - assert _enabled_flags(resolved_config) == list(UNIFIED_MEMORY_OFFLOAD_FLAGS) + assert not _enabled_flags(resolved_config) + assert _decisions_of(resolved_config, "apply_unified_memory_offload_policy") == [{ + path: False + for path in UNIFIED_MEMORY_OFFLOAD_PATHS.values() + }] + for flag in UNIFIED_MEMORY_OFFLOAD_FLAGS: + provenance = resolved_config.provenance(UNIFIED_MEMORY_OFFLOAD_PATHS[flag]) + assert (provenance.raw_value, provenance.source) == (True, "apply_unified_memory_offload_policy") @pytest.mark.parametrize("flag", UNIFIED_MEMORY_OFFLOAD_FLAGS) def test_each_offload_flag_is_independently_disabled(as_unified_cuda, flag: str) -> None: resolved_config = _with_offloads(flag) - assert _enabled_flags(resolved_config) == [flag] - decided = disable_offload_on_unified_memory(resolved_config, device_id=2) - - assert not _enabled_flags(decided) - assert decided.override_log == (("device_policy:unified_memory", {UNIFIED_MEMORY_OFFLOAD_PATHS[flag]: False}), ) + assert not _enabled_flags(resolved_config) + assert _decisions_of(resolved_config, "apply_unified_memory_offload_policy") == [{ + UNIFIED_MEMORY_OFFLOAD_PATHS[flag]: False + }] -def test_discrete_device_classification_preserves_offload_requests(monkeypatch) -> None: - probe = Mock(return_value=False) - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", probe) +def test_discrete_device_classification_preserves_offload_requests(as_discrete_cuda) -> None: resolved_config = _resolve() - assert disable_offload_on_unified_memory(resolved_config, device_id=3) is resolved_config - - probe.assert_called_once_with(3) - assert _enabled_flags(resolved_config) == list(UNIFIED_MEMORY_OFFLOAD_FLAGS) + assert _enabled_flags(resolved_config) == [ + flag for flag in UNIFIED_MEMORY_OFFLOAD_FLAGS if flag != "dit_cpu_offload" + ] + assert _decisions_of(resolved_config, "apply_unified_memory_offload_policy") == [] + assert resolved_config.provenance("engine.offload.dit").source == "apply_layerwise_offload_conflicts" -def test_discrete_device_finalization_retains_layerwise_precedence(monkeypatch) -> None: - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: False) - monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) +def test_discrete_device_retains_layerwise_precedence(as_discrete_cuda) -> None: resolved_config = _resolve({"use_fsdp_inference": True}) - decided = finalize_device_offload_policy(resolved_config, device_id=3) - - offload = decided.engine.offload + offload = resolved_config.engine.offload assert offload.dit_layerwise is True assert offload.dit is False - assert decided.engine.use_fsdp_inference is False + assert resolved_config.engine.use_fsdp_inference is False assert offload.text_encoder is True assert offload.image_encoder is True assert offload.vae is True assert offload.lazy_module_load is False - - -def test_workers_classify_their_own_device(monkeypatch) -> None: - seen_device_ids = [] - - def has_unified_memory(device_id): - seen_device_ids.append(device_id) - return device_id == 1 - - monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", has_unified_memory) - monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "NVIDIA GB10") - monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) - resolved_config = _resolve() - - device_zero = finalize_device_offload_policy(resolved_config, device_id=0) - device_one = finalize_device_offload_policy(resolved_config, device_id=1) - - assert seen_device_ids == [0, 1] - assert device_zero.engine.offload.dit_layerwise is True - assert device_zero.engine.offload.text_encoder is True - assert not _enabled_flags(device_one) - - -def test_policy_applied_to_its_own_result_changes_nothing(as_unified_cuda) -> None: - decided = finalize_device_offload_policy(_resolve(), device_id=1) - - again = finalize_device_offload_policy(decided, device_id=1) - - assert again.override_log == decided.override_log - assert again.to_dict() == decided.to_dict() + assert _decisions_of(resolved_config, "apply_layerwise_offload_conflicts") == [{ + "engine.use_fsdp_inference": False, + "engine.offload.dit": False, + }] def test_mps_clears_offload_and_keeps_its_fsdp_rule(monkeypatch) -> None: monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: True) monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: True) monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", lambda device_id: "mps") + resolved_config = _resolve({"use_fsdp_inference": True}) - decided = finalize_device_offload_policy(resolved_config) - - assert decided.engine.use_fsdp_inference is False - assert not _enabled_flags(decided) + assert resolved_config.engine.use_fsdp_inference is False + assert not _enabled_flags(resolved_config) + assert _decisions_of(resolved_config, "apply_mps_offload_policy") == [{ + "engine.use_fsdp_inference": False, + "engine.offload.dit_layerwise": False, + }] def test_cuda_unified_memory_preserves_realistic_fsdp_request(as_unified_cuda) -> None: resolved_config = _resolve({"use_fsdp_inference": True}) - assert resolved_config.engine.offload.dit_layerwise is True + assert resolved_config.engine.use_fsdp_inference is True - - decided = finalize_device_offload_policy(resolved_config) - - assert decided.engine.use_fsdp_inference is True - assert not _enabled_flags(decided) + assert not _enabled_flags(resolved_config) + assert _decisions_of(resolved_config, "apply_layerwise_offload_conflicts") == [] def test_pin_cpu_memory_is_not_a_host_offload_mode(as_unified_cuda) -> None: resolved_config = _resolve({"offload": {"pin_cpu_memory": True}}) - decided = finalize_device_offload_policy(resolved_config) - assert "pin_cpu_memory" not in UNIFIED_MEMORY_OFFLOAD_FLAGS - assert decided.engine.offload.pin_cpu_memory is True + assert resolved_config.engine.offload.pin_cpu_memory is True def test_already_disabled_flags_stay_disabled(as_unified_cuda) -> None: - decided = finalize_device_offload_policy(_with_offloads()) + resolved_config = _with_offloads() - assert not _enabled_flags(decided) + assert not _enabled_flags(resolved_config) + assert _decisions_of(resolved_config, "apply_unified_memory_offload_policy") == [] @pytest.mark.parametrize("name_error", [NotImplementedError, ValueError, RuntimeError]) def test_platform_without_device_name_uses_generic_name(monkeypatch, name_error: type[Exception]) -> None: monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: True) + monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) def unsupported_name(device_id): raise name_error("device name unavailable") monkeypatch.setattr("fastvideo.platforms.current_platform.get_device_name", unsupported_name) + resolved_config = _with_offloads("text_encoder_cpu_offload") - decided = disable_offload_on_unified_memory(resolved_config, device_id=0) + assert resolved_config.engine.offload.text_encoder is False - assert decided.engine.offload.text_encoder is False + +def test_failed_device_query_counts_as_discrete(monkeypatch) -> None: + + def unavailable(device_id): + raise RuntimeError("no CUDA driver") + + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", unavailable) + monkeypatch.setattr("fastvideo.platforms.current_platform.is_mps", lambda: False) + + resolved_config = _with_offloads("text_encoder_cpu_offload") + + assert resolved_config.engine.offload.text_encoder is True + assert resolved_config.engine.offload.lazy_module_load is False def test_unified_device_auto_enables_lazy_module_load(as_unified_cuda) -> None: resolved_config = _resolve() - assert resolved_config.engine.offload.lazy_module_load is None - assert finalize_device_offload_policy(resolved_config, device_id=6).engine.offload.lazy_module_load is True + provenance = resolved_config.provenance("engine.offload.lazy_module_load") + assert (provenance.raw_value, provenance.value, provenance.source) == (None, True, "fill_lazy_module_load") def test_explicit_false_lazy_module_load_stays_off_on_unified(as_unified_cuda) -> None: resolved_config = _resolve({"offload": {"lazy_module_load": False}}) - decided = finalize_device_offload_policy(resolved_config, device_id=6) + assert resolved_config.engine.offload.lazy_module_load is False + assert resolved_config.provenance("engine.offload.lazy_module_load").source == "input" - assert decided.engine.offload.lazy_module_load is False + +def test_disabled_device_policy_decides_nothing(as_unified_cuda) -> None: + with isolated_environment(), patch.object(device_policy, "APPLY_DEVICE_POLICY", False): + resolved_config = resolve_inference_config({"model_path": WAN_T2V, "engine": {"use_fsdp_inference": True}}) + + assert _enabled_flags(resolved_config) == list(UNIFIED_MEMORY_OFFLOAD_FLAGS) + assert resolved_config.engine.use_fsdp_inference is True + assert resolved_config.engine.offload.lazy_module_load is None + assert [source for source, _ in resolved_config.decisions if source.startswith(("apply_", "fill_lazy"))] == [] + as_unified_cuda.assert_not_called() diff --git a/fastvideo/tests/ssim/test_gamecraft_similarity.py b/fastvideo/tests/ssim/test_gamecraft_similarity.py index 809a53375..5fc5c4fb3 100644 --- a/fastvideo/tests/ssim/test_gamecraft_similarity.py +++ b/fastvideo/tests/ssim/test_gamecraft_similarity.py @@ -178,13 +178,17 @@ def test_gamecraft_t2v_similarity(prompt, ATTENTION_BACKEND, model_id, env_overr dtype=torch.bfloat16, ) - init_kwargs = { - "num_gpus": BASE_PARAMS["num_gpus"], - "use_fsdp_inference": True, - "dit_cpu_offload": True, - "vae_cpu_offload": True, - "text_encoder_cpu_offload": True, - "pin_cpu_memory": True, + generator_config = { + "engine": { + "num_gpus": BASE_PARAMS["num_gpus"], + "use_fsdp_inference": True, + "offload": { + "dit": True, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, } request = { @@ -210,7 +214,7 @@ def test_gamecraft_t2v_similarity(prompt, ATTENTION_BACKEND, model_id, env_overr generator: VideoGenerator | None = None try: - generator = VideoGenerator.from_pretrained(model_path=BASE_PARAMS["model_path"], **init_kwargs) + generator = VideoGenerator.from_pretrained(BASE_PARAMS["model_path"], generator_config) generator.generate(request) finally: _shutdown_executor(generator) @@ -308,13 +312,17 @@ def test_gamecraft_i2v_similarity(prompt, ATTENTION_BACKEND, model_id, env_overr dtype=torch.bfloat16, ) - init_kwargs = { - "num_gpus": BASE_PARAMS["num_gpus"], - "use_fsdp_inference": True, - "dit_cpu_offload": True, - "vae_cpu_offload": True, - "text_encoder_cpu_offload": True, - "pin_cpu_memory": True, + generator_config = { + "engine": { + "num_gpus": BASE_PARAMS["num_gpus"], + "use_fsdp_inference": True, + "offload": { + "dit": True, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, } request = { @@ -343,7 +351,7 @@ def test_gamecraft_i2v_similarity(prompt, ATTENTION_BACKEND, model_id, env_overr generator: VideoGenerator | None = None try: - generator = VideoGenerator.from_pretrained(model_path=BASE_PARAMS["model_path"], **init_kwargs) + generator = VideoGenerator.from_pretrained(BASE_PARAMS["model_path"], generator_config) generator.generate(request) finally: _shutdown_executor(generator) diff --git a/fastvideo/tests/ssim/test_matrixgame2_similarity.py b/fastvideo/tests/ssim/test_matrixgame2_similarity.py index 6ae963152..9f8cfee91 100644 --- a/fastvideo/tests/ssim/test_matrixgame2_similarity.py +++ b/fastvideo/tests/ssim/test_matrixgame2_similarity.py @@ -117,14 +117,18 @@ def test_matrixgame2_similarity(prompt, ATTENTION_BACKEND, model_id, env_overrid latent_frames = (BASE_PARAMS["num_frames"] - 1) // 4 + 1 grid_sizes = torch.tensor([latent_frames, 44, 80]) - init_kwargs = { - "num_gpus": BASE_PARAMS["num_gpus"], - "use_fsdp_inference": True, - "dit_layerwise_offload": False, - "dit_cpu_offload": False, - "vae_cpu_offload": False, - "text_encoder_cpu_offload": True, - "pin_cpu_memory": True, + generator_config = { + "engine": { + "num_gpus": BASE_PARAMS["num_gpus"], + "use_fsdp_inference": True, + "offload": { + "dit_layerwise": False, + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, } request = { @@ -148,7 +152,7 @@ def test_matrixgame2_similarity(prompt, ATTENTION_BACKEND, model_id, env_overrid }, } - generator = VideoGenerator.from_pretrained(model_path=BASE_PARAMS["model_path"], **init_kwargs) + generator = VideoGenerator.from_pretrained(BASE_PARAMS["model_path"], generator_config) generator.generate(request) if isinstance(generator.executor, MultiprocExecutor): diff --git a/fastvideo/tests/ssim/test_matrixgame3_similarity.py b/fastvideo/tests/ssim/test_matrixgame3_similarity.py index a829570d5..6f489d5b8 100644 --- a/fastvideo/tests/ssim/test_matrixgame3_similarity.py +++ b/fastvideo/tests/ssim/test_matrixgame3_similarity.py @@ -104,14 +104,18 @@ def test_matrixgame3_similarity(prompt, ATTENTION_BACKEND, model_id, env_overrid BASE_PARAMS = params_map[model_id] num_inference_steps = BASE_PARAMS["num_inference_steps"] - init_kwargs = { - "num_gpus": BASE_PARAMS["num_gpus"], - "use_fsdp_inference": True, - "dit_layerwise_offload": False, - "dit_cpu_offload": False, - "vae_cpu_offload": False, - "text_encoder_cpu_offload": True, - "pin_cpu_memory": True, + generator_config = { + "engine": { + "num_gpus": BASE_PARAMS["num_gpus"], + "use_fsdp_inference": True, + "offload": { + "dit_layerwise": False, + "dit": False, + "vae": False, + "text_encoder": True, + "pin_cpu_memory": True, + }, + }, } request = { @@ -133,7 +137,7 @@ def test_matrixgame3_similarity(prompt, ATTENTION_BACKEND, model_id, env_overrid }, } - generator = VideoGenerator.from_pretrained(model_path=BASE_PARAMS["model_path"], **init_kwargs) + generator = VideoGenerator.from_pretrained(BASE_PARAMS["model_path"], generator_config) generator.generate(request) if isinstance(generator.executor, MultiprocExecutor): diff --git a/fastvideo/tests/stages/test_ltx2_refine_upsampler_resolve.py b/fastvideo/tests/stages/test_ltx2_refine_upsampler_resolve.py index a9289c3b0..2ab9efd78 100644 --- a/fastvideo/tests/stages/test_ltx2_refine_upsampler_resolve.py +++ b/fastvideo/tests/stages/test_ltx2_refine_upsampler_resolve.py @@ -4,7 +4,7 @@ Pure tmp_path tests: no GPU, no model downloads. """ -from fastvideo.pipelines.basic.ltx2.ltx2_pipeline import _resolve_refine_upsampler_path +from fastvideo.api.checkpoint_defaults import _resolve_refine_upsampler_path def test_model_index_key_wins_over_directory_probe(tmp_path): diff --git a/fastvideo/tests/stages/test_minimax_h3_distilled_schedule.py b/fastvideo/tests/stages/test_minimax_h3_distilled_schedule.py index adb0308b4..510b38e1c 100644 --- a/fastvideo/tests/stages/test_minimax_h3_distilled_schedule.py +++ b/fastvideo/tests/stages/test_minimax_h3_distilled_schedule.py @@ -9,6 +9,9 @@ import pytest import torch from torch.testing import assert_close +from fastvideo.api.checkpoint_defaults import dmd_schedule_checkpoint_step +from fastvideo.api.inference_resolution import fill_runtime_defaults +from fastvideo.api.resolution import resolve_generator_config from fastvideo.configs.pipelines.minimax_h3 import MiniMaxH3PipelineConfig from fastvideo.models.schedulers.scheduling_minimax_h3 import MiniMaxH3Scheduler from fastvideo.pipelines.basic.minimax_h3.minimax_h3_pipeline import MiniMaxH3ModularPipeline @@ -38,6 +41,19 @@ def _pipeline(tmp_path, *, video_shift=10.0): return pipeline +def _resolve_checkpoint(tmp_path, raw=None): + """Resolve the local checkpoint ``tmp_path`` through the checkpoint schedule step and the runtime defaults.""" + return resolve_generator_config({"model_path": str(tmp_path), **(raw or {})}, + (dmd_schedule_checkpoint_step(MiniMaxH3PipelineConfig()), fill_runtime_defaults), + materialize=lambda _: MiniMaxH3PipelineConfig()) + + +def _with_steps(steps): + """A resolved config whose input sets ``pipeline.dmd_denoising_steps``.""" + return make_resolved_config(MiniMaxH3PipelineConfig(dmd_denoising_steps=steps), + raw={"pipeline": {"dmd_denoising_steps": steps}}) + + def test_pipeline_preserves_shift10_from_checkpoint(tmp_path): # Exercise real initialization with weight loading omitted. The schedulers # represent scheduler_config.json from the eight-forward T2AV checkpoint. @@ -85,8 +101,8 @@ def _run_tiny_stage(monkeypatch, steps, grid_points, *, video_shift=10.0, offloa resolved_config = make_resolved_config(MiniMaxH3PipelineConfig(), raw={"engine": {"offload": offload, "use_fsdp_inference": False}}) if steps is not None: - # A schedule decided after resolution, such as the checkpoint's, arrives through with_override, which does - # not type-check values, so the stage's own ladder validation is what rejects a malformed one. + # The checkpoint step copies the schedule as written and an override skips the parser's type check, so the + # stage's own ladder validation is what rejects a malformed one. resolved_config = resolved_config.with_override("test:dmd_schedule", {"pipeline.dmd_denoising_steps": steps}) batch = ForwardBatch( data_type="video", prompt_embeds=[torch.zeros(1, 2, 8)], latents=torch.ones(2, 96), audio_latents=torch.ones(4, 32), @@ -158,17 +174,34 @@ def test_eight_forward_schedule_uses_trained_rungs_for_both_modalities(monkeypat assert_close(result.audio_latents, torch.full_like(result.audio_latents, 1.0 - 3.0 * audio_sigmas[0])) -def test_pipeline_loads_the_exported_ladder_and_rejects_a_conflicting_one(tmp_path): +def test_resolution_fills_the_exported_ladder_and_the_pipeline_accepts_it(tmp_path): (tmp_path / "fastvideo_inference.json").write_text(json.dumps(CONTRACT)) - pipeline = _pipeline(tmp_path) - pipeline.initialize_pipeline(make_resolved_config(MiniMaxH3PipelineConfig())) - assert list(pipeline.resolved_config.pipeline.dmd_denoising_steps) == DMD_STEPS + resolved_config = _resolve_checkpoint(tmp_path) + assert list(resolved_config.pipeline.dmd_denoising_steps) == DMD_STEPS + provenance = resolved_config.provenance("pipeline.dmd_denoising_steps") + assert provenance.source == "fill_dmd_schedule_from_checkpoint" + pipeline = _pipeline(tmp_path) + pipeline.initialize_pipeline(resolved_config) + + # An input schedule wins during resolution; the pipeline then rejects the disagreement with the checkpoint. + explicit = _resolve_checkpoint(tmp_path, {"pipeline": {"dmd_denoising_steps": DMD_STEPS}}) + assert explicit.provenance("pipeline.dmd_denoising_steps").source == "input" wrong_steps = [1000, 750, 500, 250] - wrong = make_resolved_config(MiniMaxH3PipelineConfig(dmd_denoising_steps=wrong_steps), - raw={"pipeline": {"dmd_denoising_steps": wrong_steps}}) with pytest.raises(ValueError, match="checkpoint.*DMD"): - pipeline.initialize_pipeline(wrong) + pipeline.initialize_pipeline(_with_steps(wrong_steps)) + with pytest.raises(ValueError, match="dmd_denoising_steps is unset"): + pipeline.initialize_pipeline(make_resolved_config(MiniMaxH3PipelineConfig())) + + +def test_checkpoint_step_skips_other_models_and_checkpoints_without_a_schedule(tmp_path): + (tmp_path / "fastvideo_inference.json").write_text(json.dumps(CONTRACT)) + other_model = resolve_generator_config({"model_path": str(tmp_path)}, + (dmd_schedule_checkpoint_step(object()), fill_runtime_defaults)) + assert other_model.pipeline.dmd_denoising_steps is None + + (tmp_path / "fastvideo_inference.json").unlink() + assert _resolve_checkpoint(tmp_path).pipeline.dmd_denoising_steps is None @pytest.mark.parametrize("grid_points", [5, 50]) @@ -179,8 +212,8 @@ def test_base_and_four_forward_schedules_are_unchanged(monkeypatch, tmp_path, gr pipeline.initialize_pipeline(resolved_config) assert pipeline.modules["scheduler"].shift == 12.0 assert pipeline.modules["audio_scheduler"].shift == 3.0 - # Without a sidecar the pipeline keeps the config it was given; a checkpoint schedule would rebind it. - assert (getattr(pipeline, "resolved_config", None) or resolved_config).pipeline.dmd_denoising_steps is None + # Without a sidecar, resolution leaves the schedule unset and the pipeline accepts that. + assert _resolve_checkpoint(tmp_path).pipeline.dmd_denoising_steps is None assert config.text_encoder_precisions == ("bf16",) stage, calls, _ = _run_tiny_stage(monkeypatch, None, grid_points, video_shift=12.0) assert len(calls) == grid_points - 1 @@ -210,7 +243,7 @@ def test_explicit_eight_forward_ladder_requires_nine_grid_points(monkeypatch, gr def test_checkpoint_schedule_metadata_must_be_self_consistent(tmp_path, field, value): (tmp_path / "fastvideo_inference.json").write_text(json.dumps({**CONTRACT, field: value})) with pytest.raises(ValueError): - _pipeline(tmp_path).initialize_pipeline(make_resolved_config(MiniMaxH3PipelineConfig())) + _pipeline(tmp_path).initialize_pipeline(_with_steps(DMD_STEPS)) @pytest.mark.parametrize("module_name", ["scheduler", "audio_scheduler"]) @@ -231,12 +264,13 @@ def test_sidecar_without_shift_fields_uses_the_checkpoint_schedulers(tmp_path): four_step.pop("video_scheduler_shift") four_step.pop("audio_scheduler_shift") (tmp_path / "fastvideo_inference.json").write_text(json.dumps(four_step)) + resolved_config = _resolve_checkpoint(tmp_path) + assert list(resolved_config.pipeline.dmd_denoising_steps) == [999, 749, 500, 250] pipeline = _pipeline(tmp_path, video_shift=12.0) - pipeline.initialize_pipeline(make_resolved_config(MiniMaxH3PipelineConfig())) - assert list(pipeline.resolved_config.pipeline.dmd_denoising_steps) == [999, 749, 500, 250] + pipeline.initialize_pipeline(resolved_config) assert pipeline.modules["scheduler"].shift == 12.0 assert pipeline.modules["audio_scheduler"].shift == 3.0 # Explicit disagreement is still rejected. (tmp_path / "fastvideo_inference.json").write_text(json.dumps({**four_step, "video_scheduler_shift": 10.0})) with pytest.raises(ValueError, match="disagrees"): - _pipeline(tmp_path, video_shift=12.0).initialize_pipeline(make_resolved_config(MiniMaxH3PipelineConfig())) + _pipeline(tmp_path, video_shift=12.0).initialize_pipeline(resolved_config) diff --git a/fastvideo/tests/stages/test_minimax_h3_sequential_start.py b/fastvideo/tests/stages/test_minimax_h3_sequential_start.py index 16467a61b..e7c7978b0 100644 --- a/fastvideo/tests/stages/test_minimax_h3_sequential_start.py +++ b/fastvideo/tests/stages/test_minimax_h3_sequential_start.py @@ -199,7 +199,8 @@ def test_lazy_module_load_owns_deferral_when_both_would_arm(monkeypatch) -> None monkeypatch.setattr(ComposedPipelineBase, "load_modules", fake_load) monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", lambda device_id: True) - MiniMaxH3Pipeline("unused/for-this-test", _h3_config(sequential_load=True)) + # Resolution turns lazy_module_load on for unified memory; the pipeline reads that decision. + MiniMaxH3Pipeline("unused/for-this-test", _h3_config(lazy_module_load=True, sequential_load=True)) assert loads == [list(MiniMaxH3Pipeline._required_config_modules)] assert all(name in loads[0] for name in _DENOISE_MODULE_NAMES) diff --git a/fastvideo/tests/worker/test_gpu_worker.py b/fastvideo/tests/worker/test_gpu_worker.py index d407e7d7f..a8910fec8 100644 --- a/fastvideo/tests/worker/test_gpu_worker.py +++ b/fastvideo/tests/worker/test_gpu_worker.py @@ -41,9 +41,9 @@ def test_cuda_device_uuid_receipt_identifies_profiled_worker(monkeypatch, env_ov @pytest.mark.parametrize("executor_backend", ["mp", "ray"]) -def test_init_device_applies_offload_policy_after_binding_worker_device(monkeypatch, env_overrides, - executor_backend: str) -> None: - """The runtime probe must see this worker's device, never driver device 0, and the worker keeps its result.""" +def test_init_device_binds_the_worker_device_and_keeps_the_resolved_config(monkeypatch, env_overrides, + executor_backend: str) -> None: + """The worker binds its own device and builds the pipeline on the config it received, without a device query.""" events = [] with isolated_environment(): args = resolve_inference_config({ @@ -53,13 +53,8 @@ def test_init_device_applies_offload_policy_after_binding_worker_device(monkeypa "execution_backend": executor_backend }, }) - decided = args.with_override("test:device_policy", {"engine.offload.lazy_module_load": False}) - - def fake_policy(resolved_config, device_id): - events.append(("policy", device_id)) - return decided - - monkeypatch.setattr("fastvideo.worker.gpu_worker.finalize_device_offload_policy", fake_policy) + probe = Mock(side_effect=AssertionError("device probe ran in the worker")) + monkeypatch.setattr("fastvideo.platforms.current_platform.has_unified_memory", probe) worker = Worker(args, local_rank=3, rank=3, distributed_init_method="env://") env_overrides.enter_context(envs.override_external("LOCAL_RANK", "0")) @@ -77,23 +72,34 @@ def test_init_device_applies_offload_policy_after_binding_worker_device(monkeypa assert events == [ ("set_device", 3), - ("policy", 3), ("distributed", None), ("pipeline", None), ] assert os.environ["LOCAL_RANK"] == "3" assert worker.device == torch.device("cuda:3") assert worker.init_gpu_memory == 123 - assert worker.resolved_config is decided + assert worker.resolved_config is args + probe.assert_not_called() def _worker_returning(output_batch: ForwardBatch) -> Worker: worker = Worker.__new__(Worker) worker.resolved_config = SimpleNamespace() - worker.pipeline = SimpleNamespace(resolved_config=SimpleNamespace(), forward=lambda batch, args: output_batch) + worker.pipeline = SimpleNamespace(forward=lambda batch, args: output_batch) return worker +def test_execute_forward_runs_the_pipeline_on_the_worker_config(): + worker = Worker.__new__(Worker) + worker.resolved_config = SimpleNamespace() + seen = [] + worker.pipeline = SimpleNamespace(forward=lambda batch, args: seen.append(args) or batch) + + worker.execute_forward(ForwardBatch(data_type="video", return_frames=True), _request_config()) + + assert seen == [worker.resolved_config] + + def _request_config(output_type: str = "pil") -> SimpleNamespace: """Stand-in for the request's resolved config with the typed path that ``Worker.execute_forward`` reads.""" return SimpleNamespace(pipeline=SimpleNamespace(output_type=output_type)) diff --git a/fastvideo/train/callbacks/validation.py b/fastvideo/train/callbacks/validation.py index d0466a30c..bee45673d 100644 --- a/fastvideo/train/callbacks/validation.py +++ b/fastvideo/train/callbacks/validation.py @@ -1381,19 +1381,20 @@ class ValidationCallback(Callback): stages read. """ tc = self.training_config + validation_pipeline_config = self._validation_pipeline_config( + transformer, + pipeline.resolved_config.pipeline_config, + ) + dmd_denoising_steps = None + if (self.sampling_timesteps is not None + and getattr(validation_pipeline_config, "dmd_denoising_steps", None) is None): + dmd_denoising_steps = [int(s) for s in self.sampling_timesteps] forward_config = build_inference_resolved_config( tc, model_path=tc.model_path, - pipeline_config=self._validation_pipeline_config( - transformer, - pipeline.resolved_config.pipeline_config, - ), + pipeline_config=validation_pipeline_config, + dmd_denoising_steps=dmd_denoising_steps, ) - if (self.sampling_timesteps is not None and forward_config.pipeline.dmd_denoising_steps is None): - forward_config = forward_config.with_override( - "validation_callback:sampling_timesteps", - {"pipeline.dmd_denoising_steps": [int(s) for s in self.sampling_timesteps]}, - ) dit_config = forward_config.pipeline_config.dit_config logger.info( "Validation forward config: local_attn_size=%s sink_size=%s boundary_ratio=%s", diff --git a/fastvideo/train/utils/moduleloader.py b/fastvideo/train/utils/moduleloader.py index 729377e5a..7415bab4b 100644 --- a/fastvideo/train/utils/moduleloader.py +++ b/fastvideo/train/utils/moduleloader.py @@ -15,10 +15,7 @@ from fastvideo.api.inference_resolution import ( ) from fastvideo.api.resolution import ResolutionStep, ResolvedGeneratorConfig from fastvideo.api.schema import ExecutionMode, GeneratorConfig -from fastvideo.api.training_schema import ( - resolve_training_offload_conflicts, - validate_training_parallel_sizes, -) +from fastvideo.api.training_schema import validate_training_parallel_sizes from fastvideo.attention.selector import ( _component_attention_backend_scope, coerce_attn_backend, @@ -90,11 +87,11 @@ def _generator_config_mapping( def _training_resolution_steps(config: GeneratorConfig, defaults: Any) -> tuple[ResolutionStep, ...]: - """Generator resolution steps plus the training offload-conflict and parallel-size checks.""" + """Generator resolution steps plus the training parallel-size check.""" return generator_resolution_steps( config, defaults, - before_placeholders=(resolve_training_offload_conflicts, validate_training_parallel_sizes), + before_placeholders=(validate_training_parallel_sizes, ), ) @@ -132,13 +129,15 @@ def build_inference_resolved_config( *, model_path: str, pipeline_config: PipelineConfig | None = None, + dmd_denoising_steps: list[int] | None = None, ) -> ResolvedGeneratorConfig: """Build the inference-mode resolved config for validation forwards and standalone encoder loads. It has the training parallel layout, the DiT offloaded to the CPU, every other offload off, and ``tc.vsa_sparsity`` as the VSA sparsity. ``pipeline_config`` replaces ``tc.pipeline_config`` as the model - definition. + definition. ``dmd_denoising_steps`` sets ``pipeline.dmd_denoising_steps``, + the DMD schedule that the causal and DMD denoising stages read. """ if pipeline_config is None: pipeline_config = tc.pipeline_config if tc.pipeline_config is not None else PipelineConfig() @@ -150,6 +149,8 @@ def build_inference_resolved_config( ) raw["engine"]["offload"]["dit"] = True raw["engine"]["attention"] = {"vsa_sparsity": tc.vsa_sparsity} + if dmd_denoising_steps is not None: + raw["pipeline"]["dmd_denoising_steps"] = list(dmd_denoising_steps) return resolve_inference_config(raw) diff --git a/fastvideo/training/distillation_pipeline.py b/fastvideo/training/distillation_pipeline.py index c15b170ca..a2ae915c7 100644 --- a/fastvideo/training/distillation_pipeline.py +++ b/fastvideo/training/distillation_pipeline.py @@ -97,19 +97,23 @@ class DistillationPipeline(TrainingPipeline): distillation = resolved_config.training.distillation # The teacher (real score) and the critic (fake score) load as the base Wan transformer, whatever class the # student uses. - teacher_critic_config = resolved_config.with_override( - "DistillationPipeline.load_modules", - {"pipeline.components.override_transformer_cls_name": "WanTransformer3DModel"}) + teacher_critic_cls_name = "WanTransformer3DModel" if distillation.real_score_model_path: logger.info("Loading real score transformer from: %s", distillation.real_score_model_path) # TODO(will): can use deepcopy instead if the model is the same - self.real_score_transformer = self.load_module_from_path(distillation.real_score_model_path, "transformer", - teacher_critic_config) + self.real_score_transformer = self.load_module_from_path( + distillation.real_score_model_path, + "transformer", + resolved_config, + override_transformer_cls_name=teacher_critic_cls_name) modules["real_score_transformer"] = self.real_score_transformer try: - self.real_score_transformer_2 = self.load_module_from_path(distillation.real_score_model_path, - "transformer_2", teacher_critic_config) + self.real_score_transformer_2 = self.load_module_from_path( + distillation.real_score_model_path, + "transformer_2", + resolved_config, + override_transformer_cls_name=teacher_critic_cls_name) logger.info("Loaded real score transformer_2 for MoE support") modules["real_score_transformer_2"] = self.real_score_transformer_2 except Exception: @@ -120,12 +124,18 @@ class DistillationPipeline(TrainingPipeline): if distillation.fake_score_model_path: logger.info("Loading fake score transformer from: %s", distillation.fake_score_model_path) - self.fake_score_transformer = self.load_module_from_path(distillation.fake_score_model_path, "transformer", - teacher_critic_config) + self.fake_score_transformer = self.load_module_from_path( + distillation.fake_score_model_path, + "transformer", + resolved_config, + override_transformer_cls_name=teacher_critic_cls_name) modules["fake_score_transformer"] = self.fake_score_transformer try: - self.fake_score_transformer_2 = self.load_module_from_path(distillation.fake_score_model_path, - "transformer_2", teacher_critic_config) + self.fake_score_transformer_2 = self.load_module_from_path( + distillation.fake_score_model_path, + "transformer_2", + resolved_config, + override_transformer_cls_name=teacher_critic_cls_name) logger.info("Loaded fake score transformer_2 for MoE support") modules["fake_score_transformer_2"] = self.fake_score_transformer_2 except Exception: @@ -265,7 +275,11 @@ class DistillationPipeline(TrainingPipeline): else: logger.info("Generator EMA disabled (ema_decay <= 0.0)") - def load_module_from_path(self, model_path: str, module_type: str, resolved_config: ResolvedGeneratorConfig): + def load_module_from_path(self, + model_path: str, + module_type: str, + resolved_config: ResolvedGeneratorConfig, + override_transformer_cls_name: str | None = None): """ Load a teacher (real score) or critic (fake score) module from a specific path using the same loading logic as the pipeline. @@ -276,6 +290,8 @@ class DistillationPipeline(TrainingPipeline): model_path: Path to the model module_type: Type of module to load (e.g., "transformer") resolved_config: The config to load the module with + override_transformer_cls_name: The transformer class to build, over + ``pipeline.components.override_transformer_cls_name`` Returns: The loaded module @@ -311,6 +327,7 @@ class DistillationPipeline(TrainingPipeline): transformers_or_diffusers=transformers_or_diffusers, resolved_config=resolved_config, loading_teacher_critic_model=True, + override_transformer_cls_name=override_transformer_cls_name, ) logger.info("Successfully loaded %s from %s", module_type, component_path) diff --git a/fastvideo/training/matrixgame2_self_forcing_distillation_pipeline.py b/fastvideo/training/matrixgame2_self_forcing_distillation_pipeline.py index 2e40e21be..34b1f66fb 100644 --- a/fastvideo/training/matrixgame2_self_forcing_distillation_pipeline.py +++ b/fastvideo/training/matrixgame2_self_forcing_distillation_pipeline.py @@ -57,10 +57,7 @@ class MatrixGame2SelfForcingDistillationPipeline(SelfForcingDistillationPipeline loaded_modules, ) # The teacher (real score) and critic (fake score) load as the bidirectional MatrixGame2WanModel class. - teacher_config = resolved_config.with_override( - "MatrixGame2SelfForcingDistillationPipeline.load_modules", - {"pipeline.components.override_transformer_cls_name": "MatrixGame2WanModel"}, - ) + teacher_cls_name = "MatrixGame2WanModel" if loaded_modules is not None and "real_score_transformer" in loaded_modules: self.real_score_transformer = loaded_modules["real_score_transformer"] elif resolved_config.training.distillation.real_score_model_path: @@ -71,7 +68,8 @@ class MatrixGame2SelfForcingDistillationPipeline(SelfForcingDistillationPipeline self.real_score_transformer = self.load_module_from_path( resolved_config.training.distillation.real_score_model_path, "transformer", - teacher_config, + resolved_config, + override_transformer_cls_name=teacher_cls_name, ) else: raise ValueError("real_score_model_path is required for DMD distillation pipeline") @@ -87,7 +85,8 @@ class MatrixGame2SelfForcingDistillationPipeline(SelfForcingDistillationPipeline self.fake_score_transformer = self.load_module_from_path( resolved_config.training.distillation.fake_score_model_path, "transformer", - teacher_config, + resolved_config, + override_transformer_cls_name=teacher_cls_name, ) else: raise ValueError("fake_score_model_path is required for DMD distillation pipeline") diff --git a/fastvideo/worker/gpu_worker.py b/fastvideo/worker/gpu_worker.py index f4a1f7bb3..ab9a9e59b 100644 --- a/fastvideo/worker/gpu_worker.py +++ b/fastvideo/worker/gpu_worker.py @@ -4,7 +4,6 @@ from typing import Any, cast import torch import fastvideo.envs as envs -from fastvideo.api.device_policy import finalize_device_offload_policy from fastvideo.api.resolution import ResolvedGeneratorConfig from fastvideo.distributed import (cleanup_dist_env_and_memory, maybe_init_distributed_environment_and_model_parallel) from fastvideo.distributed.parallel_state import get_local_torch_device @@ -80,13 +79,6 @@ class Worker: # For MPS, we can't get memory info the same way self.init_gpu_memory = 0 - # CUDA's unified-memory classification reads runtime device - # properties, so make this decision only after this worker has bound - # its own device. The worker keeps the config that the policy returns, - # and every loader and pipeline stage below consumes it. - device_id = self.device.index if self.device.index is not None else 0 - self.resolved_config = finalize_device_offload_policy(self.resolved_config, device_id) - # Initialize the distributed environment. maybe_init_distributed_environment_and_model_parallel(self.resolved_config.engine.parallelism.tp_size, self.resolved_config.engine.parallelism.sp_size, @@ -95,8 +87,7 @@ class Worker: self.pipeline = build_pipeline(self.resolved_config) def execute_forward(self, forward_batch: ForwardBatch, resolved_config: ResolvedGeneratorConfig) -> ForwardBatch: - # The pipeline's config carries the overrides that the pipeline made from its checkpoint. - output_batch = self.pipeline.forward(forward_batch, self.pipeline.resolved_config) + output_batch = self.pipeline.forward(forward_batch, self.resolved_config) needs_output = forward_batch.return_frames or (forward_batch.save_video and resolved_config.pipeline.output_type != "latent" and not output_batch.extra.get("audio_only")) diff --git a/tests/local_tests/flux2/README.md b/tests/local_tests/flux2/README.md index 7ee014d06..aad931e50 100644 --- a/tests/local_tests/flux2/README.md +++ b/tests/local_tests/flux2/README.md @@ -83,7 +83,7 @@ pytest tests/local_tests/flux2/test_flux2_component_parity.py::test_flux2_mistra | Full pipeline smoke | [`../pipelines/test_flux2_pipeline_smoke.py`](../pipelines/test_flux2_pipeline_smoke.py) | Full Flux2 Mistral3/AutoProcessor wiring; short latent generate | `PASSED on Modal L40S:2` | | Pipeline parity | [`../pipelines/test_flux2_pipeline_parity.py`](../pipelines/test_flux2_pipeline_parity.py) | Four-step denoised latent parity vs `diffusers.Flux2KleinPipeline` | `PASSED on Modal L40S` | | Full pipeline parity | [`../pipelines/test_flux2_pipeline_parity.py`](../pipelines/test_flux2_pipeline_parity.py) | Short full Flux2 latent parity vs `diffusers.Flux2Pipeline` | `PASSED on Modal L40S:2, L40S:4, and H100:1` | -| Pipeline TP2 parity | [`../pipelines/test_flux2_pipeline_parity.py`](../pipelines/test_flux2_pipeline_parity.py) | Two-worker tensor-parallel load/generate with `num_gpus=2`, `tp_size=2`, `sp_size=1` | `PASSED on Modal L40S:2` | +| Pipeline TP2 parity | [`../pipelines/test_flux2_pipeline_parity.py`](../pipelines/test_flux2_pipeline_parity.py) | Two-worker tensor-parallel load/generate with `engine.num_gpus: 2`, `tp_size=2`, `sp_size=1` | `PASSED on Modal L40S:2` | | Pixel image comparison | Modal image runner | Same-prompt Diffusers vs FastVideo PNG generation and pixel metrics | `PASSED on Modal L40S` | ## Latest Remote Evidence @@ -116,7 +116,7 @@ Flux2 modal L40S:2 statuses: component=0 smoke=0 pipeline=0 ``` The `L40S:2` run verifies the same parity suite in a two-GPU Modal allocation. -These tests currently instantiate FastVideo with `num_gpus=1`, so this is not a +These tests currently instantiate FastVideo with `engine.num_gpus: 1`, so this is not a tensor-parallel two-GPU parity test. Additional Modal `L40S:4` allocation run `ap-tQEUnFr00uOvpMZdOngebQ` applied @@ -132,7 +132,7 @@ Flux2 modal L40S:4 statuses: component=0 smoke=0 pipeline=0 Modal `L40S:2` tensor-parallel run `ap-szNgcJRiUv11lmmNFvjjPT` applied patch `patches/flux2-local-tp2-c850fcad.patch`, confirmed two visible L40S devices, -and instantiated FastVideo with `num_gpus=2`, `tp_size=2`, `sp_size=1`, +and instantiated FastVideo with `engine.num_gpus: 2`, `tp_size=2`, `sp_size=1`, `executor_world_size=2`. ```text @@ -172,7 +172,7 @@ tests/local_tests/pipelines/test_flux2_pipeline_parity.py -v -s: 2 passed The pipeline parity file covered both strict single-GPU latent parity and true TP2 latent parity. The strict path reported zero max/mean/median diff for all four trajectory steps and final latents. The TP2 path instantiated FastVideo -with `num_gpus=2`, `tp_size=2`, `sp_size=1`, and `executor_world_size=2`. +with `engine.num_gpus: 2`, `tp_size=2`, `sp_size=1`, and `executor_world_size=2`. ```text TP2 final diff max=2.107544 mean=0.020110 median=0.015625 @@ -231,7 +231,7 @@ Current-session Modal evidence: `0.062500`, mean `0.008581`, median `0.007812`; only `9/8192` latent entries hit the max bucket. - Modal `L40S:4` run `ap-KKOzv9THDmTYt3gevhQkVR` passed full pipeline latent - parity with true TP4 (`num_gpus=4`, `tp_size=4`, `sp_size=1`). Final latent + parity with true TP4 (`engine.num_gpus: 4`, `tp_size=4`, `sp_size=1`). Final latent diff max stayed `0.062500`, mean was `0.007946`, and median was `0.007812`. - Modal `L40S:4` diagnostic run `ap-SlhykTTLxzsYxnsCUbCH7S` reproduced the TP4 result with max `0.062500`, mean `0.007946`, median `0.007812`; only `6/8192` diff --git a/tests/local_tests/gamecraft/test_gamecraft_pipeline_parity.py b/tests/local_tests/gamecraft/test_gamecraft_pipeline_parity.py index fbe9cb4a7..7955306b6 100644 --- a/tests/local_tests/gamecraft/test_gamecraft_pipeline_parity.py +++ b/tests/local_tests/gamecraft/test_gamecraft_pipeline_parity.py @@ -330,12 +330,18 @@ def test_gamecraft_pipeline_latent_parity(): # Create generator generator = VideoGenerator.from_pretrained( diffusers_path, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=True, # Save memory - text_encoder_cpu_offload=True, - pin_cpu_memory=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": True, # Save memory + "text_encoder": True, + "pin_cpu_memory": False, + }, + }, + }, ) # Run generation @@ -481,12 +487,18 @@ def test_gamecraft_pipeline_smoke(): generator = VideoGenerator.from_pretrained( diffusers_path, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=True, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": True, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": False, + }, + }, + }, ) result = generator.generate({ diff --git a/tests/local_tests/gen3c/test_gen3c_pipeline_smoke.py b/tests/local_tests/gen3c/test_gen3c_pipeline_smoke.py index 23c77a1ec..a692597a0 100644 --- a/tests/local_tests/gen3c/test_gen3c_pipeline_smoke.py +++ b/tests/local_tests/gen3c/test_gen3c_pipeline_smoke.py @@ -214,11 +214,17 @@ def test_gen3c_full_pipeline_smoke(): generator = VideoGenerator.from_pretrained( diffusers_path, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": False, + }, + }, + }, ) result = generator.generate({ "prompt": prompt, diff --git a/tests/local_tests/glm_image/test_edit_pipeline_parity.py b/tests/local_tests/glm_image/test_edit_pipeline_parity.py index df8a4fbb6..fbec083f9 100644 --- a/tests/local_tests/glm_image/test_edit_pipeline_parity.py +++ b/tests/local_tests/glm_image/test_edit_pipeline_parity.py @@ -98,7 +98,15 @@ def _fastvideo_edit_image(device) -> np.ndarray: except ImportError as e: pytest.skip(f"FastVideo VideoGenerator unavailable: {e}") condition = Image.open(CONDITION_IMAGE).convert("RGB") - gen = VideoGenerator.from_pretrained(str(LOCAL_WEIGHTS_DIR), num_gpus=1, trust_remote_code=True) + gen = VideoGenerator.from_pretrained( + str(LOCAL_WEIGHTS_DIR), + { + "engine": { + "num_gpus": 1, + }, + "trust_remote_code": True, + }, + ) result = gen.generate({ "prompt": EDIT_PROMPT, "inputs": {"pil_image": condition}, diff --git a/tests/local_tests/glm_image/test_pipeline_parity.py b/tests/local_tests/glm_image/test_pipeline_parity.py index bd83d7625..9be0406ff 100644 --- a/tests/local_tests/glm_image/test_pipeline_parity.py +++ b/tests/local_tests/glm_image/test_pipeline_parity.py @@ -200,7 +200,15 @@ def _fastvideo_image(device) -> np.ndarray: from fastvideo import VideoGenerator except ImportError as e: pytest.skip(f"FastVideo VideoGenerator unavailable: {e}") - gen = VideoGenerator.from_pretrained(str(LOCAL_WEIGHTS_DIR), num_gpus=1, trust_remote_code=True) + gen = VideoGenerator.from_pretrained( + str(LOCAL_WEIGHTS_DIR), + { + "engine": { + "num_gpus": 1, + }, + "trust_remote_code": True, + }, + ) result = gen.generate({ "prompt": SAMPLE_PROMPT, "sampling": { diff --git a/tests/local_tests/magi_human/test_magi_human_pipeline_smoke.py b/tests/local_tests/magi_human/test_magi_human_pipeline_smoke.py index c4a8715e4..d1ef79e5d 100644 --- a/tests/local_tests/magi_human/test_magi_human_pipeline_smoke.py +++ b/tests/local_tests/magi_human/test_magi_human_pipeline_smoke.py @@ -212,11 +212,17 @@ def test_magi_human_pipeline_smoke() -> None: generator = VideoGenerator.from_pretrained( diffusers_path, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": False, + }, + }, + }, ) try: result = generator.generate({ diff --git a/tests/local_tests/pipelines/test_lingbot_video_pipeline_smoke.py b/tests/local_tests/pipelines/test_lingbot_video_pipeline_smoke.py index 7325f060d..e0d8696e1 100644 --- a/tests/local_tests/pipelines/test_lingbot_video_pipeline_smoke.py +++ b/tests/local_tests/pipelines/test_lingbot_video_pipeline_smoke.py @@ -146,15 +146,25 @@ def test_lingbot_video_pipeline_load_generate_smoke(tmp_path: Path) -> None: ) generator = VideoGenerator.from_pretrained( str(model_dir), - num_gpus=num_gpus, - sp_size=sp_size, - use_fsdp_inference=use_fsdp_inference, - dit_cpu_offload=False, - dit_layerwise_offload=False, - vae_cpu_offload=True, - text_encoder_cpu_offload=True, - pin_cpu_memory=False, - output_type="latent", + { + "engine": { + "num_gpus": num_gpus, + "parallelism": { + "sp_size": sp_size, + }, + "use_fsdp_inference": use_fsdp_inference, + "offload": { + "dit": False, + "dit_layerwise": False, + "vae": True, + "text_encoder": True, + "pin_cpu_memory": False, + }, + }, + "pipeline": { + "output_type": "latent", + }, + }, ) try: result = generator.generate({ diff --git a/tests/local_tests/pipelines/test_zimage_pipeline_parity.py b/tests/local_tests/pipelines/test_zimage_pipeline_parity.py index ecf61b175..851d55d27 100644 --- a/tests/local_tests/pipelines/test_zimage_pipeline_parity.py +++ b/tests/local_tests/pipelines/test_zimage_pipeline_parity.py @@ -290,16 +290,26 @@ def test_zimage_pipeline_latents_match_pinned_native_repo(tmp_path: Path) -> Non generator = VideoGenerator.from_pretrained( str(MODEL_DIR), - num_gpus=1, - tp_size=1, - sp_size=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - dit_layerwise_offload=False, - text_encoder_cpu_offload=False, - vae_cpu_offload=False, - pin_cpu_memory=False, - output_type="latent", + { + "engine": { + "num_gpus": 1, + "parallelism": { + "tp_size": 1, + "sp_size": 1, + }, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "dit_layerwise": False, + "text_encoder": False, + "vae": False, + "pin_cpu_memory": False, + }, + }, + "pipeline": { + "output_type": "latent", + }, + }, ) try: result = generator.generate({ diff --git a/tests/local_tests/pipelines/test_zimage_pipeline_smoke.py b/tests/local_tests/pipelines/test_zimage_pipeline_smoke.py index 50546c072..3d0dd1fda 100644 --- a/tests/local_tests/pipelines/test_zimage_pipeline_smoke.py +++ b/tests/local_tests/pipelines/test_zimage_pipeline_smoke.py @@ -115,16 +115,26 @@ def test_zimage_pipeline_load_generate_smoke() -> None: generator = VideoGenerator.from_pretrained( str(model_dir), - num_gpus=1, - tp_size=1, - sp_size=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - dit_layerwise_offload=False, - text_encoder_cpu_offload=False, - vae_cpu_offload=False, - pin_cpu_memory=False, - output_type="latent", + { + "engine": { + "num_gpus": 1, + "parallelism": { + "tp_size": 1, + "sp_size": 1, + }, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "dit_layerwise": False, + "text_encoder": False, + "vae": False, + "pin_cpu_memory": False, + }, + }, + "pipeline": { + "output_type": "latent", + }, + }, ) try: result = generator.generate({ diff --git a/tests/local_tests/stable_audio/test_stable_audio_a2a_parity.py b/tests/local_tests/stable_audio/test_stable_audio_a2a_parity.py index 920b4a9cb..a2f2cbf8b 100644 --- a/tests/local_tests/stable_audio/test_stable_audio_a2a_parity.py +++ b/tests/local_tests/stable_audio/test_stable_audio_a2a_parity.py @@ -113,11 +113,17 @@ def test_stable_audio_a2a_official_parity(): from fastvideo import VideoGenerator generator = VideoGenerator.from_pretrained( _FV_REPO_ID, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": False, + }, + }, + }, ) try: result = generator.generate({ diff --git a/tests/local_tests/stable_audio/test_stable_audio_inpaint_parity.py b/tests/local_tests/stable_audio/test_stable_audio_inpaint_parity.py index 6753fbeda..ac9146ee2 100644 --- a/tests/local_tests/stable_audio/test_stable_audio_inpaint_parity.py +++ b/tests/local_tests/stable_audio/test_stable_audio_inpaint_parity.py @@ -69,11 +69,17 @@ def test_stable_audio_inpaint_kept_region_preserved(): from fastvideo import VideoGenerator generator = VideoGenerator.from_pretrained( _FV_REPO_ID, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": False, + }, + }, + }, ) try: result = generator.generate({ diff --git a/tests/local_tests/stable_audio/test_stable_audio_pipeline_parity.py b/tests/local_tests/stable_audio/test_stable_audio_pipeline_parity.py index 2ef2675f1..8a91b64c3 100644 --- a/tests/local_tests/stable_audio/test_stable_audio_pipeline_parity.py +++ b/tests/local_tests/stable_audio/test_stable_audio_pipeline_parity.py @@ -161,11 +161,17 @@ def test_stable_audio_pipeline_official_parity(): from fastvideo import VideoGenerator generator = VideoGenerator.from_pretrained( _FV_REPO_ID, - num_gpus=1, - use_fsdp_inference=False, - dit_cpu_offload=False, - vae_cpu_offload=False, - text_encoder_cpu_offload=False, + { + "engine": { + "num_gpus": 1, + "use_fsdp_inference": False, + "offload": { + "dit": False, + "vae": False, + "text_encoder": False, + }, + }, + }, ) try: result = generator.generate({