- ComposedPipelineBase owns a ComponentState: it records each component's path after loading and attaches the state to every stage it registers. from_pretrained(model_path, *, resolved_config, ...) takes a resolved config instead of building FastVideoArgs from keywords or argparse; the training_args alias and TrainingArgs checks are gone, and the training DiT offload is a recorded override. Compile settings come from engine.compile and torch_compile_kwargs(); LoRA settings from pipeline.components.lora_* and training.lora.*. - The worker and executors read engine.num_gpus, engine.parallelism.*, engine.execution_backend, and pipeline.output_type; the Ray executor owns its placement group and runtime env. - VideoGenerator builds from a resolved config only (_from_resolved_config); the prompt_txt fallback is gone (requests carry inputs.prompt_path). The OpenAI server state holds the resolved config (get_resolved_config()). - Tests use resolved configs; the SSIM and performance helpers map their settings to dotted typed paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012M91wnVFmPEvJ9h39r5BH7
52 lines
2.5 KiB
Python
52 lines
2.5 KiB
Python
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
from fastvideo.api.presets import get_preset
|
|
from fastvideo.api.sampling_param import SamplingParam
|
|
from fastvideo.api.schema import WorkloadType
|
|
from fastvideo.models.wan.pipeline_config import LucyEditDevConfig
|
|
from fastvideo.pipelines.basic.wan.lucy_edit_pipeline import LucyEditPipeline
|
|
from fastvideo.pipelines.pipeline_registry import PipelineType, get_pipeline_registry
|
|
from fastvideo.registry import get_default_preset, get_pipeline_config_cls_from_name
|
|
|
|
|
|
def test_lucy_edit_registry_and_preset() -> None:
|
|
import fastvideo.registry # noqa: F401
|
|
|
|
preset = get_preset("lucy_edit_dev", "wan")
|
|
assert preset.model_family == "wan"
|
|
assert preset.defaults["height"] == 480
|
|
assert preset.defaults["width"] == 832
|
|
assert preset.defaults["num_frames"] == 81
|
|
|
|
config = LucyEditDevConfig()
|
|
assert config.lucy_edit_task is True
|
|
assert config.ti2v_task is False
|
|
assert config.dit_config.arch_config.out_channels == 48
|
|
assert config.dit_config.arch_config.in_channels == 96
|
|
assert config.vae_config.arch_config.z_dim == 48
|
|
assert config.dit_config.arch_config.in_channels == config.vae_config.arch_config.z_dim * 2
|
|
assert get_default_preset("decart-ai/Lucy-Edit-Dev") == "lucy_edit_dev"
|
|
assert get_default_preset("decart-ai/Lucy-Edit-1.1-Dev") == "lucy_edit_dev"
|
|
assert get_pipeline_config_cls_from_name("decart-ai/Lucy-Edit-Dev") is LucyEditDevConfig
|
|
assert get_pipeline_config_cls_from_name("decart-ai/Lucy-Edit-1.1-Dev") is LucyEditDevConfig
|
|
|
|
sampling_param = SamplingParam.from_pretrained("decart-ai/Lucy-Edit-Dev")
|
|
assert sampling_param.height == 480
|
|
assert sampling_param.width == 832
|
|
assert sampling_param.num_frames == 81
|
|
assert sampling_param.fps == 24
|
|
assert sampling_param.guidance_scale == 5.0
|
|
assert sampling_param.negative_prompt == ""
|
|
|
|
sampling_param_1_1 = SamplingParam.from_pretrained("decart-ai/Lucy-Edit-1.1-Dev")
|
|
assert sampling_param_1_1.height == 480
|
|
assert sampling_param_1_1.width == 832
|
|
assert sampling_param_1_1.num_frames == 81
|
|
assert sampling_param_1_1.fps == 24
|
|
assert sampling_param_1_1.guidance_scale == 5.0
|
|
assert sampling_param_1_1.negative_prompt == ""
|
|
|
|
# FastVideo has no V2V workload enum today; model_index dispatches Lucy by pipeline class name.
|
|
registry = get_pipeline_registry(PipelineType.BASIC)
|
|
assert registry.resolve_pipeline_cls("LucyEditPipeline", PipelineType.BASIC, WorkloadType.T2V) is LucyEditPipeline
|