Kandinsky 5 10 sec (NABLA suport) by leffff · Pull Request #12520 · huggingface/diffusers (original) (raw)
This PR adds support for 10 sec Kandinsky 5.0 model herd.
import torch from diffusers import Kandinsky5T2VPipeline from diffusers.utils import export_to_video
Load the pipeline
pipe = Kandinsky5T2VPipeline.from_pretrained( "ai-forever/Kandinsky-5.0-T2V-Lite-sft-10s-Diffusers", torch_dtype=torch.bfloat16 ) pipe = pipe.to("cuda")
Generate video
prompt = [ "Photorealistic closeup video of two intricately detailed pirate ships locked in a fierce battle, complete with cannon fire and billowing sails, as they sail through the swirling waters of a steaming cup of coffee. The ships are miniature but highly realistic, with wooden textures and flags fluttering in the liquid breeze. Coffee splashes and foam ripple around them as they maneuver through the turbulent surface, dodging each other's attacks. A detailed reflection of the battle appears on the glossy surface of the coffee, adding to the dynamic realism. The camera pans and zooms to capture every dramatic moment of the high-seas clash within this tiny, unexpected world.", "Bad quality", ] negative_prompt = "Static, 2D cartoon, cartoon, 2d animation, paintings, images, worst quality, low quality, ugly, deformed, walking backwards"
pipe.transformer.set_attention_backend("flex")
output = pipe( prompt=prompt, negative_prompt=negative_prompt, height=512, width=768, num_frames=241, num_inference_steps=50, guidance_scale=5.0, num_videos_per_prompt=1, generator=torch.Generator(42) )