Unverified Commit ada8109d authored by Suraj Patil's avatar Suraj Patil Committed by GitHub
Browse files

Fix SVD doc (#5983)

fix url
parent b34acbdc
...@@ -54,7 +54,7 @@ export_to_video(frames, "generated.mp4", fps=7) ...@@ -54,7 +54,7 @@ export_to_video(frames, "generated.mp4", fps=7)
``` ```
<video width="1024" height="576" controls> <video width="1024" height="576" controls>
<source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/rocket_generated.mp4?download=true" type="video/mp4"> <source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/rocket_generated.mp4" type="video/mp4">
</video> </video>
<Tip> <Tip>
...@@ -82,8 +82,9 @@ Video generation is very memory intensive as we have to essentially generate `nu ...@@ -82,8 +82,9 @@ Video generation is very memory intensive as we have to essentially generate `nu
- enable feed-forward chunking: The feed-forward layer runs in a loop instead of running with a single huge feed-forward batch size - enable feed-forward chunking: The feed-forward layer runs in a loop instead of running with a single huge feed-forward batch size
- reduce `decode_chunk_size`: This means that the VAE decodes frames in chunks instead of decoding them all together. **Note**: In addition to leading to a small slowdown, this method also slightly leads to video quality deterioration - reduce `decode_chunk_size`: This means that the VAE decodes frames in chunks instead of decoding them all together. **Note**: In addition to leading to a small slowdown, this method also slightly leads to video quality deterioration
You can enable them as follows: You can enable them as follows:
```diff
```diff
-pipe.enable_model_cpu_offload() -pipe.enable_model_cpu_offload()
-frames = pipe(image, decode_chunk_size=8, generator=generator).frames[0] -frames = pipe(image, decode_chunk_size=8, generator=generator).frames[0]
+pipe.enable_model_cpu_offload() +pipe.enable_model_cpu_offload()
...@@ -105,6 +106,7 @@ It accepts the following arguments: ...@@ -105,6 +106,7 @@ It accepts the following arguments:
Here is an example of using micro-conditioning to generate a video with more motion. Here is an example of using micro-conditioning to generate a video with more motion.
```python ```python
import torch import torch
...@@ -112,7 +114,7 @@ from diffusers import StableVideoDiffusionPipeline ...@@ -112,7 +114,7 @@ from diffusers import StableVideoDiffusionPipeline
from diffusers.utils import load_image, export_to_video from diffusers.utils import load_image, export_to_video
pipe = StableVideoDiffusionPipeline.from_pretrained( pipe = StableVideoDiffusionPipeline.from_pretrained(
"stabilityai/stable-video-diffusion-img2vid-xt", torch_dtype=torch.float16, variant="fp16" "stabilityai/stable-video-diffusion-img2vid-xt", torch_dtype=torch.float16, variant="fp16"
) )
pipe.enable_model_cpu_offload() pipe.enable_model_cpu_offload()
...@@ -126,6 +128,6 @@ export_to_video(frames, "generated.mp4", fps=7) ...@@ -126,6 +128,6 @@ export_to_video(frames, "generated.mp4", fps=7)
``` ```
<video width="1024" height="576" controls> <video width="1024" height="576" controls>
<source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/rocket_generated_motion.mp4?download=true" type="video/mp4"> <source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/svd/rocket_generated_motion.mp4" type="video/mp4">
</video> </video>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment