text_encoder_cpu_offload=True makes the Qwen encoder compute on CPU, where flash-attn has no kernels; with flash_attn installed both examples crash in the first text-encoding forward. The offloaded path only worked in envs without flash_attn via the silent SDPA fallback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
38 lines
921 B
Python
38 lines
921 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=False,
|
|
pin_cpu_memory=True,
|
|
# image_encoder_cpu_offload=False,
|
|
)
|
|
|
|
prompt = (
|
|
"A woman stands up and walks away"
|
|
)
|
|
_ = generator.generate_video(
|
|
prompt,
|
|
image_path=IMAGE_PATH,
|
|
output_path=OUTPUT_PATH,
|
|
save_video=True,
|
|
height=1024,
|
|
width=1024,
|
|
num_frames=121,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|