Every example calls VideoGenerator.generate with a nested request instead of generate_video keywords, and passes settings outside the from_pretrained convenience keywords through VideoGenerator.from_config at their typed paths. Each request and generator config equals what the keyword call built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012M91wnVFmPEvJ9h39r5BH7
33 lines
943 B
Python
33 lines
943 B
Python
from fastvideo import VideoGenerator
|
|
|
|
OUTPUT_PATH = "video_samples_kandinsky5_i2v"
|
|
|
|
IMAGE_PATH = "assets/girl.png"
|
|
|
|
|
|
def main():
|
|
generator = VideoGenerator.from_pretrained(
|
|
"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,
|
|
)
|
|
|
|
prompt = ("A woman stands up and walks away")
|
|
_ = generator.generate({
|
|
"prompt": prompt,
|
|
"inputs": {"image_path": IMAGE_PATH},
|
|
"sampling": {"height": 1024, "width": 1024, "num_frames": 121},
|
|
"output": {"output_path": OUTPUT_PATH, "save_video": True},
|
|
})
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|