# yaofang-liu/pusa-vidgen architecture

> Architecture diagram of the GitHub repository yaofang-liu/pusa-vidgen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yaofang-liu/pusa-vidgen
- Repository: https://github.com/yaofang-liu/pusa-vidgen

## Overview

Pusa is a video-diffusion system centered on frame-level vectorized timestep adaptation, with Wan2.1/Wan2.2 support and text-to-video, image-to-video, and video-to-video workflows. The principal path runs from a task input through a task-specific pipeline to generated video; the repository also includes DiffSynth model loading, model components, and optional processing. The graph combines README-documented capabilities with relationships visible in indexed source references; several pipeline internals are unsampled, so uncertain connections are omitted.

Main entry points: [`src/genmo/pusa/pipelines_ti2v_release.py`](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/pipelines_ti2v_release.py) (Text/Image Video), [`src/genmo/pusa/dit/joint_model/asymm_models_joint.py`](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/dit/joint_model/asymm_models_joint.py) (Joint DiT), [`PusaV1/diffsynth/pipelines/pipeline_runner.py`](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/pipelines/pipeline_runner.py) (Pipeline Runner), [`PusaV1/diffsynth/models/model_manager.py`](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/model_manager.py) (Model Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pusa_pipelines["Pusa Pipelines"]
  node_pusa_ti2v["Text/Image Video"]
  node_pusa_multiframe["Multi-Frame Tasks"]
  node_pusa_v2v["Video-to-Video"]
end

subgraph group_diffsynth_pipelines["DiffSynth Pipelines"]
  node_diff_runner["Pipeline Runner<br/>[pipeline_runner.py]"]
  node_wan_pusa_pipe["Wan Pusa Video<br/>[wan_video_pusa.py]"]
  node_wan22_pipe["Wan2.2 Pusa"]
end

subgraph group_models["Model Runtime"]
  node_model_manager["Model Manager<br/>[model_manager.py]"]
  node_model_config["Model Registry<br/>[model_config.py]"]
  node_wan_dit["Wan DiT<br/>[wan_video_dit.py]"]
  node_wan_pusa_model["Wan Pusa Model<br/>[wan_video_pusa.py]"]
  node_wan_vae["Wan Video VAE<br/>[wan_video_vae.py]"]
end

subgraph group_pusa_core["Pusa Core"]
  node_joint_dit["Joint DiT"]
  node_joint_layers["DiT Layers<br/>[layers.py]"]
  node_parallel_context["Context Parallelism"]
  node_pusa_vae["Pusa VAE<br/>[models.py]"]
  node_cp_conv["Parallel VAE Convs<br/>[cp_conv.py]"]
end

subgraph group_processing["Data Processing"]
  node_pusa_datasets["Embedding Datasets"]
  node_video_transforms["Video Transforms"]
  node_data_loaders["Video Data<br/>[video.py]"]
  node_processors["Video Processors"]
end

node_text_actor(("Text Prompt"))
node_image_actor(("Input Image"))
node_video_actor(("Input Video"))
node_video_result["Generated Video"]

node_text_actor -->|"prompts"| node_pusa_ti2v
node_image_actor -->|"conditions"| node_pusa_ti2v
node_image_actor -->|"conditions"| node_pusa_multiframe
node_video_actor -->|"conditions"| node_pusa_v2v
node_pusa_ti2v -->|"generates"| node_video_result
node_pusa_multiframe -->|"generates"| node_video_result
node_pusa_v2v -->|"generates"| node_video_result
node_pusa_ti2v -.->|"runs DiT"| node_joint_dit
node_pusa_multiframe -.->|"runs DiT"| node_joint_dit
node_pusa_v2v -.->|"runs DiT"| node_joint_dit
node_joint_dit -.->|"decodes latents"| node_pusa_vae
node_pusa_ti2v -.->|"uses embeddings"| node_pusa_datasets
node_pusa_ti2v -.->|"uses transforms"| node_video_transforms
node_joint_dit -.->|"uses layers"| node_joint_layers
node_joint_dit -.->|"uses context"| node_parallel_context
node_pusa_vae -.->|"uses convolutions"| node_cp_conv
node_text_actor -.->|"submits prompt"| node_diff_runner
node_diff_runner -.->|"dispatches"| node_wan_pusa_pipe
node_diff_runner -->|"uses data"| node_data_loaders
node_diff_runner -->|"uses processors"| node_processors
node_diff_runner -.->|"returns video"| node_video_result
node_wan_pusa_pipe -.->|"runs model"| node_wan_pusa_model
node_wan_pusa_pipe -.->|"uses VAE"| node_wan_vae
node_wan22_pipe -.->|"runs model"| node_wan_pusa_model
node_model_manager -->|"loads registry"| node_model_config
node_model_manager -->|"loads model"| node_wan_dit
node_model_manager -->|"loads model"| node_wan_pusa_model

click node_pusa_ti2v "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/pipelines_ti2v_release.py"
click node_pusa_multiframe "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/pipelines_multi_frames_release.py"
click node_pusa_v2v "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/pipelines_v2v_release.py"
click node_pusa_datasets "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/datasets/embedding_datasets.py"
click node_video_transforms "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/datasets/video_transforms.py"
click node_joint_dit "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/dit/joint_model/asymm_models_joint.py"
click node_joint_layers "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/dit/joint_model/layers.py"
click node_parallel_context "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/dit/joint_model/context_parallel.py"
click node_pusa_vae "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/vae/models.py"
click node_cp_conv "https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/vae/cp_conv.py"
click node_diff_runner "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/pipelines/pipeline_runner.py"
click node_wan_pusa_pipe "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/pipelines/wan_video_pusa.py"
click node_wan22_pipe "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/pipelines/wan22_video_pusa.py"
click node_model_manager "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/model_manager.py"
click node_model_config "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/configs/model_config.py"
click node_wan_dit "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/wan_video_dit.py"
click node_wan_pusa_model "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/wan_video_pusa.py"
click node_wan_vae "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/wan_video_vae.py"
click node_data_loaders "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/data/video.py"
click node_processors "https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/processors/sequencial_processor.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_pusa_ti2v,node_pusa_multiframe,node_pusa_v2v toneBlue
class node_diff_runner,node_wan_pusa_pipe,node_wan22_pipe toneAmber
class node_model_manager,node_model_config,node_wan_dit,node_wan_pusa_model,node_wan_vae toneMint
class node_joint_dit,node_joint_layers,node_parallel_context,node_pusa_vae,node_cp_conv toneRose
class node_pusa_datasets,node_video_transforms,node_data_loaders,node_processors,node_text_actor,node_image_actor,node_video_actor,node_video_result toneIndigo
```

## Components

### Pusa Pipelines

- [Text/Image Video](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/pipelines_ti2v_release.py): `src/genmo/pusa/pipelines_ti2v_release.py`
- [Multi-Frame Tasks](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/pipelines_multi_frames_release.py): `src/genmo/pusa/pipelines_multi_frames_release.py`
- [Video-to-Video](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/pipelines_v2v_release.py): `src/genmo/pusa/pipelines_v2v_release.py`

### DiffSynth Pipelines

- [Pipeline Runner](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/pipelines/pipeline_runner.py): `PusaV1/diffsynth/pipelines/pipeline_runner.py`
- [Wan Pusa Video](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/pipelines/wan_video_pusa.py): `PusaV1/diffsynth/pipelines/wan_video_pusa.py`
- [Wan2.2 Pusa](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/pipelines/wan22_video_pusa.py): `PusaV1/diffsynth/pipelines/wan22_video_pusa.py`

### Model Runtime

- [Model Manager](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/model_manager.py): `PusaV1/diffsynth/models/model_manager.py`
- [Model Registry](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/configs/model_config.py): `PusaV1/diffsynth/configs/model_config.py`
- [Wan DiT](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/wan_video_dit.py): `PusaV1/diffsynth/models/wan_video_dit.py`
- [Wan Pusa Model](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/wan_video_pusa.py): `PusaV1/diffsynth/models/wan_video_pusa.py`
- [Wan Video VAE](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/models/wan_video_vae.py): `PusaV1/diffsynth/models/wan_video_vae.py`

### Pusa Core

- [Joint DiT](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/dit/joint_model/asymm_models_joint.py): `src/genmo/pusa/dit/joint_model/asymm_models_joint.py`
- [DiT Layers](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/dit/joint_model/layers.py): `src/genmo/pusa/dit/joint_model/layers.py`
- [Context Parallelism](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/dit/joint_model/context_parallel.py): `src/genmo/pusa/dit/joint_model/context_parallel.py`
- [Pusa VAE](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/vae/models.py): `src/genmo/pusa/vae/models.py`
- [Parallel VAE Convs](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/vae/cp_conv.py): `src/genmo/pusa/vae/cp_conv.py`

### Data Processing

- [Embedding Datasets](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/datasets/embedding_datasets.py): `src/genmo/pusa/datasets/embedding_datasets.py`
- [Video Transforms](https://github.com/yaofang-liu/pusa-vidgen/blob/main/src/genmo/pusa/datasets/video_transforms.py): `src/genmo/pusa/datasets/video_transforms.py`
- [Video Data](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/data/video.py): `PusaV1/diffsynth/data/video.py`
- [Video Processors](https://github.com/yaofang-liu/pusa-vidgen/blob/main/PusaV1/diffsynth/processors/sequencial_processor.py): `PusaV1/diffsynth/processors/sequencial_processor.py`

### Other components

- **Text Prompt**
- **Input Image**
- **Input Video**
- **Generated Video**

## Connections

- Text Prompt → Text/Image Video: prompts (evidence: `README.md`)
- Input Image → Text/Image Video: conditions (evidence: `README.md`)
- Input Image → Multi-Frame Tasks: conditions (evidence: `README.md`)
- Input Video → Video-to-Video: conditions (evidence: `README.md`)
- Text/Image Video → Generated Video: generates (evidence: `README.md`)
- Multi-Frame Tasks → Generated Video: generates (evidence: `README.md`)
- Video-to-Video → Generated Video: generates (evidence: `README.md`)
- Text/Image Video → Joint DiT: runs DiT
- Multi-Frame Tasks → Joint DiT: runs DiT
- Video-to-Video → Joint DiT: runs DiT
- Joint DiT → Pusa VAE: decodes latents
- Text/Image Video → Embedding Datasets: uses embeddings
- Text/Image Video → Video Transforms: uses transforms
- Joint DiT → DiT Layers: uses layers
- Joint DiT → Context Parallelism: uses context
- Pusa VAE → Parallel VAE Convs: uses convolutions
- Text Prompt → Pipeline Runner: submits prompt
- Pipeline Runner → Wan Pusa Video: dispatches
- Pipeline Runner → Video Data: uses data (evidence: `PusaV1/diffsynth/pipelines/pipeline_runner.py`)
- Pipeline Runner → Video Processors: uses processors (evidence: `PusaV1/diffsynth/pipelines/pipeline_runner.py`)
- Pipeline Runner → Generated Video: returns video
- Wan Pusa Video → Wan Pusa Model: runs model
- Wan Pusa Video → Wan Video VAE: uses VAE
- Wan2.2 Pusa → Wan Pusa Model: runs model
- Model Manager → Model Registry: loads registry (evidence: `PusaV1/diffsynth/models/model_manager.py`)
- Model Manager → Wan DiT: loads model (evidence: `PusaV1/diffsynth/models/model_manager.py`)
- Model Manager → Wan Pusa Model: loads model (evidence: `PusaV1/diffsynth/models/model_manager.py`)
