Preliminary release (v0.4.x) — Rengu Flow is under active development. APIs, config keys, CLI commands, and documentation may change in breaking or non-breaking ways between releases. Pin versions and re-read the docs when upgrading.
A TOML-driven training framework for diffusion models. You describe a run in a config file — model, adapter, optimizer, LR scheduler, dataset, and training options — and Rengu Flow launches it with DeepSpeed. Everything is modular and registry-based: models, adapters, optimizers, and schedulers are selected and configured entirely from TOML, with an optional local web UI on top.
rengu CLI drives uv: it creates the venv, installs Python, and pulls only the optional extras a given config needs (e.g. Cosmos deps when [model] type = "cosmos_predict2").save, save_quit, export_model, preview_now, …) to checkpoint, export, preview, or exit cleanly — no API or restart required.rengu prep) — Auto-tagging, captioning, watermark cleanup, and a bulk tag editor for preparing training data (guide).torch.compile.| Model | Type | Adapters | Notes |
|---|---|---|---|
| Stable Diffusion XL | sdxl | LoRA, LoKr, LyCORIS, full finetune | Optional UNet-only via freeze_text_encoders. |
| Cosmos Predict2 / Anima | cosmos_predict2 (alias anima) | LoRA, LoKr, LyCORIS, full finetune | DiT + Wan VAE + Qwen3/T5. Anima checkpoints are this architecture; type = "anima" is accepted as a legacy alias. Needs the cosmos extra. |
Adapter selection. Set [adapter] type = "lora" / "lokr" / a lycoris_* type; omit [adapter] entirely for full-model finetune. The LyCORIS family (requires the lycoris extra) covers: lycoris_locon, lycoris_loha, lycoris_lokr, lycoris_dylora, lycoris_glora, lycoris_diag_oft, lycoris_boft (DoRA is the dora_wd toggle on locon/loha/lokr, not a separate type). See SDXL training, Cosmos Predict2 / Anima, and full-model finetuning.
You install these (system level):
deepspeed engine) or native Windows (single-GPU, the accelerate engine — no DeepSpeed required). See the native Windows install guide and the WSL workflow.nvidia-smi). Download: NVIDIA drivers.nvcc, which DeepSpeed uses to JIT-compile its C++/CUDA ops on the deepspeed engine (Linux/WSL). Its major version must match the PyTorch build (CUDA 13). The native-Windows accelerate engine does not use DeepSpeed, so nvcc is optional there (only torch.compile benefits from a toolchain). Point CUDA_HOME at the toolkit if it is not auto-detected. Download: CUDA Toolkit 13.x.PATH for ./rengu (and rengu.cmd on Windows). uv creates .venv and installs a compatible Python (3.10–3.13) automatically; no separate system python3 needed. Install: uv.torch.compile. Download: VS Build Tools (select "Desktop development with C++").rengu ui / rengu ui build); the API itself is pure Python. The frontend uses Vite 8, which requires Node.js ≥ 20.19 or ≥ 22.12 — the 22 LTS line is recommended (older Node, e.g. 18, fails the build). Builds prefer pnpm (npm is used as a fallback). With Volta, set it per project: volta pin node@22 pnpm. Download: Node.js.Installed automatically (by rengu init / uv sync):
torch==2.12.0+cu130), torchvision 0.27, and DeepSpeed 0.19, from the PyTorch cu130 index.nvidia-*-cu13 packages). You do not install cuDNN or the runtime libraries separately.Tested stack (May 2026, WSL2 + NVIDIA): Python 3.13, torch 2.12.0+cu130, torchvision 0.27.0+cu130, deepspeed 0.19.0 — verified end-to-end on an 8 GB RTX 3000 Ada (SDXL + Cosmos LoRA and SDXL full-finetune smokes).
From the repository root (Linux):
./rengu init # create rengu.local.toml + uv sync (base training stack)
./rengu init ui # also install the web UI extra
The ./rengu wrapper runs uv sync on first use, so the venv is built automatically. Install optional extras by listing profiles:
./rengu init cosmos lycoris # Cosmos Predict2 + LyCORIS adapters
./rengu init all # every documented extra
| Profile | Installs |
|---|---|
base | Core training stack (default) |
ui | Local web control panel |
cosmos / cosmos_predict2 | Cosmos Predict2 / Anima |
lycoris | LyCORIS adapter family (incl. LoKr backend) |
optim | Extended optimizers |
kaon | K-Optimizers (git-pinned: Adakaon, AdaMuon, KProdigy, …) |
prep | Dataset Studio (taggers, captioners, watermark cleanup) |
dev | Test/dev tools |
all | All of the above |
./rengu init --only-config writes rengu.local.toml and directories without syncing. Advanced users can run uv sync themselves and call .venv/bin/rengu directly. Before any train/validate/cache (and prep/ui), Rengu Flow inspects what it needs and auto-installs any missing extras — additively, leaving your other profiles in place.
Adding a profile later? Use
./rengu init <profile>or./rengu update(both additive). A bareuv sync --extra <x>is an exact sync: it installs that extra but removes any you don't list — e.g.uv sync --extra prepafter a UI install drops theuiextra (uvicorn) and the UI stops serving. Re-list every extra you want, or just let the on-demand installer handle it.
./rengu update # stable channel: fast-forward main, re-sync, rebuild UI if present
./rengu update --beta # beta channel: switch to the develop branch and update it
rengu update pulls the latest project code, re-syncs dependencies from the lockfile, and recompiles the web UI if it was built locally. It also refreshes the optional profiles you already installed (so git-pinned extras like kaon move to their new commit pin); profiles you never installed are left alone.
Release channels. rengu update tracks main (stable); rengu update --beta switches the checkout to the develop branch (beta) and updates it. Switching back is just rengu update. While on the beta channel, rengu version and the web UI show a beta marker — the channel is derived from the git branch, not the version number. Useful flags: --all-extras (every documented extra), --no-pull (skip the git pull), and --force (discard local tracked code changes and hard-reset when a fast-forward is blocked — never touches untracked/ignored files, so your UI data dir and jobs.db are safe). Check your version with ./rengu version.
Set up the environment:
./rengu init
Local settings (optional). rengu init creates rengu.local.toml (gitignored) for machine settings — UI host/port, default GPU count, master port, and subprocess env vars. Model checkpoint paths go in the training TOML, not here. See rengu.local.toml.example.
Create a training config from an example:
cp examples/minimal_config_lora_sdxl.toml my_train.toml
Edit my_train.toml: set the dataset path and [model] paths (e.g. checkpoint_path for SDXL).
Train:
./rengu train --config my_train.toml
./rengu validate --config my_train.toml./rengu cache --config my_train.toml./rengu train --config my_train.toml --resume-from-checkpointdeepspeed --num_gpus=1 -m rengu_flow.main --config my_train.tomlSee the CLI guide for every command, flag, and rengu.local.toml key.
| Command | Description |
|---|---|
rengu init [profiles…] | Create rengu.local.toml + UI data dir, uv sync the chosen profiles |
rengu update [profiles…] | Pull, re-sync from uv.lock, refresh installed extras, rebuild UI |
rengu version | Print Rengu Flow version, git commit, and installed kaon version |
rengu train --config PATH | Launch a DeepSpeed training run (--num-gpus, --master-port, --resume-from-checkpoint) |
rengu validate --config PATH | Validate a training config and exit |
rengu cache --config PATH | Build the dataset cache and exit |
rengu dump-dataset PATH | Inspect a dataset TOML |
rengu prep <tag|caption|clean|models> | Dataset Studio: tagging, captioning, watermark cleanup, model list/download |
rengu ui [start|serve|dev|build|reset-db] | Run or build the local web UI |
Trailing args after -- are forwarded to the trainer (e.g. ./rengu train --config my.toml -- --regenerate_cache). Full flag reference: CLI guide.
./rengu ui start
Builds the frontend if needed, serves the API, and opens a browser. The UI lets you edit training configs and datasets, launch and queue runs, send signal files, and watch live progress and previews. Live progress is parsed from the job's stdout — no extra config required. See the Web UI user guide.
Training reacts to signal files dropped in the run directory (also exposed as buttons in the UI):
| Signal | Effect |
|---|---|
save / save_quit | Checkpoint now (and exit). |
export_model / export_model_quit | Export inference weights now (and exit). |
preview_now | Render the configured preview prompts on the next step. |
continue / quit | Resume after an export-wait pause / exit without saving. |
Details and the full list: signal files.
Rengu Flow is a preliminary release under active development; treat config keys and CLI flags as subject to change between versions. A few specific notes:
accelerate engine (plain PyTorch, no DeepSpeed). Multi-GPU, optimizer.gradient_release, blocks_to_swap, and pipeline_stages > 1 require the deepspeed engine and are Linux/WSL2 only (they patch DeepSpeed's pipeline engine; Windows has no NCCL). Everything else — caching, gradient accumulation, per-resolution micro-batches, resolution schedules, activation_offload, activation_checkpointing, torch.compile, EMA, eval/previews — works on both. See the native Windows install guide. On WSL2, do not set PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True" — Rengu Flow detects WSL and applies safe defaults automatically (see the CLI guide).load_and_fuse_adapter is intentionally unsupported; load adapter weights instead.Rengu Flow incorporates and adapts work from several projects. See THIRD_PARTY_NOTICES.md for full notices and licenses:
rengu_flow/vendor/diffusion_pipe_optimizers/.Rengu Flow is distributed under the GNU General Public License v3.0 or later (LICENSE). See THIRD_PARTY_NOTICES.md for incorporated components and their licenses.
114 commits
Python
72.9%
Vue
16.6%
TypeScript
9.0%
Shell
1.0%
Preliminary release (v0.4.x) — Rengu Flow is under active development. APIs, config keys, CLI commands, and documentation may change in breaking or non-breaking ways between releases. Pin versions and re-read the docs when upgrading.
A TOML-driven training framework for diffusion models. You describe a run in a config file — model, adapter, optimizer, LR scheduler, dataset, and training options — and Rengu Flow launches it with DeepSpeed. Everything is modular and registry-based: models, adapters, optimizers, and schedulers are selected and configured entirely from TOML, with an optional local web UI on top.
rengu CLI drives uv: it creates the venv, installs Python, and pulls only the optional extras a given config needs (e.g. Cosmos deps when [model] type = "cosmos_predict2").save, save_quit, export_model, preview_now, …) to checkpoint, export, preview, or exit cleanly — no API or restart required.rengu prep) — Auto-tagging, captioning, watermark cleanup, and a bulk tag editor for preparing training data (guide).torch.compile.| Model | Type | Adapters | Notes |
|---|---|---|---|
| Stable Diffusion XL | sdxl | LoRA, LoKr, LyCORIS, full finetune | Optional UNet-only via freeze_text_encoders. |
| Cosmos Predict2 / Anima | cosmos_predict2 (alias anima) | LoRA, LoKr, LyCORIS, full finetune | DiT + Wan VAE + Qwen3/T5. Anima checkpoints are this architecture; type = "anima" is accepted as a legacy alias. Needs the cosmos extra. |
Adapter selection. Set [adapter] type = "lora" / "lokr" / a lycoris_* type; omit [adapter] entirely for full-model finetune. The LyCORIS family (requires the lycoris extra) covers: lycoris_locon, lycoris_loha, lycoris_lokr, lycoris_dylora, lycoris_glora, lycoris_diag_oft, lycoris_boft (DoRA is the dora_wd toggle on locon/loha/lokr, not a separate type). See SDXL training, Cosmos Predict2 / Anima, and full-model finetuning.
You install these (system level):
deepspeed engine) or native Windows (single-GPU, the accelerate engine — no DeepSpeed required). See the native Windows install guide and the WSL workflow.nvidia-smi). Download: NVIDIA drivers.nvcc, which DeepSpeed uses to JIT-compile its C++/CUDA ops on the deepspeed engine (Linux/WSL). Its major version must match the PyTorch build (CUDA 13). The native-Windows accelerate engine does not use DeepSpeed, so nvcc is optional there (only torch.compile benefits from a toolchain). Point CUDA_HOME at the toolkit if it is not auto-detected. Download: CUDA Toolkit 13.x.PATH for ./rengu (and rengu.cmd on Windows). uv creates .venv and installs a compatible Python (3.10–3.13) automatically; no separate system python3 needed. Install: uv.torch.compile. Download: VS Build Tools (select "Desktop development with C++").rengu ui / rengu ui build); the API itself is pure Python. The frontend uses Vite 8, which requires Node.js ≥ 20.19 or ≥ 22.12 — the 22 LTS line is recommended (older Node, e.g. 18, fails the build). Builds prefer pnpm (npm is used as a fallback). With Volta, set it per project: volta pin node@22 pnpm. Download: Node.js.Installed automatically (by rengu init / uv sync):
torch==2.12.0+cu130), torchvision 0.27, and DeepSpeed 0.19, from the PyTorch cu130 index.nvidia-*-cu13 packages). You do not install cuDNN or the runtime libraries separately.Tested stack (May 2026, WSL2 + NVIDIA): Python 3.13, torch 2.12.0+cu130, torchvision 0.27.0+cu130, deepspeed 0.19.0 — verified end-to-end on an 8 GB RTX 3000 Ada (SDXL + Cosmos LoRA and SDXL full-finetune smokes).
From the repository root (Linux):
./rengu init # create rengu.local.toml + uv sync (base training stack)
./rengu init ui # also install the web UI extra
The ./rengu wrapper runs uv sync on first use, so the venv is built automatically. Install optional extras by listing profiles:
./rengu init cosmos lycoris # Cosmos Predict2 + LyCORIS adapters
./rengu init all # every documented extra
| Profile | Installs |
|---|---|
base | Core training stack (default) |
ui | Local web control panel |
cosmos / cosmos_predict2 | Cosmos Predict2 / Anima |
lycoris | LyCORIS adapter family (incl. LoKr backend) |
optim | Extended optimizers |
kaon | K-Optimizers (git-pinned: Adakaon, AdaMuon, KProdigy, …) |
prep | Dataset Studio (taggers, captioners, watermark cleanup) |
dev | Test/dev tools |
all | All of the above |
./rengu init --only-config writes rengu.local.toml and directories without syncing. Advanced users can run uv sync themselves and call .venv/bin/rengu directly. Before any train/validate/cache (and prep/ui), Rengu Flow inspects what it needs and auto-installs any missing extras — additively, leaving your other profiles in place.
Adding a profile later? Use
./rengu init <profile>or./rengu update(both additive). A bareuv sync --extra <x>is an exact sync: it installs that extra but removes any you don't list — e.g.uv sync --extra prepafter a UI install drops theuiextra (uvicorn) and the UI stops serving. Re-list every extra you want, or just let the on-demand installer handle it.
./rengu update # stable channel: fast-forward main, re-sync, rebuild UI if present
./rengu update --beta # beta channel: switch to the develop branch and update it
rengu update pulls the latest project code, re-syncs dependencies from the lockfile, and recompiles the web UI if it was built locally. It also refreshes the optional profiles you already installed (so git-pinned extras like kaon move to their new commit pin); profiles you never installed are left alone.
Release channels. rengu update tracks main (stable); rengu update --beta switches the checkout to the develop branch (beta) and updates it. Switching back is just rengu update. While on the beta channel, rengu version and the web UI show a beta marker — the channel is derived from the git branch, not the version number. Useful flags: --all-extras (every documented extra), --no-pull (skip the git pull), and --force (discard local tracked code changes and hard-reset when a fast-forward is blocked — never touches untracked/ignored files, so your UI data dir and jobs.db are safe). Check your version with ./rengu version.
Set up the environment:
./rengu init
Local settings (optional). rengu init creates rengu.local.toml (gitignored) for machine settings — UI host/port, default GPU count, master port, and subprocess env vars. Model checkpoint paths go in the training TOML, not here. See rengu.local.toml.example.
Create a training config from an example:
cp examples/minimal_config_lora_sdxl.toml my_train.toml
Edit my_train.toml: set the dataset path and [model] paths (e.g. checkpoint_path for SDXL).
Train:
./rengu train --config my_train.toml
./rengu validate --config my_train.toml./rengu cache --config my_train.toml./rengu train --config my_train.toml --resume-from-checkpointdeepspeed --num_gpus=1 -m rengu_flow.main --config my_train.tomlSee the CLI guide for every command, flag, and rengu.local.toml key.
| Command | Description |
|---|---|
rengu init [profiles…] | Create rengu.local.toml + UI data dir, uv sync the chosen profiles |
rengu update [profiles…] | Pull, re-sync from uv.lock, refresh installed extras, rebuild UI |
rengu version | Print Rengu Flow version, git commit, and installed kaon version |
rengu train --config PATH | Launch a DeepSpeed training run (--num-gpus, --master-port, --resume-from-checkpoint) |
rengu validate --config PATH | Validate a training config and exit |
rengu cache --config PATH | Build the dataset cache and exit |
rengu dump-dataset PATH | Inspect a dataset TOML |
rengu prep <tag|caption|clean|models> | Dataset Studio: tagging, captioning, watermark cleanup, model list/download |
rengu ui [start|serve|dev|build|reset-db] | Run or build the local web UI |
Trailing args after -- are forwarded to the trainer (e.g. ./rengu train --config my.toml -- --regenerate_cache). Full flag reference: CLI guide.
./rengu ui start
Builds the frontend if needed, serves the API, and opens a browser. The UI lets you edit training configs and datasets, launch and queue runs, send signal files, and watch live progress and previews. Live progress is parsed from the job's stdout — no extra config required. See the Web UI user guide.
Training reacts to signal files dropped in the run directory (also exposed as buttons in the UI):
| Signal | Effect |
|---|---|
save / save_quit | Checkpoint now (and exit). |
export_model / export_model_quit | Export inference weights now (and exit). |
preview_now | Render the configured preview prompts on the next step. |
continue / quit | Resume after an export-wait pause / exit without saving. |
Details and the full list: signal files.
Rengu Flow is a preliminary release under active development; treat config keys and CLI flags as subject to change between versions. A few specific notes:
accelerate engine (plain PyTorch, no DeepSpeed). Multi-GPU, optimizer.gradient_release, blocks_to_swap, and pipeline_stages > 1 require the deepspeed engine and are Linux/WSL2 only (they patch DeepSpeed's pipeline engine; Windows has no NCCL). Everything else — caching, gradient accumulation, per-resolution micro-batches, resolution schedules, activation_offload, activation_checkpointing, torch.compile, EMA, eval/previews — works on both. See the native Windows install guide. On WSL2, do not set PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True" — Rengu Flow detects WSL and applies safe defaults automatically (see the CLI guide).load_and_fuse_adapter is intentionally unsupported; load adapter weights instead.Rengu Flow incorporates and adapts work from several projects. See THIRD_PARTY_NOTICES.md for full notices and licenses:
rengu_flow/vendor/diffusion_pipe_optimizers/.Rengu Flow is distributed under the GNU General Public License v3.0 or later (LICENSE). See THIRD_PARTY_NOTICES.md for incorporated components and their licenses.
114 commits
Python
72.9%
Vue
16.6%
TypeScript
9.0%
Shell
1.0%