# tencent-hunyuan/auk architecture

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

- Interactive diagram: https://gitdiagram.com/tencent-hunyuan/auk
- Repository: https://github.com/tencent-hunyuan/auk

## Overview

AuK is a foundational speech generation and editing model. Users provide instructions, text and optionally reference audio through the CLI, Gradio, Python API or ComfyUI; inference encodes inputs, runs the generation model and decodes audio. The README documents zero-shot and instruction TTS, content and lyric editing, acoustic and paralinguistic edits, enhancement and separation. Prompt enhancement and fine-tuning are also represented. Connections among unsampled task-specific code are omitted where the excerpts and index do not establish them.

Main entry points: [`src/auk/model/vae/bigvgan_flow_vae.py`](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/bigvgan_flow_vae.py) (BigVGAN Flow VAE), [`src/auk/infer/infer_auk.py`](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_auk.py) (Inference runtime), [`src/auk/infer/infer_gradio.py`](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_gradio.py) (Gradio demo), [`comfyui/ComfyUI-AuK/nodes.py`](https://github.com/tencent-hunyuan/auk/blob/main/comfyui/ComfyUI-AuK/nodes.py) (ComfyUI nodes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[infer_cli.py]"]
  node_gradio["Gradio demo<br/>[infer_gradio.py]"]
  node_comfy["ComfyUI nodes<br/>[nodes.py]"]
  node_api["Python inference API<br/>[infer_auk.py]"]
end

subgraph group_prompt["Prompt processing"]
  node_prompt_enhancer["Prompt enhancer<br/>[pe.py]"]
end

subgraph group_inference["Inference model"]
  node_inference_runtime["Inference runtime<br/>[infer_auk.py]"]
  node_cfm["CFM edit model<br/>[cfm_edit.py]"]
  node_flux["Flux2 edit backbone<br/>[flux2_edit.py]"]
  node_transformer_blocks["Transformer blocks<br/>[modules.py]"]
  node_task_capabilities["Speech task capabilities"]
end

subgraph group_audio["Audio codec"]
  node_vae["BigVGAN Flow VAE"]
  node_vits_flows["VITS flows<br/>[flows.py]"]
  node_audio_layers["Audio layers<br/>[layers.py]"]
  node_audio_ops["Audio operations<br/>[ops.py]"]
  node_bigvgan_activations["BigVGAN activations<br/>[activations.py]"]
  node_alias_act["Alias-free activations<br/>[act.py]"]
  node_alias_filter["Alias-free filters<br/>[filter.py]"]
  node_alias_resample["Alias-free resampling<br/>[resample.py]"]
end

subgraph group_training["Model training"]
  node_trainer["Fine-tuning<br/>[train.py]"]
end

node_user(("User"))

node_user -->|"submits task"| node_cli
node_user -->|"submits task"| node_gradio
node_user -->|"runs workflow"| node_comfy
node_user -->|"calls API"| node_api
node_cli -->|"calls inference"| node_inference_runtime
node_gradio -->|"calls inference"| node_inference_runtime
node_comfy -->|"creates runtime"| node_inference_runtime
node_gradio -.->|"uses enhancer"| node_prompt_enhancer
node_comfy -.->|"uses enhancer"| node_prompt_enhancer
node_inference_runtime -->|"builds model"| node_cfm
node_inference_runtime -->|"builds backbone"| node_flux
node_flux -->|"uses blocks"| node_transformer_blocks
node_cfm -.->|"runs transformer"| node_flux
node_inference_runtime -->|"encodes audio"| node_vae
node_vae -->|"uses flows"| node_vits_flows
node_vae -->|"uses layers"| node_audio_layers
node_vae -->|"uses operations"| node_audio_ops
node_vae -->|"uses activations"| node_bigvgan_activations
node_vae -->|"uses activations"| node_alias_act
node_vae -->|"uses filters"| node_alias_filter
node_vae -.->|"uses resampling"| node_alias_resample
node_user -->|"fine-tunes model"| node_trainer

click node_cli "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_cli.py"
click node_gradio "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_gradio.py"
click node_comfy "https://github.com/tencent-hunyuan/auk/blob/main/comfyui/ComfyUI-AuK/nodes.py"
click node_api "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_auk.py"
click node_prompt_enhancer "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/pe.py"
click node_inference_runtime "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_auk.py"
click node_cfm "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/cfm_edit.py"
click node_flux "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/flux2_edit.py"
click node_transformer_blocks "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/modules.py"
click node_task_capabilities "https://github.com/tencent-hunyuan/auk/tree/main/src/auk/model"
click node_vae "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/bigvgan_flow_vae.py"
click node_vits_flows "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/vits/flows.py"
click node_audio_layers "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/commons/layers.py"
click node_audio_ops "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/commons/ops.py"
click node_bigvgan_activations "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/activations.py"
click node_alias_act "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/alias_free_torch/act.py"
click node_alias_filter "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/alias_free_torch/filter.py"
click node_alias_resample "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/alias_free_torch/resample.py"
click node_trainer "https://github.com/tencent-hunyuan/auk/blob/main/src/auk/train/train.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_cli,node_gradio,node_comfy,node_api,node_user toneBlue
class node_prompt_enhancer toneAmber
class node_inference_runtime,node_cfm,node_flux,node_transformer_blocks,node_task_capabilities toneMint
class node_vae,node_vits_flows,node_audio_layers,node_audio_ops,node_bigvgan_activations,node_alias_act,node_alias_filter,node_alias_resample toneRose
class node_trainer toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_cli.py): `src/auk/infer/infer_cli.py`
- [Gradio demo](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_gradio.py): `src/auk/infer/infer_gradio.py`
- [ComfyUI nodes](https://github.com/tencent-hunyuan/auk/blob/main/comfyui/ComfyUI-AuK/nodes.py): `comfyui/ComfyUI-AuK/nodes.py`
- [Python inference API](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_auk.py): `src/auk/infer/infer_auk.py`

### Prompt processing

- [Prompt enhancer](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/pe.py): `src/auk/infer/pe.py`

### Inference model

- [Inference runtime](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/infer/infer_auk.py): `src/auk/infer/infer_auk.py`
- [CFM edit model](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/cfm_edit.py): `src/auk/model/cfm_edit.py`
- [Flux2 edit backbone](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/flux2_edit.py): `src/auk/model/flux2_edit.py`
- [Transformer blocks](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/modules.py): `src/auk/model/modules.py`
- [Speech task capabilities](https://github.com/tencent-hunyuan/auk/tree/main/src/auk/model): `src/auk/model`

### Audio codec

- [BigVGAN Flow VAE](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/bigvgan_flow_vae.py): `src/auk/model/vae/bigvgan_flow_vae.py`
- [VITS flows](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/vits/flows.py): `src/auk/model/vae/modules/vits/flows.py`
- [Audio layers](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/commons/layers.py): `src/auk/model/vae/modules/commons/layers.py`
- [Audio operations](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/commons/ops.py): `src/auk/model/vae/modules/commons/ops.py`
- [BigVGAN activations](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/activations.py): `src/auk/model/vae/modules/bigvgan/activations.py`
- [Alias-free activations](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/alias_free_torch/act.py): `src/auk/model/vae/modules/bigvgan/alias_free_torch/act.py`
- [Alias-free filters](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/alias_free_torch/filter.py): `src/auk/model/vae/modules/bigvgan/alias_free_torch/filter.py`
- [Alias-free resampling](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/model/vae/modules/bigvgan/alias_free_torch/resample.py): `src/auk/model/vae/modules/bigvgan/alias_free_torch/resample.py`

### Model training

- [Fine-tuning](https://github.com/tencent-hunyuan/auk/blob/main/src/auk/train/train.py): `src/auk/train/train.py`

### Other components

- **User**

## Connections

- User → CLI: submits task (evidence: `README.md`)
- User → Gradio demo: submits task (evidence: `README.md`)
- User → ComfyUI nodes: runs workflow (evidence: `README.md`)
- User → Python inference API: calls API (evidence: `README.md`)
- CLI → Inference runtime: calls inference (evidence: `src/auk/infer/infer_cli.py`)
- Gradio demo → Inference runtime: calls inference (evidence: `src/auk/infer/infer_gradio.py`)
- ComfyUI nodes → Inference runtime: creates runtime (evidence: `comfyui/ComfyUI-AuK/nodes.py`)
- Gradio demo → Prompt enhancer: uses enhancer (evidence: `src/auk/infer/infer_gradio.py`)
- ComfyUI nodes → Prompt enhancer: uses enhancer (evidence: `comfyui/ComfyUI-AuK/nodes.py`)
- Inference runtime → CFM edit model: builds model (evidence: `src/auk/infer/infer_auk.py`)
- Inference runtime → Flux2 edit backbone: builds backbone (evidence: `src/auk/infer/infer_auk.py`)
- Flux2 edit backbone → Transformer blocks: uses blocks (evidence: `src/auk/model/flux2_edit.py`)
- CFM edit model → Flux2 edit backbone: runs transformer
- Inference runtime → BigVGAN Flow VAE: encodes audio (evidence: `src/auk/infer/infer_auk.py`)
- BigVGAN Flow VAE → VITS flows: uses flows (evidence: `src/auk/model/vae/bigvgan_flow_vae.py`)
- BigVGAN Flow VAE → Audio layers: uses layers (evidence: `src/auk/model/vae/bigvgan_flow_vae.py`)
- BigVGAN Flow VAE → Audio operations: uses operations (evidence: `src/auk/model/vae/bigvgan_flow_vae.py`)
- BigVGAN Flow VAE → BigVGAN activations: uses activations (evidence: `src/auk/model/vae/bigvgan_flow_vae.py`)
- BigVGAN Flow VAE → Alias-free activations: uses activations (evidence: `src/auk/model/vae/bigvgan_flow_vae.py`)
- BigVGAN Flow VAE → Alias-free filters: uses filters
- BigVGAN Flow VAE → Alias-free resampling: uses resampling
- User → Fine-tuning: fine-tunes model (evidence: `README.md`)
