# richard0403/dy-auto architecture

> Architecture diagram of the GitHub repository richard0403/dy-auto, 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/richard0403/dy-auto
- Repository: https://github.com/richard0403/dy-auto

## Overview

dy-auto automates short-video creation and Douyin publishing. Its main workflow starts in the CLI or desktop UI, prepares text and images, synthesizes narration, renders and subtitles a video, then optionally uploads it. The repository also documents batch/random content generation and includes an optional GAN-based lip-sync/virtual-person path. The graph follows the sampled orchestration and renderer code; documented integrations such as Whisper and FFmpeg are included, but unsampled implementation details are not inferred.

Main entry points: [`dy-auto/speech_video_gen.py`](https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_video_gen.py) (Speech workflow), [`dy-auto/video_gen.py`](https://github.com/richard0403/dy-auto/blob/main/dy-auto/video_gen.py) (Video renderer), [`dy-auto/speech_control.py`](https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_control.py) (Upload control), [`dy-auto/main_win_paddle_gan.py`](https://github.com/richard0403/dy-auto/blob/main/dy-auto/main_win_paddle_gan.py) (GAN desktop mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_creation["Content creation"]
  node_cli["CLI entry<br/>[main.py]"]
  node_desktop["Desktop UI<br/>[main_win.py]"]
  node_text["Text topics"]
  node_images["Image library"]
  node_orchestrator["Speech workflow"]
end

subgraph group_media["Media pipeline"]
  node_fileprep["Media preparation<br/>[file_handle.py]"]
  node_voice["Voice synthesis"]
  node_audio["Narration audio"]
  node_renderer["Video renderer<br/>[video_gen.py]"]
  node_transcriber["Speech transcription<br/>[speech_srt_gen.py]"]
  node_subtitlefix["Subtitle correction<br/>[srt_correct.py]"]
  node_video["Rendered video"]
end

subgraph group_publishing["Publishing"]
  node_speechcontrol["Upload control<br/>[speech_control.py]"]
  node_douyin(("Douyin creator"))
end

subgraph group_optional["Optional video modes"]
  node_ganui["GAN desktop mode"]
  node_gan["GAN transforms<br/>[GAN.py]"]
  node_ganconfig["GAN settings<br/>[config.py]"]
end

node_user(("User"))
node_azure(("Azure Speech"))
node_ffmpeg(("FFmpeg"))
node_whisper(("Whisper"))

node_user -->|"starts"| node_cli
node_cli -->|"runs"| node_orchestrator
node_user -->|"enters content"| node_desktop
node_desktop -->|"generates video"| node_orchestrator
node_orchestrator -->|"selects topics"| node_text
node_orchestrator -->|"selects images"| node_images
node_orchestrator -->|"requests narration"| node_voice
node_voice -->|"synthesizes speech"| node_azure
node_voice -->|"writes audio"| node_audio
node_orchestrator -->|"prepares images"| node_fileprep
node_orchestrator -->|"builds video"| node_renderer
node_renderer -->|"uses narration"| node_audio
node_renderer -->|"renders and overlays"| node_ffmpeg
node_renderer -->|"requests subtitles"| node_transcriber
node_transcriber -.->|"transcribes audio"| node_whisper
node_renderer -->|"corrects captions"| node_subtitlefix
node_renderer -->|"writes result"| node_video
node_cli -->|"runs publishing flow"| node_speechcontrol
node_speechcontrol -->|"generates upload video"| node_orchestrator
node_speechcontrol -->|"uploads video"| node_douyin
node_desktop -->|"uploads when enabled"| node_speechcontrol
node_speechcontrol -->|"uploads file"| node_video
node_user -->|"starts optional mode"| node_ganui
node_ganui -->|"loads settings"| node_ganconfig
node_ganui -->|"runs transforms"| node_gan
node_ganui -->|"optionally uploads"| node_speechcontrol

click node_cli "https://github.com/richard0403/dy-auto/blob/main/dy-auto/main.py"
click node_desktop "https://github.com/richard0403/dy-auto/blob/main/dy-auto/main_win.py"
click node_text "https://github.com/richard0403/dy-auto/tree/main/DyText"
click node_images "https://github.com/richard0403/dy-auto/tree/main/DyPic"
click node_orchestrator "https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_video_gen.py"
click node_fileprep "https://github.com/richard0403/dy-auto/blob/main/dy-auto/file_handle.py"
click node_voice "https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_voice_gen.py"
click node_audio "https://github.com/richard0403/dy-auto/tree/main/DyTemp/temp_voice"
click node_renderer "https://github.com/richard0403/dy-auto/blob/main/dy-auto/video_gen.py"
click node_transcriber "https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_srt_gen.py"
click node_subtitlefix "https://github.com/richard0403/dy-auto/blob/main/dy-auto/srt_correct.py"
click node_video "https://github.com/richard0403/dy-auto/tree/main/DyTemp/temp_video"
click node_speechcontrol "https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_control.py"
click node_ganui "https://github.com/richard0403/dy-auto/blob/main/dy-auto/main_win_paddle_gan.py"
click node_gan "https://github.com/richard0403/dy-auto/blob/main/dy-auto/PaddleTools/GAN.py"
click node_ganconfig "https://github.com/richard0403/dy-auto/blob/main/dy-auto/PaddleTools/config.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_desktop,node_text,node_images,node_orchestrator,node_user toneBlue
class node_fileprep,node_voice,node_audio,node_renderer,node_transcriber,node_subtitlefix,node_video toneAmber
class node_speechcontrol,node_douyin toneMint
class node_ganui,node_gan,node_ganconfig toneRose
class node_azure,node_ffmpeg,node_whisper toneIndigo
```

## Components

### Content creation

- [CLI entry](https://github.com/richard0403/dy-auto/blob/main/dy-auto/main.py): `dy-auto/main.py`
- [Desktop UI](https://github.com/richard0403/dy-auto/blob/main/dy-auto/main_win.py): `dy-auto/main_win.py`
- [Text topics](https://github.com/richard0403/dy-auto/tree/main/DyText): `DyText`
- [Image library](https://github.com/richard0403/dy-auto/tree/main/DyPic): `DyPic`
- [Speech workflow](https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_video_gen.py): `dy-auto/speech_video_gen.py`

### Media pipeline

- [Media preparation](https://github.com/richard0403/dy-auto/blob/main/dy-auto/file_handle.py): `dy-auto/file_handle.py`
- [Voice synthesis](https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_voice_gen.py): `dy-auto/speech_voice_gen.py`
- [Narration audio](https://github.com/richard0403/dy-auto/tree/main/DyTemp/temp_voice): `DyTemp/temp_voice`
- [Video renderer](https://github.com/richard0403/dy-auto/blob/main/dy-auto/video_gen.py): `dy-auto/video_gen.py`
- [Speech transcription](https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_srt_gen.py): `dy-auto/speech_srt_gen.py`
- [Subtitle correction](https://github.com/richard0403/dy-auto/blob/main/dy-auto/srt_correct.py): `dy-auto/srt_correct.py`
- [Rendered video](https://github.com/richard0403/dy-auto/tree/main/DyTemp/temp_video): `DyTemp/temp_video`

### Publishing

- [Upload control](https://github.com/richard0403/dy-auto/blob/main/dy-auto/speech_control.py): `dy-auto/speech_control.py`
- **Douyin creator**

### Optional video modes

- [GAN desktop mode](https://github.com/richard0403/dy-auto/blob/main/dy-auto/main_win_paddle_gan.py): `dy-auto/main_win_paddle_gan.py`
- [GAN transforms](https://github.com/richard0403/dy-auto/blob/main/dy-auto/PaddleTools/GAN.py): `dy-auto/PaddleTools/GAN.py`
- [GAN settings](https://github.com/richard0403/dy-auto/blob/main/dy-auto/PaddleTools/config.py): `dy-auto/PaddleTools/config.py`

### Other components

- **User**
- **Azure Speech**
- **FFmpeg**
- **Whisper**

## Connections

- User → CLI entry: starts (evidence: `dy-auto/main.py`)
- CLI entry → Speech workflow: runs (evidence: `dy-auto/main.py`)
- User → Desktop UI: enters content (evidence: `dy-auto/main_win.py`)
- Desktop UI → Speech workflow: generates video (evidence: `dy-auto/main_win.py`)
- Speech workflow → Text topics: selects topics (evidence: `dy-auto/speech_video_gen.py`)
- Speech workflow → Image library: selects images (evidence: `dy-auto/speech_video_gen.py`)
- Speech workflow → Voice synthesis: requests narration (evidence: `dy-auto/speech_video_gen.py`)
- Voice synthesis → Azure Speech: synthesizes speech (evidence: `dy-auto/speech_voice_gen.py`)
- Voice synthesis → Narration audio: writes audio (evidence: `dy-auto/speech_voice_gen.py`)
- Speech workflow → Media preparation: prepares images (evidence: `dy-auto/speech_video_gen.py`)
- Speech workflow → Video renderer: builds video (evidence: `dy-auto/speech_video_gen.py`)
- Video renderer → Narration audio: uses narration (evidence: `dy-auto/video_gen.py`)
- Video renderer → FFmpeg: renders and overlays (evidence: `dy-auto/video_gen.py`)
- Video renderer → Speech transcription: requests subtitles (evidence: `dy-auto/video_gen.py`)
- Speech transcription → Whisper: transcribes audio (evidence: `readme.md`)
- Video renderer → Subtitle correction: corrects captions (evidence: `dy-auto/video_gen.py`)
- Video renderer → Rendered video: writes result (evidence: `dy-auto/video_gen.py`)
- CLI entry → Upload control: runs publishing flow (evidence: `dy-auto/main.py`)
- Upload control → Speech workflow: generates upload video (evidence: `dy-auto/speech_control.py`)
- Upload control → Douyin creator: uploads video (evidence: `dy-auto/speech_control.py`)
- Desktop UI → Upload control: uploads when enabled (evidence: `dy-auto/main_win.py`)
- Upload control → Rendered video: uploads file (evidence: `dy-auto/speech_control.py`)
- User → GAN desktop mode: starts optional mode (evidence: `dy-auto/main_win_paddle_gan.py`)
- GAN desktop mode → GAN settings: loads settings (evidence: `dy-auto/main_win_paddle_gan.py`)
- GAN desktop mode → GAN transforms: runs transforms (evidence: `dy-auto/main_win_paddle_gan.py`)
- GAN desktop mode → Upload control: optionally uploads (evidence: `dy-auto/main_win_paddle_gan.py`)
