train-character-lora

Featured

Train a character/identity LoRA locally on FLUX.1-dev via the comfyui-mcp train_* tools (GPU Docker + ostris ai-toolkit). Use when the user wants to train a LoRA of a person/character from their photos on the local GPU — covers dataset prep, launch, monitoring, and using the result in ComfyUI. For WAN/Z-Image training via the ai-toolkit UI see ai-toolkit-trainer.

AI & Automation 450 stars 76 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
88
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Train a Character LoRA (local, Flux.1-dev) ## Overview The trainer runs **ostris ai-toolkit's `run.py` inside a headless GPU Docker container**, driven entirely through `train_*` MCP tools — you (the LLM) are the UI. You generate the dataset, launch the job, watch progress, and the finished LoRA lands in ComfyUI `models/loras/` + the LoRA catalog automatically. - Base model: **FLUX.1-dev** (best proven character consistency; needs ~24GB VRAM with quantization — RTX 4090 class). - Phase-1 scope: **character LoRAs only**. Style/slider/edit and other bases come later. ## The flow (tool sequence) 1. **`train_doctor`** — preflight once per session. Checks docker daemon, `--gpus all` GPU passthrough, trainer image, HF_TOKEN. If `image:false` → run **`train_build_image`** (one-time, several minutes — CUDA + torch + ai-toolkit). If `hfTokenSet:false`, warn the user: the first run downloads FLUX.1-dev (gated HF repo) and needs `HF_TOKEN` in the MCP server env. 2. **`train_prepare_dataset`** — stage the images. See "Dataset" below. 3. **`train_start`** — launch. Returns a job id immediately; training runs detached. 4. **`train_status {id}`** — poll progress (`progress.step/totalSteps/loss`, recent `samples`, `log` tail). Poll on a slow cadence (every few minutes) — a 2000-step run is roughly an hour on a 4090. Don't block on it. 5. **Done** — `status:"completed"` means the `.safetensors` was copied to `models/loras/<name>.safetensors` and upserted into the...

Details

Author
artokun
Repository
artokun/comfyui-mcp
Created
5 months ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category