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
I get the error message "attribute error; none type object has not attribute set manual cast"
I am using SVD in Forge and I get this error. I do not know what this error means.
Everything is set up exactly the way it should be done. Anyone see this error.
Thanks
The error "AttributeError: 'NoneType' object has no attribute 'set_manual_cast'" suggests that a variable expected to be an object is None. This often happens when a model or component fails to load properly.
Possible Causes & Fixes:
Update Dependencies
Make sure your diffusers, transformers, torch, and accelerate libraries are up to date:
pip install --upgrade diffusers transformers torch accelerateEnsure Model is Downloaded Properly
Try re-downloading the model with force_download=True:
from diffusers import DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained(
"stabilityai/stable-video-diffusion-img2vid-xt",
torch_dtype="auto",
force_download=True
)
If the issue persists, delete the cached model and retry:
rm -rf ~/.cache/huggingface/hub
- Check Your PyTorch Version
Ensure you're using a compatible version of PyTorch. Try:
import torch
print(torch.version)
For CUDA users, ensure you have the correct version:
pip install torch --index-url https://download.pytorch.org/whl/cu121
Use device_map="auto"
If you're running out of memory or the model isn't properly initialized, try:
pipeline = DiffusionPipeline.from_pretrained(
"stabilityai/stable-video-diffusion-img2vid-xt",
torch_dtype="auto",
device_map="auto"
)Try a Different Diffusers Version
Some versions of diffusers might have compatibility issues. You can downgrade:
pip install diffusers==0.25.0
If none of these work, let me know more about your setup:
Python version (python --version)
PyTorch version (import torch; print(torch.version))
Diffusers version (pip show diffusers)
Your hardware (GPU/CPU setup)