# dreamsartificial648-sketch/loravideotrainer architecture

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

- Interactive diagram: https://gitdiagram.com/dreamsartificial648-sketch/loravideotrainer
- Repository: https://github.com/dreamsartificial648-sketch/loravideotrainer

## Overview

LoRA Video Trainer is a local Windows desktop application for preparing video datasets, training Wan 2.1 T2V 1.3B LoRAs, and generating review clips. Its main workflow runs from importing or splitting clips, through captioning and validation, to latent/text caching, training, and test-video generation; the app also supports checkpoint resumption and storyboard organization. The graph reflects the documented stages and sampled app/tool behavior; cache, training, generation, and settings wiring is described by the README but their implementation excerpts were not provided.

Main entry points: [`app.py`](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/app.py) (Tkinter app), [`scripts/04_generate_sample.ps1`](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/04_generate_sample.ps1) (Sample generation), [`tools/split_video.py`](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/tools/split_video.py) (Video splitter), [`tools/validate_dataset.py`](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/tools/validate_dataset.py) (Dataset validator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop App"]
  node_app["Tkinter app<br/>[app.py]"]
  node_settings["Session settings<br/>[app.py]"]
end

subgraph group_dataset["Dataset Preparation"]
  node_clips["Video clips"]
  node_captions["Clip captions"]
  node_splitter["Video splitter<br/>[split_video.py]"]
  node_validator["Dataset validator"]
end

subgraph group_pipeline["Training Pipeline"]
  node_cache_video["Latent caching<br/>[01_cache_video.ps1]"]
  node_cache_text["Text caching<br/>[02_cache_text.ps1]"]
  node_trainer["LoRA training<br/>[03_train.ps1]"]
  node_checkpoints["LoRA checkpoints"]
  node_musubi["Musubi Tuner"]
end

subgraph group_generation["Generation &amp; Review"]
  node_storyboard["Take storyboard<br/>[app.py]"]
  node_generator["Sample generation"]
  node_samples["Generated takes"]
end

node_user(("Local user"))

node_user -->|"operates"| node_app
node_app -->|"restores saves"| node_settings
node_app -->|"imports previews"| node_clips
node_app -->|"edits captions"| node_captions
node_app -->|"launches splitting"| node_splitter
node_splitter -->|"writes clips"| node_clips
node_splitter -->|"writes captions"| node_captions
node_app -->|"launches validation"| node_validator
node_validator -->|"inspects videos"| node_clips
node_validator -->|"checks pairs"| node_captions
node_app -->|"starts stage"| node_cache_video
node_app -->|"starts stage"| node_cache_text
node_app -->|"starts training"| node_trainer
node_cache_video -->|"uses trainer engine"| node_musubi
node_cache_text -->|"uses trainer engine"| node_musubi
node_trainer -->|"runs training"| node_musubi
node_trainer -->|"saves checkpoints"| node_checkpoints
node_app -->|"starts generation"| node_generator
node_generator -->|"uses trainer engine"| node_musubi
node_app -->|"selects resume model"| node_checkpoints
node_generator -->|"loads LoRA"| node_checkpoints
node_generator -->|"writes takes"| node_samples
node_app -->|"organizes takes"| node_storyboard
node_storyboard -->|"references takes"| node_samples

click node_app "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/app.py"
click node_settings "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/app.py"
click node_storyboard "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/app.py"
click node_splitter "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/tools/split_video.py"
click node_validator "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/tools/validate_dataset.py"
click node_cache_video "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/01_cache_video.ps1"
click node_cache_text "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/02_cache_text.ps1"
click node_trainer "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/03_train.ps1"
click node_generator "https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/04_generate_sample.ps1"

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_app,node_settings,node_user toneBlue
class node_clips,node_captions,node_splitter,node_validator toneAmber
class node_cache_video,node_cache_text,node_trainer,node_checkpoints,node_musubi toneMint
class node_storyboard,node_generator,node_samples toneRose
```

## Components

### Desktop App

- [Tkinter app](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/app.py): `app.py`
- [Session settings](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/app.py): `app.py`

### Dataset Preparation

- **Video clips**
- **Clip captions**
- [Video splitter](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/tools/split_video.py): `tools/split_video.py`
- [Dataset validator](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/tools/validate_dataset.py): `tools/validate_dataset.py`

### Training Pipeline

- [Latent caching](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/01_cache_video.ps1): `scripts/01_cache_video.ps1`
- [Text caching](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/02_cache_text.ps1): `scripts/02_cache_text.ps1`
- [LoRA training](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/03_train.ps1): `scripts/03_train.ps1`
- **LoRA checkpoints**
- **Musubi Tuner**

### Generation & Review

- [Take storyboard](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/app.py): `app.py`
- [Sample generation](https://github.com/dreamsartificial648-sketch/loravideotrainer/blob/main/scripts/04_generate_sample.ps1): `scripts/04_generate_sample.ps1`
- **Generated takes**

### Other components

- **Local user**

## Connections

- Local user → Tkinter app: operates
- Tkinter app → Session settings: restores saves
- Tkinter app → Video clips: imports previews
- Tkinter app → Clip captions: edits captions
- Tkinter app → Video splitter: launches splitting
- Video splitter → Video clips: writes clips
- Video splitter → Clip captions: writes captions
- Tkinter app → Dataset validator: launches validation
- Dataset validator → Video clips: inspects videos
- Dataset validator → Clip captions: checks pairs
- Tkinter app → Latent caching: starts stage
- Tkinter app → Text caching: starts stage
- Tkinter app → LoRA training: starts training
- Latent caching → Musubi Tuner: uses trainer engine
- Text caching → Musubi Tuner: uses trainer engine
- LoRA training → Musubi Tuner: runs training
- LoRA training → LoRA checkpoints: saves checkpoints
- Tkinter app → Sample generation: starts generation
- Sample generation → Musubi Tuner: uses trainer engine
- Tkinter app → LoRA checkpoints: selects resume model
- Sample generation → LoRA checkpoints: loads LoRA
- Sample generation → Generated takes: writes takes
- Tkinter app → Take storyboard: organizes takes
- Take storyboard → Generated takes: references takes
