@@ -43,11 +43,13 @@ Note: The recommended dtype mentioned is for the transformer weights. The text e
4343<hfoptions id =" generation pipelines " >`
4444<hfoption id =" Text-to-Video " >
4545
46- The example below demonstrates how to use the text-to-video pipeline to generate a video using a text descriptio and a starting frame .
46+ The example below demonstrates how to use the text-to-video pipeline to generate a video using a text description .
4747
4848``` python
49- model_id =
50- pipe = SanaVideoPipeline.from_pretrained(" Efficient-Large-Model/SANA-Video_2B_480p_diffusers" , torch_dtype = torch.bfloat16)
49+ pipe = SanaVideoPipeline.from_pretrained(
50+ " Efficient-Large-Model/SANA-Video_2B_480p_diffusers" ,
51+ torch_dtype = torch.bfloat16,
52+ )
5153pipe.text_encoder.to(torch.bfloat16)
5254pipe.vae.to(torch.float32)
5355pipe.to(" cuda" )
@@ -75,12 +77,11 @@ export_to_video(video, "sana_video.mp4", fps=16)
7577</hfoption >
7678<hfoption id =" Image-to-Video " >
7779
78- The example below demonstrates how to use the image-to-video pipeline to generate a video using a text descriptio and a starting frame.
80+ The example below demonstrates how to use the image-to-video pipeline to generate a video using a text description and a starting frame.
7981
8082``` python
81- model_id = " Efficient-Large-Model/SANA-Video_2B_480p_diffusers"
8283pipe = SanaImageToVideoPipeline.from_pretrained(
83- model_id ,
84+ " Efficient-Large-Model/SANA-Video_2B_480p_diffusers " ,
8485 torch_dtype = torch.bfloat16,
8586)
8687pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config, flow_shift = 8.0 )
0 commit comments