Skip to content

garystafford/svdxt-sagemaker-huggingface

Repository files navigation

Stable Video Diffusion XT 1.1 on Amazon SageMaker

Stability AI's Stable Video Diffusion XT (SVT-XT) 1.1 foundation model, available on Hugging Face, is a diffusion model that takes in a still image as a conditioning frame and generates a short 4 second video. The notebook walks through configuring, creating, and invoking an Asynchronous Inference Endpoint backed by the SVT-XT foundation model on Amazon SageMaker.

For more information on using this repository, read the associated blog post, Generative AI Videos with Stability AI’s Stable Video Diffusion XT using Asynchronous Inference on Amazon SageMaker.

Notebook Versions

  • Public URL for Conditioning Image: Version 1 of the Notebook, svd_xt_demo_v1.ipynb, passes a publicly accessible URL of the image in the request payload used to invoke the model. Use the corresponding custom inference script, inference_v1/inference.py.

  • Conditioning Image Passed in Request Payload: Version 2 of the Notebook, svd_xt_demo_v2.ipynb, passes an encoded image in the request payload used to invoke the model. Use the corresponding custom inference script, inference_v2/inference.py.

Architecture for Version 1: Public URL for Conditioning Image

Architecture V1

Architecture for Version 2: Conditioning Image Passed in Request Payload

Architecture V2

Streamlit Application

The project now includes an interactive Streamlit application to generate the videos. Make sure you have first installed the required Python packages, as outlined in the Optional: Local Development Environment section, below. The application can be started with the following command:

streamlit run app.py --server.runOnSave true

Streamlit App

Wide-format Videos

All videos created using Notebook included in this project.

Rocket
Source image
Red Sports Car
Source image
Motorcycle on Beach
Source image
Koi
Source image
Tropical Waterfall
Source image
Boat on Shore
Source image
AI
Source image generated with Stable Diffusion XL (SDXL) 1.0

Tall-format Videos

All videos created using Notebook included in this project.

Turkish Coffee
Source image
Champagne
Source image
Colored Smoke
Source image
Smoke
Source image

Optional: Local Development Environment

Setup local environment to modify project.

python3 -m pip install virtualenv -Uq
virtualenv svd-venv
python3 -m venv svd-venv

source svd-venv/bin/activate
python3 -m pip install -r local_requirements.txt -Uq

References


The contents of this repository represent my viewpoints and not of my past or current employers, including Amazon Web Services (AWS). All third-party libraries, modules, plugins, and SDKs are the property of their respective owners.

About

Deploy and invoke Stability AI's Stable Video Diffusion XT (SVT-XT) 1.1 foundation model on Amazon SageMaker.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published