Instructions to use stabilityai/stable-video-diffusion-img2vid-xt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use stabilityai/stable-video-diffusion-img2vid-xt with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-video-diffusion-img2vid-xt", dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
Low VRAM mode docker image of the SVD_XT demo
I have made a docker SDK of the SVD_XT demo from the generative-models repository.
You must have docker installed with nvidia GPU capabilities.
The base image is nvidia/cuda:12.2.0-devel-ubuntu20.04 and it also includes the svd_xt.safetensors and the svd_xt_image_decoder.safetensors
To run the image you just need to run
docker pull miniagi/stable_video_diffusion_xt
docker run --gpus all -p 8501:8501 miniagi/stable_video_diffusion_xt
This will run the video_ sampling.py demo from the generative-models repo.
I have a 4090 and I have tested the Decode t frames at a time (set small if you are low on VRAM) parameter as high as 5 with VRAM usage as high as 22GB
For 16GB cards you can run this with the Decode t frames at a time (set small if you are low on VRAM) parameter set to either 1 or 2.
Double loading models will cause unpredictable behavior including crashes if you exceed VRAM. This issue is present in the base application from stabilityai.
Hey @macadeliccc , Can we run this on 12GB VRAM ? (RTX 3060ti) If yes, can you please tell me what would be ideal configuration settings
@LuciferYagami I havent tested how low the VRAM usage is with only 1 for the decode t frames, but I would say its very unlikely. I will try to put standard svd in the container but its still pushing it.
Thanks for the response. Hoped I could run it with a 3060ti
currently running on rtx 3070 8GB VRAM generating 512x512 pretty good. watch this tutorial : https://www.youtube.com/watch?v=HOVYu2UbgEE