# kijai/comfyui-wanvideowrapper architecture

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

- Interactive diagram: https://gitdiagram.com/kijai/comfyui-wanvideowrapper
- Repository: https://github.com/kijai/comfyui-wanvideowrapper

## Overview

This repository is a ComfyUI custom-node wrapper for WanVideo and related video-generation models. The principal workflow is to configure model inputs and conditioning in a ComfyUI workflow, load a transformer and supporting model assets, run video sampling, then decode latents for output and preview. Separate node families add model-specific animation, audio, camera, and control techniques. The graph combines README-documented capabilities with relationships visible in sampled files and the SOURCE INDEX; unsampled node wiring is not inferred.

Main entry points: [`nodes_sampler.py`](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes_sampler.py) (Video sampling), [`nodes.py`](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes.py) (ComfyUI nodes), [`nodes_model_loading.py`](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes_model_loading.py) (Model loading), [`wanvideo/modules/model.py`](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/modules/model.py) (Wan transformer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow nodes"]
  node_comfy["ComfyUI nodes<br/>[nodes.py]"]
  node_loader["Model loading"]
  node_sampler["Video sampling<br/>[nodes_sampler.py]"]
  node_preview["Latent preview<br/>[latent_preview.py]"]
end

subgraph group_wan["Wan runtime"]
  node_wanmodel["Wan transformer<br/>[model.py]"]
  node_attention["Attention<br/>[attention.py]"]
  node_vae["Video VAE<br/>[wan_video_vae.py]"]
  node_scheduler["Flow schedulers"]
  node_lcm["LCM scheduler"]
end

subgraph group_models["Model extensions"]
  node_multitalknodes["MultiTalk nodes<br/>[nodes.py]"]
  node_multitalk["MultiTalk runtime<br/>[multitalk.py]"]
  node_longcat["LongCat layers<br/>[layers.py]"]
  node_unianimate["UniAnimate<br/>[nodes.py]"]
  node_extensions["Related model nodes"]
end

subgraph group_conditioning["Conditioning"]
  node_control["Control models"]
  node_context["Context windows<br/>[context.py]"]
end

subgraph group_runtime["Runtime support"]
  node_gguf["GGUF weights<br/>[gguf.py]"]
  node_linear["Linear and LoRA<br/>[custom_linear.py]"]
  node_radial["Radial attention<br/>[attn_mask.py]"]
  node_utils["Model utilities<br/>[utils.py]"]
end

node_user(("Workflow author"))

node_user -->|"builds workflow"| node_comfy
node_comfy -->|"loads models"| node_loader
node_comfy -->|"runs generation"| node_sampler
node_loader -->|"loads transformer"| node_wanmodel
node_loader -->|"loads VAE"| node_vae
node_loader -->|"supports GGUF"| node_gguf
node_loader -->|"patches weights"| node_linear
node_sampler -.->|"samples with"| node_wanmodel
node_sampler -.->|"uses scheduler"| node_scheduler
node_sampler -.->|"supports scheduler"| node_lcm
node_sampler -.->|"streams previews"| node_preview
node_wanmodel -->|"uses attention"| node_attention
node_wanmodel -->|"uses masks"| node_radial
node_multitalknodes -.->|"runs audio motion"| node_multitalk
node_multitalk -->|"calls attention"| node_attention
node_multitalknodes -.->|"adds workflow nodes"| node_sampler
node_longcat -.->|"extends transformer"| node_wanmodel
node_unianimate -.->|"adds animation nodes"| node_comfy
node_control -.->|"adds control nodes"| node_comfy
node_context -.->|"windows frames"| node_sampler
node_utils -->|"patches weights"| node_linear
node_extensions -.->|"adds model nodes"| node_comfy

click node_comfy "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes.py"
click node_loader "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes_model_loading.py"
click node_sampler "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes_sampler.py"
click node_wanmodel "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/modules/model.py"
click node_attention "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/modules/attention.py"
click node_vae "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/wan_video_vae.py"
click node_scheduler "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/schedulers/fm_solvers_unipc.py"
click node_lcm "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/schedulers/scheduling_flow_match_lcm.py"
click node_preview "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/latent_preview.py"
click node_multitalknodes "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/multitalk/nodes.py"
click node_multitalk "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/multitalk/multitalk.py"
click node_longcat "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/LongCat/layers.py"
click node_unianimate "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/unianimate/nodes.py"
click node_extensions "https://github.com/kijai/comfyui-wanvideowrapper/tree/main/ATI"
click node_control "https://github.com/kijai/comfyui-wanvideowrapper/tree/main/controlnet"
click node_context "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/context_windows/context.py"
click node_gguf "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/gguf/gguf.py"
click node_linear "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/custom_linear.py"
click node_radial "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/radial_attention/attn_mask.py"
click node_utils "https://github.com/kijai/comfyui-wanvideowrapper/blob/main/utils.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_comfy,node_loader,node_sampler,node_preview toneBlue
class node_wanmodel,node_attention,node_vae,node_scheduler,node_lcm toneAmber
class node_multitalknodes,node_multitalk,node_longcat,node_unianimate,node_extensions toneMint
class node_control,node_context toneRose
class node_gguf,node_linear,node_radial,node_utils,node_user toneIndigo
```

## Components

### Workflow nodes

- [ComfyUI nodes](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes.py): `nodes.py`
- [Model loading](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes_model_loading.py): `nodes_model_loading.py`
- [Video sampling](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/nodes_sampler.py): `nodes_sampler.py`
- [Latent preview](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/latent_preview.py): `latent_preview.py`

### Wan runtime

- [Wan transformer](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/modules/model.py): `wanvideo/modules/model.py`
- [Attention](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/modules/attention.py): `wanvideo/modules/attention.py`
- [Video VAE](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/wan_video_vae.py): `wanvideo/wan_video_vae.py`
- [Flow schedulers](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/schedulers/fm_solvers_unipc.py): `wanvideo/schedulers/fm_solvers_unipc.py`
- [LCM scheduler](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/schedulers/scheduling_flow_match_lcm.py): `wanvideo/schedulers/scheduling_flow_match_lcm.py`

### Model extensions

- [MultiTalk nodes](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/multitalk/nodes.py): `multitalk/nodes.py`
- [MultiTalk runtime](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/multitalk/multitalk.py): `multitalk/multitalk.py`
- [LongCat layers](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/LongCat/layers.py): `LongCat/layers.py`
- [UniAnimate](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/unianimate/nodes.py): `unianimate/nodes.py`
- [Related model nodes](https://github.com/kijai/comfyui-wanvideowrapper/tree/main/ATI): `ATI`

### Conditioning

- [Control models](https://github.com/kijai/comfyui-wanvideowrapper/tree/main/controlnet): `controlnet`
- [Context windows](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/context_windows/context.py): `context_windows/context.py`

### Runtime support

- [GGUF weights](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/gguf/gguf.py): `gguf/gguf.py`
- [Linear and LoRA](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/custom_linear.py): `custom_linear.py`
- [Radial attention](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/wanvideo/radial_attention/attn_mask.py): `wanvideo/radial_attention/attn_mask.py`
- [Model utilities](https://github.com/kijai/comfyui-wanvideowrapper/blob/main/utils.py): `utils.py`

### Other components

- **Workflow author**

## Connections

- Workflow author → ComfyUI nodes: builds workflow
- ComfyUI nodes → Model loading: loads models
- ComfyUI nodes → Video sampling: runs generation
- Model loading → Wan transformer: loads transformer (evidence: `nodes_model_loading.py`)
- Model loading → Video VAE: loads VAE (evidence: `nodes_model_loading.py`)
- Model loading → GGUF weights: supports GGUF (evidence: `nodes_model_loading.py`)
- Model loading → Linear and LoRA: patches weights (evidence: `nodes_model_loading.py`)
- Video sampling → Wan transformer: samples with
- Video sampling → Flow schedulers: uses scheduler
- Video sampling → LCM scheduler: supports scheduler
- Video sampling → Latent preview: streams previews
- Wan transformer → Attention: uses attention (evidence: `wanvideo/modules/model.py`)
- Wan transformer → Radial attention: uses masks (evidence: `wanvideo/modules/model.py`)
- MultiTalk nodes → MultiTalk runtime: runs audio motion
- MultiTalk runtime → Attention: calls attention (evidence: `multitalk/multitalk.py`)
- MultiTalk nodes → Video sampling: adds workflow nodes
- LongCat layers → Wan transformer: extends transformer (evidence: `LongCat/layers.py`)
- UniAnimate → ComfyUI nodes: adds animation nodes
- Control models → ComfyUI nodes: adds control nodes
- Context windows → Video sampling: windows frames
- Model utilities → Linear and LoRA: patches weights (evidence: `utils.py`)
- Related model nodes → ComfyUI nodes: adds model nodes
