---
slug: inference/inference_quick_start
title: Inference Quick Start
---
<a id="inference-quick-start"></a>

This page contains step-by-step instructions to get you quickly started with video generation using FastVideo.

## Requirements {#requirements}

- **OS**: Linux (tested on Ubuntu 22.04+), or macOS on Apple silicon via the
  [MLX install guide](/FastVideo/getting_started/installation/mlx)
- **Python**: 3.10-3.12
- **CUDA**: 12.6 or 13.0 (NVIDIA GPUs)
- **GPU**: At least one NVIDIA GPU, or an Apple silicon chip with the MLX runtime

## Installation {#installation}

If you previously used Conda, we recommend using [uv](https://docs.astral.sh/uv/) instead for a faster and more stable environment setup:

```bash
# Create and activate a new uv environment
uv venv --python 3.12 --seed
source .venv/bin/activate

# Install FastVideo
UV_TORCH_BACKEND=cu126 uv pip install fastvideo
```

Use `UV_TORCH_BACKEND=cu130` instead on CUDA 13.

For advanced installation options, see the [Installation Guide](/FastVideo/getting_started/installation).

## Generating Your First Video {#generating-your-first-video}

Here's a minimal example to generate a video using the default settings. Create a file called `example.py` with the following code:

```python
from fastvideo import VideoGenerator

def main():
    # Create a video generator with a pre-trained model
    generator = VideoGenerator.from_pretrained(
        "Wan-AI/Wan2.1-T2V-1.3B-Diffusers",
        num_gpus=1,  # Adjust based on your hardware
    )

    # Define a prompt for your video
    prompt = "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes wide with interest."

    # Generate the video
    video = generator.generate_video(
        prompt,
        output_path="my_videos/",  # Controls where videos are saved
        save_video=True
    )

if __name__ == '__main__':
    main()
```

`num_gpus=1` uses the in-process executor (no worker subprocess). On Colab/Kaggle
free-tier hosts (~16GB system RAM), keep `num_gpus=1`; extra T4s do not add host
memory, so `num_gpus>1` is likely to OOM.

Run the script with:

```bash
python example.py
```

The generated video will be saved in the current directory under `my_videos/`  

More inference scripts and recipes can be found in `examples/inference/` and
`scripts/inference/`.

## Available Models {#available-models}

Please see the [support matrix](/FastVideo/inference/support_matrix) for the list of supported models and their available optimizations.

## Image-to-Video Generation {#image-to-video-generation}

You can generate a video starting from an initial image:

```python
from fastvideo import VideoGenerator, SamplingParam

def main():
    # Create the generator
    model_name = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers"
    generator = VideoGenerator.from_pretrained(model_name, num_gpus=1)

    # Set up parameters with an initial image
    sampling_param = SamplingParam.from_pretrained(model_name)
    sampling_param.image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"
    sampling_param.num_frames = 107

    # Generate video based on the image
    prompt = "A photograph coming to life with gentle movement"
    generator.generate_video(prompt, sampling_param=sampling_param,
                             output_path="my_videos/",
                             save_video=True)

if __name__ == '__main__':
    main()
```

## Troubleshooting {#troubleshooting}

Common issues and their solutions:

### Out of Memory Errors {#out-of-memory-errors}

Host RAM and GPU memory are separate. The default `num_gpus=1` path now loads
weights once in the current process. Free-tier Colab/Kaggle notebooks (~16GB
host RAM) should not set `num_gpus>1`.

If you encounter CUDA out of memory errors:

- Reduce `num_frames` or video resolution
- Enable FastVideo offloading options such as `dit_layerwise_offload=True`
  (single GPU) or `use_fsdp_inference=True` (multi-GPU)
- Try a smaller model or use distilled versions
- Use `num_gpus` > 1 if multiple GPUs are available
- Try enabling FSDP inference with `use_fsdp_inference=True` (may slow down generation)
- Try enabling DiT layerwise offload with `dit_layerwise_offload=True` (now only a few models support this, but may introduce less overhead than FSDP)

### Slow Generation {#slow-generation}

To speed up generation:

- Reduce `num_inference_steps` (20-30 is usually sufficient)
- Use half precision (`fp16`) for the VAE
- Use multiple GPUs if available

### Unexpected Results {#unexpected-results}

If the generated video doesn't match your prompt:

- Try increasing `guidance_scale` (7.0-9.0 works well)
- Make your prompt more detailed and specific
- Experiment with different random seeds
- Try a different model

## Next Steps {#next-steps}

- Learn about [Advanced Inference Configurations](/FastVideo/inference/configuration)
- Learn about using [Optimizations](/FastVideo/inference/optimizations)
- See [Examples](/FastVideo/inference/examples/examples_inference_index) for more usage scenarios
- Join our [Community Slack](https://join.slack.com/t/fastvideo/shared_invite/zt-3f4lao1uq-u~Ipx6Lt4J27AlD2y~IdLQ).

