diff --git a/examples/inference/basic/basic_ltx2.py b/examples/inference/basic/basic_ltx2.py index d8acd56bc..cf188ddac 100644 --- a/examples/inference/basic/basic_ltx2.py +++ b/examples/inference/basic/basic_ltx2.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 from fastvideo import VideoGenerator PROMPT = ( @@ -14,17 +15,22 @@ PROMPT = ( "absurd, and quietly tragic." ) +# HF model ID (base LTX-2, 40-step schedule). +MODEL_ID = "FastVideo/LTX2-Diffusers" + +OUTPUT_PATH = "outputs_video/ltx2_basic/output_ltx2_base_t2v.mp4" + def main() -> None: generator = VideoGenerator.from_pretrained( - "FastVideo/LTX2-Distilled-Diffusers", - num_gpus=1, + MODEL_ID, + num_gpus=8, ) - output_path = "outputs_video/ltx2_basic/output_ltx2_distilled_t2v.mp4" generator.generate_video( prompt=PROMPT, - output_path=output_path, + output_path=OUTPUT_PATH, + num_inference_steps=40, save_video=True, ) generator.shutdown() diff --git a/fastvideo/registry.py b/fastvideo/registry.py index 28667e17a..e274dbfcb 100644 --- a/fastvideo/registry.py +++ b/fastvideo/registry.py @@ -247,6 +247,11 @@ def _register_configs() -> None: hf_model_paths=[ "Lightricks/LTX-2", "FastVideo/LTX2-base", + "FastVideo/LTX2-Diffusers", + ], + model_detectors=[ + lambda path: + ("ltx2" in path.lower() and "distilled" not in path.lower()), ], ) # LTX-2 (distilled) @@ -256,6 +261,10 @@ def _register_configs() -> None: hf_model_paths=[ "FastVideo/LTX2-Distilled-Diffusers", ], + model_detectors=[ + lambda path: + ("ltx2" in path.lower() and "distilled" in path.lower()), + ], ) # Hunyuan 1.5 (specific) diff --git a/scripts/huggingface/download_hf.py b/scripts/huggingface/download_hf.py index f3c37ac5d..a400476e9 100644 --- a/scripts/huggingface/download_hf.py +++ b/scripts/huggingface/download_hf.py @@ -33,4 +33,6 @@ if __name__ == "__main__": repo_type=args.repo_type, local_dir_use_symlinks=False, resume_download=True, + allow_patterns="*.safetensors", + ignore_patterns=["audio_vae/*", "vocoder/*", "latent_upsampler/*", "vaes/*", "schedulers/*", "upsamplers/*", "text_encoder/*", "tokenizer/*", "transformer/*", "connectors/*"] ) diff --git a/scripts/huggingface/upload_hf.py b/scripts/huggingface/upload_hf.py index 1e4ce88b7..273a92b02 100644 --- a/scripts/huggingface/upload_hf.py +++ b/scripts/huggingface/upload_hf.py @@ -2,8 +2,13 @@ from huggingface_hub import HfApi api = HfApi() +repo_id = "FastVideo/LTX2-Diffusers" + +# Create the repo if it doesn't exist +api.create_repo(repo_id=repo_id, repo_type="model", exist_ok=True) + api.upload_folder( - folder_path="Wan2.2-TI2V-5B-Diffusers", - repo_id="FastVideo/FastWan2.2-TI2V-5B-Diffusers", + folder_path="ltx_base_diffusers", + repo_id=repo_id, repo_type="model", )