@@ -61,13 +61,15 @@ Resources:
6161To generate a video from prompt, run the following python command
6262```python
6363import torch
64+ import imageio
6465from diffusers import TextToVideoZeroPipeline
6566
6667model_id = " runwayml/stable-diffusion-v1-5"
6768pipe = TextToVideoZeroPipeline.from_pretrained(model_id, torch_dtype =torch.float16).to("cuda")
6869
6970prompt = " A panda is playing guitar on times square"
7071result = pipe(prompt=prompt).images
72+ result = [(r * 255).astype("uint8") for r in result]
7173imageio.mimsave("video.mp4", result, fps =4)
7274```
7375You can change these parameters in the pipeline call:
@@ -95,6 +97,7 @@ To generate a video from prompt with additional pose control
9597
96982. Read video containing extracted pose images
9799 ```python
100+ from PIL import Image
98101 import imageio
99102
100103 reader = imageio.get_reader(video_path, " ffmpeg" )
@@ -151,6 +154,7 @@ To perform text-guided video editing (with [InstructPix2Pix](./stable_diffusion/
151154
1521552. Read video from path
153156 ```python
157+ from PIL import Image
154158 import imageio
155159
156160 reader = imageio.get_reader(video_path, " ffmpeg" )
@@ -174,14 +178,14 @@ To perform text-guided video editing (with [InstructPix2Pix](./stable_diffusion/
174178 ```
175179
176180
177- ### Dreambooth specialization
181+ ### DreamBooth specialization
178182
179183Methods **Text-To-Video**, **Text-To-Video with Pose Control** and **Text-To-Video with Edge Control**
180184can run with custom [DreamBooth](../training/dreambooth) models, as shown below for
181185[Canny edge ControlNet model](https://huggingface.co/lllyasviel/sd-controlnet-canny) and
182186[Avatar style DreamBooth](https://huggingface.co/PAIR/text2video-zero-controlnet-canny-avatar) model
183187
184- 1. Download demo video from huggingface
188+ 1. Download a demo video
185189
186190 ```python
187191 from huggingface_hub import hf_hub_download
@@ -193,6 +197,7 @@ can run with custom [DreamBooth](../training/dreambooth) models, as shown below
193197
1941982. Read video from path
195199 ```python
200+ from PIL import Image
196201 import imageio
197202
198203 reader = imageio.get_reader(video_path, " ffmpeg" )
0 commit comments