Portable FLUX.2 Klein animation studio for Windows and NVIDIA GPUs
Run a local Gradio studio for four-step renders, VeloSeq timelines, Depth-Lite motion,
audio-reactive control, video reference workflows, LoRA experiments, semantic masking,
temporal consistency, interpolation, and 2x post-upscaling.
Quick Start · User Guide · Workflows · Settings Reference · Troubleshooting
KleinFlow is a local animation environment built around the four-step FLUX.2 Klein 4B model. It combines a static FP8 transformer, a 4-bit Qwen text encoder, native FlowMatch img2img, and a portable Windows runtime.
The complete application runs from its own folder. It does not require a system Python installation, CUDA Toolkit installation, global FFmpeg, PATH changes, registry changes, or administrator access.
| Capability | |
|---|---|
| 🎥 Motion | 2D transforms, cinematic camera schedules, Depth-Lite 3D, Depth Warp 2.0, and video-reference motion |
| 🧬 VeloSeq | Keyframes, expressions, prompt blending, seed travel, and frame/second/beat timebases |
| 🎧 Audio Reactive | Enhanced DSP V2 analysis with beat, spectrum, stereo, and configurable VeloSeq injection |
| 🎞️ Temporal | Consistency profiles, overlap rendering, memory pyramid, cadence, FloweR prediction, and SEA-RAFT flow |
| 🎭 Semantic Masking | Florence-2 phrase grounding, GrabCut/soft masks, flow tracking, and selective effect routing |
| 🎨 Creative Control | Eight LoRA slots, prompt enhancement, presets, color matching, init preparation, and Final Polish |
| 📦 Post-Processing | Practical-RIFE interpolation, FlowUpscaler 2x, H.264 export controls, and audio muxing |
| 💾 Portable Workflow | Local models, local caches, resumable verified downloads, session restore, diagnostics, and JSON settings |
- Windows 11 AMD64
- NVIDIA Ampere or newer
- 12 GB VRAM minimum
- 16 GB VRAM recommended
- Internet access for the initial runtime and model downloads
- Approximately 7.08 GB for the required model bundle, plus the portable runtime
Run these files in order:
build_kleinflow.bat
download_models.bat
start.batbuild_kleinflow.bat creates the relocatable Python and FFmpeg runtime.
download_models.bat installs the required verified model bundle and offers
optional feature models. start.bat launches the local Gradio interface.
If portable\python\python.exe and portable\ffmpeg\bin\ffmpeg.exe are already
present, skip the build step:
download_models.bat
start.batGenerated frames, videos, settings, provenance, and diagnostics are written
under outputs\.
Important
Model files are downloaded separately and retain their own licenses. The default downloader deliberately avoids the larger official BF16 transformer.
| Component | Default implementation |
|---|---|
| Transformer | Photoroom FLUX.2 Klein 4B static FP8 |
| Text encoder | OzzyGT Qwen3-4B bitsandbytes 4-bit |
| Tokenizer, VAE, scheduler | Official FLUX.2 Klein components |
| Diffusion | Four-step FlowMatch Euler generation |
| Optional models | Practical-RIFE, Depth Anything V2 Small, Small Decoder, FloweR, SEA-RAFT, Florence-2, and FlowUpscaler |
See the Model Components guide for exact files, download flags, local paths, sizes, and runtime roles.
| Guide | Purpose |
|---|---|
| Quick Start | Build or unpack KleinFlow and make the first render |
| User Guide | Practical map of the complete Gradio interface |
| Workflow Recipes | Stable animation, depth, audio, video-reference, and post-processing recipes |
| Performance Guide | Resolution, speed, VRAM, and optional-feature tradeoffs |
| VeloSeq Manual | Keyframes, expressions, interpolation, timing, and audio variables |
| Settings Reference | Types, defaults, choices, ranges, and units for all 474 settings fields |
| Settings Schema | Machine-readable contract for compatible tools and LLMs |
| Portable Build Guide | Folder-portable runtime assembly |
| Troubleshooting | Common errors, logs, diagnostics, and recovery steps |
| Release Checklist | Clean-machine, GPU, relocation, and packaging release gates |
The complete documentation index is available at docs/README.md.
Made in Lisbon 🇵🇹 with AI and Love by C. Pinto @flisbonwlove
KleinFlow stands on the shoulders of giants. Deep gratitude goes to the open-source AI community and to the people building the research, models, and tools that made this project possible.
Core technology and model ecosystems include:
- Black Forest Labs FLUX.2
- Photoroom FLUX.2 Klein FP8
- OzzyGT Qwen3-4B 4-bit
- Unsloth Qwen3-4B 4-bit
- Hugging Face Diffusers
- PyTorch and TorchAO
- Gradio
- OpenCV and FFmpeg
Main inspiration
- Deforum Stable Diffusion
- Deforum for Automatic1111
- Stable Diffusion Parseq, by Robin Fernandes (
@rewbs) - Disco Diffusion, by Maxwell Ingham (
@Somnai_dreams), Adam Letts (@gandamu_ml), and its community
Motion, depth, and temporal research
- RAFT and SEA-RAFT, by Princeton Vision & Learning Lab
- AnimateDiff, by Guo Yuwei and contributors
- Practical-RIFE, by Huang Zhewei and contributors
- Depth Anything V2, by Lihe Yang et al. at HKU and TikTok
- Florence-2, by Bin Xiao et al. at Microsoft
- SD-CN Animation / FloweR, by Volotat and contributors
- FlowUpscaler, by Ainur (
@tensorforger) - WarpFusion, by Alexander Spirin (
@Sxela) - Pytti, by Henry Rachootin (
@sportsracer48) - Early Colab work by Katherine Crowson (
@crowsonkb) and the wider Colab AI-art community - banodoco AI art community
See THIRD_PARTY_NOTICES.md for implementation-level attribution, upstream licenses, and model notices.
If KleinFlow is useful to you and you want to support its continued development:
- ⭐ Star the repository and help other artists discover it.
- ☕ Buy the developer a coffee.
- 🐛 Report bugs or suggest features through GitHub Issues.
- 💻 Share presets and workflows, improve documentation, or submit pull requests.
If KleinFlow supports your research or creative work, please cite:
@software{Pinto2026KleinFlow,
author = {Pinto, C.},
title = {KleinFlow},
year = {2026},
publisher = {GitHub},
url = {https://github.com/kleinflow/kleinflow},
note = {Portable FLUX.2 Klein animation studio}
}KleinFlow source code is licensed under the GNU Affero General Public License v3.0. Model files are separate works and retain the licenses and usage conditions of their source repositories.
