From 2cfcb7b85fc01238574bdd1973c6cb798395ff9b Mon Sep 17 00:00:00 2001 From: Will Lin Date: Sat, 4 Jul 2026 00:16:39 +0000 Subject: [PATCH] [bugfix]: fix kandinsky5 registry detectors and distilled repo name The i2v detector matched any path containing 'i2v' without excluding 't2v', misrouting T2V checkpoints stored under i2v-containing directories. The variant detectors all require lite/pro tokens, so the model_index _class_name fallback ('kandinsky5t2vpipeline') could never match and I2V-Lite-distilled checkpoints had no detector at all; add base T2V/I2V fallback registrations after the variants. Also fix the registered Lite distilled repo to the real kandinskylab/Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers (the old name 404s) and correct the example comments. Co-Authored-By: Claude Fable 5 --- .../inference/basic/basic_kandinsky5_t2v.py | 6 +-- fastvideo/registry.py | 37 ++++++++++++++++++- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/examples/inference/basic/basic_kandinsky5_t2v.py b/examples/inference/basic/basic_kandinsky5_t2v.py index bfb52c044..45e8aa72b 100644 --- a/examples/inference/basic/basic_kandinsky5_t2v.py +++ b/examples/inference/basic/basic_kandinsky5_t2v.py @@ -4,10 +4,10 @@ OUTPUT_PATH = "video_samples_kandinsky5_t2v" def main(): generator = VideoGenerator.from_pretrained( - "kandinskylab/Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers", + "kandinskylab/Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers", # "kandinskylab/Kandinsky-5.0-T2V-Pro-sft-5s-Diffusers" - # "kandinskylab/Kandinsky-5.0-T2V-Lite-Distilled-5s-Diffusers" - # "kandinskylab/Kandinsky-5.0-T2V-Pro-Distilled-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, diff --git a/fastvideo/registry.py b/fastvideo/registry.py index 2a14cada2..9056d530d 100644 --- a/fastvideo/registry.py +++ b/fastvideo/registry.py @@ -507,8 +507,12 @@ def _register_configs() -> None: return _is_kandinsky5(path_lower) and "t2v" in path_lower and "i2v" not in path_lower def _is_kandinsky5_i2v(path: str) -> bool: + # Exclude "t2v" so a T2V checkpoint stored under an i2v-containing + # directory (e.g. ~/i2v_experiments/kandinsky5-t2v-ft) is not + # misrouted; ambiguous paths fall through to the model_index + # _class_name fallback detectors below. path_lower = path.lower() - return _is_kandinsky5(path_lower) and "i2v" in path_lower + return _is_kandinsky5(path_lower) and "i2v" in path_lower and "t2v" not in path_lower def _is_kandinsky5_t2v_lite(path: str) -> bool: path_lower = path.lower() @@ -575,7 +579,7 @@ def _register_configs() -> None: pipeline_config_cls=Kandinsky5T2VConfig, workload_types=(WorkloadType.T2V, ), hf_model_paths=[ - "kandinskylab/Kandinsky-5.0-T2V-Lite-distilled-5s-Diffusers", + "kandinskylab/Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers", ], model_detectors=[ _is_kandinsky5_t2v_lite_distilled, @@ -639,6 +643,35 @@ def _register_configs() -> None: default_preset="kandinsky5_i2v_pro_distilled_5s", ) + # Kandinsky5 fallbacks — registered AFTER the variant detectors so those + # win first-match. Catch checkpoints the variant detectors cannot resolve: + # token-less local paths matched via the model_index _class_name + # ("kandinsky5t2vpipeline" carries no lite/pro marker), variant combos + # without a dedicated entry (e.g. I2V Lite distilled), and t2v+i2v + # ambiguous paths resolved by the checkpoint's _class_name. + register_configs( + sampling_param_cls=None, + pipeline_config_cls=Kandinsky5T2VConfig, + workload_types=(), + model_detectors=[ + _is_kandinsky5_t2v, + ], + model_family="kandinsky5", + default_preset="kandinsky5_t2v_lite_5s", + pipeline_cls_name="Kandinsky5T2VPipeline", + ) + register_configs( + sampling_param_cls=None, + pipeline_config_cls=Kandinsky5I2VConfig, + workload_types=(), + model_detectors=[ + _is_kandinsky5_i2v, + ], + model_family="kandinsky5", + default_preset="kandinsky5_i2v_lite_5s", + pipeline_cls_name="Kandinsky5I2VPipeline", + ) + # LongCat (T2V, I2V, VC use same config; workload varies by path) register_configs( sampling_param_cls=None,