How kleinflow/kleinflow works
KleinFlow is a local Gradio animation studio that turns user render settings, prompts, motion controls, and optional audio/video references into generated frames and exported video. The principal workflow is UI submission → validated frame planning → FLUX.2 Klein generation → temporal/color/post-processing → output files. The graph preserves documented branches such as VeloSeq, depth motion, semantic masks, interpolation, and upscaling. Some feature wiring is inferred only from documented responsibilities because several implementation files were not sampled; those uncertain edges are omitted.
Components 20
Interface & Control
- Gradio Studio
kleinflow/ui/app.py - Render Settings
kleinflow/core/settings.py
Animation Planning
- VeloSeq Planner
kleinflow/core/veloseq.py - Audio Reactive
kleinflow/core/audio_reactive.py - Camera Depth Motion
kleinflow/core/transform.py - Video Reference
kleinflow/core/video_reference.py - Semantic Masking
kleinflow/core/semantic_masking.py
Generation & Models
- Render Engine
kleinflow/core/renderer.py - Klein FP8 Backend
kleinflow/backends/klein_fp8.py
Temporal & Output
- Temporal Stack
kleinflow/core/temporal.py - Color Polish
kleinflow/core/final_polish.py - Frame Interpolation
kleinflow/core/frame_interpolation.py - Flow Upscaler
kleinflow/backends/flow_upscaler_unet.py - Video Export
kleinflow/core/video.py
Portable Runtime
- Application Launcher
app.py - Model Manifest
kleinflow/model_manifest.py - Local Model Files
kleinflow/model_manifest.py - Output Workspace
kleinflow/paths.py - Portable Paths
kleinflow/paths.py
Other components
- Animator
Connections 21
- Animator → Gradio Studio: submits render
- Application Launcher → Gradio Studio: launches UI
- Gradio Studio → Render Settings: edits settings
- Gradio Studio → Render Engine: starts render
- Render Engine → Render Settings: validates settings
- Render Engine → VeloSeq Planner: plans frames
- Audio Reactive → VeloSeq Planner: injects controls
- Render Engine → Camera Depth Motion: applies motion
- Render Engine → Video Reference: reads reference
- Render Engine → Semantic Masking: routes masks
- Render Engine → Klein FP8 Backend: generates frames
- Klein FP8 Backend → Local Model Files: loads models
- Model Manifest → Local Model Files: validates files
- Render Engine → Temporal Stack: stabilizes frames
- Render Engine → Color Polish: polishes frames
- Render Engine → Frame Interpolation: interpolates frames
- Render Engine → Flow Upscaler: upscales output
- Render Engine → Video Export: exports video
- Video Export → Output Workspace: writes results
- Portable Paths → Output Workspace: resolves paths
- Gradio Studio → Animator: shows results