Agent skill

Train Character Lora

by artokun in artokun/comfyui-mcp

Train a character/identity LoRA locally on FLUX.1-dev via the comfyui-mcp train tools (GPU Docker + ostris ai-toolkit).

MITAuto-check passedAI & LLM Engineering

Install Train Character Lora

skills CLI
$ npx skills add artokun/comfyui-mcp --skill train-character-lora -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install artokun/comfyui-mcp train-character-lora --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/artokun/comfyui-mcp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugin/skills/train-character-lora .claude/skills/train-character-lora && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
train-character-lora
GitHub stars
803
Token cost
~1.3k tokens
SKILL.md length
642 words
Files
1
Skills in repo
42
Repo updated
First seen
Licence
MIT

At a glance

Train a character/identity LoRA locally on FLUX.1-dev via the comfyui-mcp train tools (GPU Docker + ostris ai-toolkit).

  • Works in 5 steps: train_doctor {action:"doctor"}.… → train_prepare_dataset… → train_start {action:"start"}. Launch.… → …
  • The user wants to train a LoRA of a person/character from their photos on the local GPU
  • SKILL.md covers Overview, The flow (tool sequence), Dataset guidance and Params (sane defaults —…, plus 3 more sections
  • Needs HF_TOKEN

What it does

Train Character Lora is an agent skill from artokun/comfyui-mcp. 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.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Fine-tuning and Diffusion and image models. It works with ComfyUI, Docker and Model Context Protocol. The repository describes itself as: Local-first, agent-native control plane for ComfyUI — MCP server + sidebar agent that generates images, video & audio, authors and runs workflows, and edits your live graph in… The licence is MIT.

When your agent uses it

  • The user wants to train a LoRA of a person/character from their photos on the local GPU
  • Tasks that involve Fine-tuning
  • Tasks that involve Diffusion and image models

Example prompts

  • “/train-character-lora”

Requirements

  • Docker

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. train_doctor {action:"doctor"}. Preflight once per session. Checks docker daemon,
  2. train_prepare_dataset {action:"prepare"}. Stage the images. See "Dataset" below.
  3. train_start {action:"start"}. Launch. Returns a job id at once; training runs
  4. train_start {action:"status", id}. Poll progress (progress.step/totalSteps/loss,
  5. Done. status:"completed" means the .safetensors was copied to

What it can do on your machine

Read from SKILL.md and the folder at commit 6ad6fc0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • HF_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Train Character Lora loads about 1.3k tokens when it runs. Until then it costs about 96 tokens; SKILL.md has 642 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from artokun/comfyui-mcp at commit 6ad6fc0, republished under its MIT licence (© artokun). 642 words, ~1,309 tokens.

Download SKILL.mdSave it as .claude/skills/train-character-lora/SKILL.md (or your agent's skills folder).
name
train-character-lora
description
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.
globs
**/*.json

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 through the three train_* MCP tools. You (the LLM) are the UI. Each takes an action: train_prepare_dataset owns the datasets, train_start owns the jobs, and train_doctor owns the trainer itself. You generate the dataset, launch the job, watch progress, and the finished LoRA lands in ComfyUI models/loras/ and the LoRA catalog without further steps.

  • Base model: FLUX.1-dev (the 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 {action:"doctor"}. Preflight once per session. Checks docker daemon, --gpus all GPU passthrough, trainer image, HF_TOKEN. If image:false, run train_doctor {action:"build_image"} (one-time, several minutes, since it builds CUDA plus torch plus 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 {action:"prepare"}. Stage the images. See "Dataset" below.
  3. train_start {action:"start"}. Launch. Returns a job id at once; training runs detached.
  4. train_start {action:"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 LoRA catalog (result has the paths and catalog id). Verify by loading it in a Flux workflow (LoraLoaderModelOnly, strength 1.0) with the trigger word in the prompt.

Dataset guidance

Call train_prepare_dataset {action:"prepare"} with name, items: [{path, caption?}, ...] and a defaultCaption.

  • 10 to 30 varied images of the subject: different angles, expressions, lighting, backgrounds, distances (close-up, half-body, full-body). Variety beats count.
  • Trigger word: pick something rare and stable (e.g. ohwx, zxc_person), NOT a real word. Use it as defaultCaption and pass it as trigger to train_start.
  • Captions: describe what changes between images (pose, setting, clothing, expression); the model learns the constant identity from the images themselves. Start each caption with the trigger word, e.g. ohwx person sitting in a cafe, laughing, natural light. Keep them short and factual. When in doubt, the trigger word alone (defaultCaption) is a workable baseline.
  • Images are copied and renamed img_00001.<ext> etc. Source files are never modified.
Show full SKILL.md (263 more words)Show less

Params (sane defaults — override sparingly)

ParamDefaultWhen to change
steps2000200 for a smoke test; 1500–3000 real runs. More ≠ better (overbake = plasticky).
lr1e-45e-5 for a tighter/subtler identity.
rank1632 for very detailed characters.
resolution[512,768,1024][512] if VRAM-constrained.
quantizetrueKeep true on 24GB.
saveEvery / sampleEvery250Lower (100) to watch early progress.

Monitoring & judgement

  • train_start {action:"status"}'s progress.samples are host paths. Look at them. (ai-toolkit prints no saved-sample lines, so they populate at finalize from the output dir; mid-run you can look directly in the job's output/<name>/samples/ folder.) Identity should be recognizable by ~1/3 of the run; if samples stay generic past halfway, the run will likely underfit. Cancel (train_start {action:"cancel", id}) and check captions and trigger.
  • Loss should trend down and stabilize (~0.1 to 0.3); wild spikes usually mean lr too high.
  • Checkpoints save every saveEvery steps under the job's output/ dir, so a cancelled run isn't a total loss.

Failure modes

  • no_docker / no_image from train_start {action:"start"}: run train_doctor {action:"doctor"}, follow its hints.
  • OOM / CUDA errors in the log tail: drop resolution to [512], keep quantize:true, batch stays 1.
  • handoff failed in job error: training itself finished; the LoRA is still under the job's output/<name>/ dir. Copy it into models/loras/ manually and upsert the catalog.
  • First run is slow before step 1. FLUX.1-dev download (~24GB) plus latent caching. As long as the log tail moves, it's fine. The HF cache persists across runs.

Sources

  • Official: none found.
  • Empirical: sampler values, wiring, and prompt notes from working graphs in packs/ and observed renders; not a vendor prompting guide.

© artokun, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugin/skills/train-character-lora of artokun/comfyui-mcp.

Open the folder on GitHubat commit 6ad6fc0

Compare with similar skills

Train Character Lora next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Train Character Lora compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Train Character Lora this skillartokun/comfyui-mcp803—~1.3kAutomated safety check: PassMIT
Setupguaardvark/guaardvark257—~1.2kAutomated safety check: PassMIT
Comfyui Skill OpenclawHuangYuChuh/ComfyUI_Skills_OpenClaw413—~2.7kAutomated safety check: PassApache-2.0
ComfyUI Custom Node BuilderConstantineB6/comfy-pilot230—~897Automated safety check: PassMIT
Castguaardvark/guaardvark257—~673Automated safety check: PassMIT
Comfyuicalesthio/OpenMontage66k—~2kAutomated safety check: PassAGPL-3.0

Similar skills

  • Setup

    guaardvark/guaardvark

    Connect this agent to a running Guaardvark (self-hosted AI studio) and check what it can do right now.

    257 GitHub stars~1.2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Comfyui Skill Openclaw

    HuangYuChuh/ComfyUI_Skills_OpenClaw

    Run registered ComfyUI workflows through the fast comfyui-skill CLI, and use the official local Comfy MCP for live template, node, model, validation, and orchestration capabilities.

    413 GitHub stars~2.7k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • ComfyUI Custom Node Builder

    ConstantineB6/comfy-pilot

    Helps an agent write ComfyUI custom nodes in Python, including wrapping an existing script, mapping data types and handling image batches.

    230 GitHub stars~897 tokensUpdated 7 mo ago
    AI & LLM EngineeringAuto-check passed
  • Cast

    guaardvark/guaardvark

    Build consistent characters, environments and props in Guaardvark's Cast Library and train LoRAs for them locally (reference photos → vision bible → sample plan → approved samples → training).

    257 GitHub stars~673 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Comfyui

    calesthio/OpenMontage

    A skill your agent uses when working with ComfyUI workflows in OpenMontage, including comfyuiimage/comfyuivideo/comfyuimusic, custom workflowjson/workflowpath inputs, outputnode selection, missing…

    66k GitHub stars~2k tokensUpdated 7 days ago
    AI & LLM EngineeringAuto-check passed
  • Workflow Template Builder

    Mooshieblob1/MooshieUI

    Builds or modifies ComfyUI workflow JSON templates in MooshieUI's Rust backend (src-tauri/src/templates).

    207 GitHub stars~640 tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from artokun/comfyui-mcp

All 42 skills in this repo
  • AI Toolkit Trainer

    artokun/comfyui-mcp

    Train custom LoRAs with ostris AI-Toolkit. An agent skill from artokun/comfyui-mcp.

    803 GitHub stars~2.7k tokensUpdated 5 days ago
    Auto-check passed
  • Anima Base

    artokun/comfyui-mcp

    Anime/illustration text-to-image (ANIMA 1.0, ~2B Cosmos DiT).

    803 GitHub stars~4k tokensUpdated 5 days ago
    Auto-check passed
  • Civitai

    artokun/comfyui-mcp

    Discover Civitai models with the BUILT-IN downloadmodel action:"searchcivitai" and install/generate them locally.

    803 GitHub stars~1.1k tokensUpdated 5 days ago
    Auto-check passed
  • Color Correction

    artokun/comfyui-mcp

    Diagnose and fix video/image color OBJECTIVELY with the getimage (action:"analyzecolor") tool (scopes/stats such as black/white points, contrast, saturation, clipping, cast) instead of eyeballing a…

    803 GitHub stars~2.4k tokensUpdated 5 days ago
    Auto-check passed
  • Comfyui Frontend Extensions

    artokun/comfyui-mcp

    Authoring ComfyUI v2 frontend extensions with @comfyorg/extension-api, covering defineNode/defineExtension/defineWidget, shell UI (sidebar tabs, commands, hotkeys), typed events, and handles.

    803 GitHub stars~5.4k tokensUpdated 5 days ago
    Auto-check passed
  • Comfyui Launch Flags

    artokun/comfyui-mcp

    Pick the right ComfyUI startup flags for VRAM, attention, caching, and speed.

    803 GitHub stars~3.1k tokensUpdated 5 days ago
    Auto-check passed

Questions about Train Character Lora

What does Train Character Lora do?

Train a character/identity LoRA locally on FLUX.1-dev via the comfyui-mcp train tools (GPU Docker + ostris ai-toolkit). Train Character Lora is an agent skill from artokun/comfyui-mcp.1-dev via the comfyui-mcp train tools (GPU Docker + ostris ai-toolkit).

When should I use Train Character Lora?

Train Character Lora fits situations like: the user wants to train a LoRA of a person/character from their photos on the local GPU; tasks that involve Fine-tuning; tasks that involve Diffusion and image models.

How do I install Train Character Lora in Claude Code?

Run `npx skills add artokun/comfyui-mcp --skill train-character-lora -a claude-code`. Or copy the skill folder (plugin/skills/train-character-lora in artokun/comfyui-mcp) into .claude/skills/train-character-lora in your project. Claude Code loads it when a task matches its description.

How do I install Train Character Lora in Codex?

Run `npx skills add artokun/comfyui-mcp --skill train-character-lora -a codex`. Or copy the skill folder (plugin/skills/train-character-lora in artokun/comfyui-mcp) into .agents/skills/train-character-lora in your project. Codex loads it when a task matches its description.

Can I use Train Character Lora in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add artokun/comfyui-mcp --skill train-character-lora -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/train-character-lora, .gemini/skills/train-character-lora, .github/skills/train-character-lora and .opencode/skills/train-character-lora in your project.

What does Train Character Lora need to run?

Going by SKILL.md and its folder, Train Character Lora needs credentials named HF_TOKEN. Our summary lists: Docker.

Does Train Character Lora access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Train Character Lora safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Train Character Lora use?

Train Character Lora is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Train Character Lora use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Train Character Lora?

Skills that share tags, products or a category with Train Character Lora: Setup (guaardvark/guaardvark, 257 stars), Comfyui Skill Openclaw (HuangYuChuh/ComfyUI_Skills_OpenClaw, 413 stars), ComfyUI Custom Node Builder (ConstantineB6/comfy-pilot, 230 stars) and Cast (guaardvark/guaardvark, 257 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Train Character Lora?

artokun (a GitHub user) maintains it in artokun/comfyui-mcp, which has 803 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on October 5, 2026.

Source: artokun/comfyui-mcp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.