FastVideo icon indicating copy to clipboard operation
FastVideo copied to clipboard

New optimizations

Open vaskers5 opened this issue 7 months ago • 1 comments

vaskers5 avatar Jul 10 '25 08:07 vaskers5

Hi @vaskers5

Thanks for your contributions!

First, could you please run pre-commit on your PR with the following commands: pre-commit install --hook-type pre-commit --hook-type commit-msg pre-commit run --all-files

Second, for the example scripts in your PR, it would be great if you could update them to be directly runnable. Do you have a set of lora adapters you combined and tested?

For your optimizations example, below is the version I modified to run (feel free to just copy my version for your PR) and observe some artifacts with your current settings. Do you have some guidance on configuring the optimizations arguments that you've found in your experiments?

Below is the output and script I used:

https://github.com/user-attachments/assets/a2759e7c-5074-4205-abde-9fab436b5b69

from fastvideo import VideoGenerator
from fastvideo.v1.configs.sample import SamplingParam


OUTPUT_PATH = "./optimized_output"


def main():
    """Run WanVideo2.1 I2V pipeline with all optimizations enabled."""
    generator = VideoGenerator.from_pretrained(
        "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers",
        num_gpus=1,
        skip_layer_guidance=0.2,
        use_normalized_attention=True,
        nag_scale=1.5,
        nag_tau=2.5,
        nag_alpha=0.125,
        use_dcm=True,
        use_taylor_seer=True,
        taylor_seer_order=2,
    )

    sampling = SamplingParam.from_pretrained("Wan-AI/Wan2.1-I2V-14B-480P-Diffusers")
    sampling.image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"

    # prompt = "A lone explorer crosses a vast alien desert under twin moons"
    prompt = "An astronaut in a spacesuit is emerging from an eggshell"
    generator.generate_video(
        prompt,
        sampling_param=sampling,
        output_path=OUTPUT_PATH,
        save_video=True,
    )


if __name__ == "__main__":
    main()

SolitaryThinker avatar Jul 10 '25 19:07 SolitaryThinker