# choi403/alg architecture

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

- Interactive diagram: https://gitdiagram.com/choi403/alg
- Repository: https://github.com/choi403/alg

## Overview

This repository is a command-line image-to-video generator implementing Adaptive Low-pass Guidance (ALG) for CogVideoX, HunyuanVideo, and Wan. The main workflow is: load a YAML configuration and input image, select and configure a model pipeline, guide its denoising with scheduled low-pass filtering, then encode and save the generated frames as a video. The shared utilities implement filtering, schedules, and HunyuanVideo sizing. Edges reflect the shown runner and pipeline references; model-family capabilities and configuration roles are also documented in the README.

Main entry points: [`run.py`](https://github.com/choi403/alg/blob/main/run.py) (CLI runner), [`configs/wan_alg.yaml`](https://github.com/choi403/alg/blob/main/configs/wan_alg.yaml) (Generation settings), [`pipeline_hunyuan_video_image2video_lowpass.py`](https://github.com/choi403/alg/blob/main/pipeline_hunyuan_video_image2video_lowpass.py) (HunyuanVideo pipeline), [`pipeline_wan_image2video_lowpass.py`](https://github.com/choi403/alg/blob/main/pipeline_wan_image2video_lowpass.py) (Wan pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runner["Generation runner"]
  node_run["CLI runner<br/>[run.py]"]
end

subgraph group_alg["ALG guidance"]
  node_filter["Low-pass filters<br/>[lp_utils.py]"]
  node_schedule["Strength schedules<br/>[lp_utils.py]"]
  node_size["Hunyuan sizing<br/>[lp_utils.py]"]
end

subgraph group_pipelines["I2V pipelines"]
  node_wan_pipeline["Wan pipeline"]
  node_cog_pipeline["CogVideoX pipeline"]
  node_hunyuan_pipeline["HunyuanVideo pipeline"]
end

subgraph group_configs["Model configuration"]
  node_settings["Generation settings<br/>[wan_alg.yaml]"]
  node_wan_config["Wan configs<br/>[wan_default.yaml]"]
  node_cog_config["CogVideoX configs"]
  node_hunyuan_config["Hunyuan configs"]
end

node_user(("User"))
node_input["Input image"]
node_model_hub[("Pretrained models")]
node_video["Output video"]

node_user -->|"invokes"| node_run
node_user -->|"provides"| node_input
node_user -->|"selects"| node_settings
node_run -->|"reads"| node_settings
node_run -->|"loads"| node_input
node_run -->|"selects and calls"| node_wan_pipeline
node_run -->|"selects and calls"| node_cog_pipeline
node_run -->|"selects and calls"| node_hunyuan_pipeline
node_run -->|"gets dimensions"| node_size
node_run -->|"writes frames"| node_video
node_wan_pipeline -->|"uses filtering"| node_filter
node_wan_pipeline -.->|"uses schedules"| node_schedule
node_cog_pipeline -->|"uses filtering"| node_filter
node_cog_pipeline -->|"uses schedules"| node_schedule
node_hunyuan_pipeline -->|"uses filtering"| node_filter
node_hunyuan_pipeline -.->|"uses schedules"| node_schedule
node_run -->|"loads weights"| node_model_hub
node_wan_config -.->|"configures"| node_settings
node_cog_config -.->|"configures"| node_settings
node_hunyuan_config -.->|"configures"| node_settings
node_hunyuan_pipeline -.->|"uses sizing"| node_size

click node_run "https://github.com/choi403/alg/blob/main/run.py"
click node_settings "https://github.com/choi403/alg/blob/main/configs/wan_alg.yaml"
click node_wan_config "https://github.com/choi403/alg/blob/main/configs/wan_default.yaml"
click node_cog_config "https://github.com/choi403/alg/blob/main/configs/cogvideox_default.yaml"
click node_hunyuan_config "https://github.com/choi403/alg/blob/main/configs/hunyuan_video_default.yaml"
click node_wan_pipeline "https://github.com/choi403/alg/blob/main/pipeline_wan_image2video_lowpass.py"
click node_cog_pipeline "https://github.com/choi403/alg/blob/main/pipeline_cogvideox_image2video_lowpass.py"
click node_hunyuan_pipeline "https://github.com/choi403/alg/blob/main/pipeline_hunyuan_video_image2video_lowpass.py"
click node_filter "https://github.com/choi403/alg/blob/main/lp_utils.py"
click node_schedule "https://github.com/choi403/alg/blob/main/lp_utils.py"
click node_size "https://github.com/choi403/alg/blob/main/lp_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_run,node_user toneBlue
class node_filter,node_schedule,node_size,node_model_hub toneAmber
class node_wan_pipeline,node_cog_pipeline,node_hunyuan_pipeline toneMint
class node_settings,node_wan_config,node_cog_config,node_hunyuan_config toneRose
class node_input,node_video toneIndigo
```

## Components

### Generation runner

- [CLI runner](https://github.com/choi403/alg/blob/main/run.py): `run.py`

### ALG guidance

- [Low-pass filters](https://github.com/choi403/alg/blob/main/lp_utils.py): `lp_utils.py`
- [Strength schedules](https://github.com/choi403/alg/blob/main/lp_utils.py): `lp_utils.py`
- [Hunyuan sizing](https://github.com/choi403/alg/blob/main/lp_utils.py): `lp_utils.py`

### I2V pipelines

- [Wan pipeline](https://github.com/choi403/alg/blob/main/pipeline_wan_image2video_lowpass.py): `pipeline_wan_image2video_lowpass.py`
- [CogVideoX pipeline](https://github.com/choi403/alg/blob/main/pipeline_cogvideox_image2video_lowpass.py): `pipeline_cogvideox_image2video_lowpass.py`
- [HunyuanVideo pipeline](https://github.com/choi403/alg/blob/main/pipeline_hunyuan_video_image2video_lowpass.py): `pipeline_hunyuan_video_image2video_lowpass.py`

### Model configuration

- [Generation settings](https://github.com/choi403/alg/blob/main/configs/wan_alg.yaml): `configs/wan_alg.yaml`
- [Wan configs](https://github.com/choi403/alg/blob/main/configs/wan_default.yaml): `configs/wan_default.yaml`
- [CogVideoX configs](https://github.com/choi403/alg/blob/main/configs/cogvideox_default.yaml): `configs/cogvideox_default.yaml`
- [Hunyuan configs](https://github.com/choi403/alg/blob/main/configs/hunyuan_video_default.yaml): `configs/hunyuan_video_default.yaml`

### Other components

- **User**
- **Input image**
- **Pretrained models**
- **Output video**

## Connections

- User → CLI runner: invokes (evidence: `readme.md`)
- User → Input image: provides (evidence: `readme.md`)
- User → Generation settings: selects (evidence: `readme.md`)
- CLI runner → Generation settings: reads (evidence: `run.py`)
- CLI runner → Input image: loads (evidence: `run.py`)
- CLI runner → Wan pipeline: selects and calls (evidence: `run.py`)
- CLI runner → CogVideoX pipeline: selects and calls (evidence: `run.py`)
- CLI runner → HunyuanVideo pipeline: selects and calls (evidence: `run.py`)
- CLI runner → Hunyuan sizing: gets dimensions (evidence: `run.py`)
- CLI runner → Output video: writes frames (evidence: `run.py`)
- Wan pipeline → Low-pass filters: uses filtering (evidence: `pipeline_wan_image2video_lowpass.py`)
- Wan pipeline → Strength schedules: uses schedules (evidence: `pipeline_wan_image2video_lowpass.py`)
- CogVideoX pipeline → Low-pass filters: uses filtering (evidence: `pipeline_cogvideox_image2video_lowpass.py`)
- CogVideoX pipeline → Strength schedules: uses schedules (evidence: `pipeline_cogvideox_image2video_lowpass.py`)
- HunyuanVideo pipeline → Low-pass filters: uses filtering (evidence: `pipeline_hunyuan_video_image2video_lowpass.py`)
- HunyuanVideo pipeline → Strength schedules: uses schedules (evidence: `pipeline_hunyuan_video_image2video_lowpass.py`)
- CLI runner → Pretrained models: loads weights (evidence: `run.py`)
- Wan configs → Generation settings: configures (evidence: `readme.md`)
- CogVideoX configs → Generation settings: configures (evidence: `readme.md`)
- Hunyuan configs → Generation settings: configures (evidence: `readme.md`)
- HunyuanVideo pipeline → Hunyuan sizing: uses sizing (evidence: `pipeline_hunyuan_video_image2video_lowpass.py`)
