# vita-epfl/stable-video-infinity architecture

> Architecture diagram of the GitHub repository vita-epfl/stable-video-infinity, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vita-epfl/stable-video-infinity
- Repository: https://github.com/vita-epfl/stable-video-infinity

## Overview

Stable Video Infinity (SVI) is a long-video generation system built on DiffSynth. The intended user-to-result path is prompt and conditioning input, video generation, then a rendered long-form video; README highlights extending video length while recycling generation error. The sampled Wan pipeline shows model, scheduler, prompt, and memory-management dependencies, but the SVI-specific pipeline and UI implementations were not sampled. Dashed, uncited links mark those uncertain runtime connections; the README excerpt does not document detailed implementation flow.

Main entry points: [`diffsynth/pipelines/wan_video.py`](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/wan_video.py) (Wan video pipeline), [`diffsynth/pipelines/svi_video.py`](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/svi_video.py) (Long video pipeline), [`gradio_demo.py`](https://github.com/vita-epfl/stable-video-infinity/blob/main/gradio_demo.py) (Demo interface), [`diffsynth/models/model_manager.py`](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/model_manager.py) (Model manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_ui["Demo interface<br/>[gradio_demo.py]"]
end

subgraph group_svi["SVI generation"]
  node_svi_pipeline["Long video pipeline<br/>[svi_video.py]"]
  node_error_recycling["Error recycling<br/>[svi_video.py]"]
end

subgraph group_runtime["DiffSynth runtime"]
  node_wan_pipeline["Wan video pipeline<br/>[wan_video.py]"]
  node_model_manager["Model manager<br/>[model_manager.py]"]
  node_wan_dit["Wan transformer<br/>[wan_video_dit.py]"]
  node_wan_text["Wan text encoder"]
  node_wan_vae["Wan video VAE<br/>[wan_video_vae.py]"]
  node_wan_image["Wan image encoder"]
  node_scheduler["Flow scheduler<br/>[flow_match.py]"]
end

subgraph group_conditioning["Conditioning"]
  node_prompter["Wan prompter<br/>[wan_prompter.py]"]
  node_pose["Pose extraction<br/>[run_align_pose.py]"]
  node_audio["Audio processing<br/>[audio_process.py]"]
  node_video["Video data<br/>[video.py]"]
end

node_user(("Video creator"))
node_result["Generated video"]

node_user -.->|"submits request"| node_ui
node_ui -.->|"starts generation"| node_svi_pipeline
node_svi_pipeline -.->|"recycles error"| node_error_recycling
node_svi_pipeline -.->|"uses generation"| node_wan_pipeline
node_wan_pipeline -->|"configures model"| node_wan_dit
node_wan_pipeline -->|"configures encoder"| node_wan_text
node_wan_pipeline -->|"configures VAE"| node_wan_vae
node_wan_pipeline -->|"configures encoder"| node_wan_image
node_wan_pipeline -->|"uses scheduler"| node_scheduler
node_wan_pipeline -->|"creates prompter"| node_prompter
node_wan_pipeline -->|"imports manager"| node_model_manager
node_svi_pipeline -.->|"uses pose input"| node_pose
node_svi_pipeline -.->|"uses audio input"| node_audio
node_svi_pipeline -.->|"handles video"| node_video
node_svi_pipeline -.->|"produces video"| node_result

click node_ui "https://github.com/vita-epfl/stable-video-infinity/blob/main/gradio_demo.py"
click node_svi_pipeline "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/svi_video.py"
click node_error_recycling "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/svi_video.py"
click node_wan_pipeline "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/wan_video.py"
click node_model_manager "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/model_manager.py"
click node_wan_dit "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_dit.py"
click node_wan_text "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_text_encoder.py"
click node_wan_vae "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_vae.py"
click node_wan_image "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_image_encoder.py"
click node_scheduler "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/schedulers/flow_match.py"
click node_prompter "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/prompters/wan_prompter.py"
click node_pose "https://github.com/vita-epfl/stable-video-infinity/blob/main/utils/run_align_pose.py"
click node_audio "https://github.com/vita-epfl/stable-video-infinity/blob/main/utils/audio_process.py"
click node_video "https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/data/video.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui toneBlue
class node_svi_pipeline,node_error_recycling toneAmber
class node_wan_pipeline,node_model_manager,node_wan_dit,node_wan_text,node_wan_vae,node_wan_image,node_scheduler toneMint
class node_prompter,node_pose,node_audio,node_video toneRose
class node_user,node_result toneIndigo
```

## Components

### User entry

- [Demo interface](https://github.com/vita-epfl/stable-video-infinity/blob/main/gradio_demo.py): `gradio_demo.py`

### SVI generation

- [Long video pipeline](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/svi_video.py): `diffsynth/pipelines/svi_video.py`
- [Error recycling](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/svi_video.py): `diffsynth/pipelines/svi_video.py`

### DiffSynth runtime

- [Wan video pipeline](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/pipelines/wan_video.py): `diffsynth/pipelines/wan_video.py`
- [Model manager](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/model_manager.py): `diffsynth/models/model_manager.py`
- [Wan transformer](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_dit.py): `diffsynth/models/wan_video_dit.py`
- [Wan text encoder](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_text_encoder.py): `diffsynth/models/wan_video_text_encoder.py`
- [Wan video VAE](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_vae.py): `diffsynth/models/wan_video_vae.py`
- [Wan image encoder](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/models/wan_video_image_encoder.py): `diffsynth/models/wan_video_image_encoder.py`
- [Flow scheduler](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/schedulers/flow_match.py): `diffsynth/schedulers/flow_match.py`

### Conditioning

- [Wan prompter](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/prompters/wan_prompter.py): `diffsynth/prompters/wan_prompter.py`
- [Pose extraction](https://github.com/vita-epfl/stable-video-infinity/blob/main/utils/run_align_pose.py): `utils/run_align_pose.py`
- [Audio processing](https://github.com/vita-epfl/stable-video-infinity/blob/main/utils/audio_process.py): `utils/audio_process.py`
- [Video data](https://github.com/vita-epfl/stable-video-infinity/blob/main/diffsynth/data/video.py): `diffsynth/data/video.py`

### Other components

- **Video creator**
- **Generated video**

## Connections

- Video creator → Demo interface: submits request
- Demo interface → Long video pipeline: starts generation
- Long video pipeline → Error recycling: recycles error
- Long video pipeline → Wan video pipeline: uses generation
- Wan video pipeline → Wan transformer: configures model (evidence: `diffsynth/pipelines/wan_video.py`)
- Wan video pipeline → Wan text encoder: configures encoder (evidence: `diffsynth/pipelines/wan_video.py`)
- Wan video pipeline → Wan video VAE: configures VAE (evidence: `diffsynth/pipelines/wan_video.py`)
- Wan video pipeline → Wan image encoder: configures encoder (evidence: `diffsynth/pipelines/wan_video.py`)
- Wan video pipeline → Flow scheduler: uses scheduler (evidence: `diffsynth/pipelines/wan_video.py`)
- Wan video pipeline → Wan prompter: creates prompter (evidence: `diffsynth/pipelines/wan_video.py`)
- Wan video pipeline → Model manager: imports manager (evidence: `diffsynth/pipelines/wan_video.py`)
- Long video pipeline → Pose extraction: uses pose input
- Long video pipeline → Audio processing: uses audio input
- Long video pipeline → Video data: handles video
- Long video pipeline → Generated video: produces video
