Purpose
This repository is maintained by Stability AI and is used to release and provide the code and inference scripts for its generative models, covering directions such as text-to-image generation, image-to-video generation, image-to-multiview-video generation, and video-to-4D generation. The repository's contents are primarily intended for research purposes.
Main Capabilities
The models released in the repository include:
- SDXL-Turbo: a text-to-image model, officially described as a "lightning fast text-to image model," and released along with a technical report.
- Stable Video Diffusion (SVD / SVD-XT): an image-to-video model. SVD is trained to generate 14 frames at a resolution of 576x1024 when given a context frame of the same size; it uses the standard image encoder of SD 2.1, but replaces the decoder with a temporally-aware deflickering decoder. SVD-XT has the same architecture as SVD, but is fine-tuned for 25-frame generation.
- SV3D: an image-to-video model for novel multiview synthesis. It is trained to generate 21 frames at a resolution of 576x576 when given 1 context frame of the same size (ideally an image of a single object on a white background). It includes two variants: SV3D_u generates orbital videos from a single image input, without camera conditioning; SV3D_p, building on SV3D_u, supports both single images and orbital views, and can create 3D videos along a specified camera path.
- SV4D: a video-to-4D diffusion model for novel view video synthesis. It is trained to generate 40 frames (5 video frames x 8 camera views) at a resolution of 576x576 when given 5 context frames (the input video) and 8 reference views (synthesized from the first frame of the input video by multiview diffusion models such as SV3D). To generate longer novel view videos (21 frames), a sampling method is proposed: first sample 5 anchor frames, then densely sample the remaining frames while maintaining temporal consistency.
- SV4D 2.0: an enhanced video-to-4D diffusion model for high-fidelity novel view video synthesis and 4D asset generation. It is trained to generate 48 frames (12 video frames x 4 camera views) at a resolution of 576x576 when given a 12-frame input video of the same size (ideally an image of a moving object on a white background). Compared with SV4D, it can generate videos with higher fidelity, sharper motion details, and better spatiotemporal consistency, generalizes better to real-world videos, and does not rely on SV3D generationThe first frame references multiple viewpoints, making it more robust to self-occlusion. To generate longer novel-view videos, an autoregressive approach is used to generate 12 frames at a time, with the previous generation serving as the conditioning view for subsequent frames.
Usage
This repository provides installation instructions and inference scripts. Below are the commands and parameter descriptions given in the official text (kept verbatim):
SV4D 2.0 Quick Start (first download sv4d2.safetensors from HuggingFace to checkpoints/): python scripts/sampling/simple_video_sample_4d2.py --input_path assets/sv4d_videos/camel.gif --output_folder outputs
Download the SV4D 2.0 model: huggingface-cli download stabilityai/sv4d2.0 sv4d2.safetensors --local-dir checkpoints
Run inference: python scripts/sampling/simple_video_sample_4d2.py --input_path <path/to/video> Parameter descriptions:
- input_path: the input video, which can be a single gif or mp4 file (e.g., assets/sv4d_videos/camel.gif), or a folder containing .jpg, .jpeg, .png video frame images, or a filename pattern matching video frame images.
- num_steps: default 50, can be reduced to shorten sampling time.
- elevations_deg: specifies the elevation angle (relative to the input view), default 0.0 (same as the input view).
- Background removal: for input videos with a solid-color background, you may optionally use rembg to remove the background and crop the video frames by setting --remove_bg=True. For real-world input videos with noisy backgrounds, you can first use Clipdrop or SAM2 to segment the foreground object before running SV4D to obtain higher-quality output.
- Low-VRAM environments: you can try setting --encoding_t=1 (number of frames encoded at a time) and --decoding_t=1 (number of frames decoded at a time), or reduce the video resolution, e.g., --img_size=512.
8-view model (generates 5 frames x 8 views, same as SV4D): Download: huggingface-cli download stabilityai/sv4d2.0 sv4d2_8views.safetensors --local-dir checkpoints Run inference: python scripts/sampling/simple_video_sample_4d2.py --model_path checkpoints/sv4d2_8views.safetensors --input_path assets/sv4d_videos/chest.gif --output_folder outputs Note: the 5x8 model takes 5 frames of input at a time, but the inference scripts for both models accept a 21-frame video input by default (same as SV3D and SV4D), running autoregressively until 21 frames are generated.
SV4D Quick Start (first download sv4d.safetensors and sv3d_u.safetensors from HuggingFace to checkpoints/): python scripts/sampling/simple_video_sample_4d.py --input_path assets/sv4d_videos/test_video1.mp4 --output_folder outputs/sv4d
Run SV4D on a 21-frame single input video: Download the SV3D model (sv3d_u.safetensors and sv3d_p.safetensors) and the SV4D model (sv4d.safetensors) to checkpoints/ Run: python scripts/sampling/simple_video_sample_4d.py --input_path <path/to/video> Parameter descriptions:
- input_path: the input video, which can be a single gif or mp4 file (e.g., assets/sv4d_videos/test_video1.mp4), or a folder containing .jpg, .jpeg, .png video frame images, or a matchFilename pattern for video frame images.
- num_steps: default 20, can be increased to 50 for better quality but longer sampling time.
- sv3d_version: specifies the SV3D model used to generate reference multi-views, set --sv3d_version=sv3d_u or --sv3d_version=sv3d_p.
- elevations_deg: use SV3D_p (default SV3D_u) to generate novel view videos at specified elevations (default elevation 10), for example: python scripts/sampling/simple_video_sample_4d.py --input_path assets/sv4d_videos/test_video1.mp4 --sv3d_version sv3d_p --elevations_deg 30.0
- Background removal and low-VRAM environment notes are the same as SV4D 2.0.
SV3D Usage: Run SV3D_u on a single image: Download sv3d_u.safetensors to checkpoints/sv3d_u.safetensors Run: python scripts/sampling/simple_video_sample.py --input_path <path/to/image.png> --version sv3d_u
Run SV3D_p on a single image: Download sv3d_p.safetensors to checkpoints/sv3d_p.safetensors Generate a static orbit at a specified elevation (e.g., 10.0): python scripts/sampling/simple_video_sample.py --input_path <path/to/image.png> --version sv3d_p --elevations_deg 10.0 Generate a dynamic orbit at specified elevations and azimuths: specify a sequence of 21 elevations (in degrees, range [-90, 90]) for elevations_deg, and 21 azimuths (in degrees, range [0, 360]) for azimuths_deg, sorted from 0 to 360. For example: python scripts/sampling/simple_video_sample.py --input_path <path/to/image.png> --version sv3d_p --elevations_deg [<list of 21 elevations in degrees>] --azimuths_deg [<list of 21 azimuths in degrees>]
Run SVD or SV3D on a streamlit server: streamlit run scripts/demo/video_sampling.py
SDXL-Turbo Usage: Follow the installation instructions, or use pip install streamlit-keyup to update an existing environment. Download the weights and place them in the checkpoints/ directory. Run streamlit run scripts/demo/turbo.py.
Run the SV4D community-built gradio demo locally: python -m scripts.demo.gradio_app_sv4d
Applicable Scenarios
- Text-to-image for research purposes (SDXL-Turbo)
- Image-to-video generation (SVD, SVD-XT)
- Single-image to multi-view orbit video synthesis (SV3D_u, SV3D_p)
- Video-to-4D novel view video synthesis and 4D asset generation (SV4D, SV4D 2.0)
Limitations
- The official text explicitly states that these models are for research purposes.
- The model training conditions have specific limitations, for example, SV4D 2.0 is trained to generate 48 frames (12 video frames x 4 camera views) @ 576x576, with input of a 12-frame video of the same size, ideally images of moving objects on a white background; SV4D is trained to generate 40 frames (5 video frames x 8 camera views) @ 576x576, with input of 5 context frames and 8 reference views; SV3D is trained to generate 21 frames @ 576x576, with input of 1 context frame of the same size, ideally an image of a single object on a white background.
- Low-VRAM environments require adjusting parameters or lowering resolution.
- More information regarding fees, pricing, platform support, etc., is not yet provided in the official text.