# Repository Briefing: Akegarasu/lora-scripts
> Source: https://repoforai.com/repo/Akegarasu/lora-scripts (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Akegarasu/lora-scripts
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: Python
- **License**: AGPL-3.0
- **Engineering Health**: A (77/100 · Maintenance 26/35 · Adoption 20/25 · Releases 20/20 · License 11/20)
- **Latest Release**: v2.0.0 (2026-11-03) — https://github.com/Akegarasu/lora-scripts/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Docker, Self-Hosted, GPU, MCP
- **Momentum**: 6,268 ★ total (+0 24h / +13 7d) · 693 forks
- **Topics**: `dreambooth`, `finetune`, `lora`, `stable-diffusion`
- **When to Use**: Best for: Individuals or teams with NVIDIA GPUs who repeatedly caption and clean image datasets, run local diffusion training, and want a single workspace with optional MCP access. Skip if: You only need an inference API, prefer managed GPU infrastructure, or already have a script-only training pipeline and do not need a GUI or agent integration.

## Overview
```text
### Architecture & Core Mechanics
SD-Trainer wraps kohya-ss/sd-scripts in a local web workspace for configuring and running diffusion training jobs. gui.py starts the application and serves the built frontend from frontend/dist. The GUI and the scripts/train.ps1 and scripts/train.sh launchers use the same training implementation, bundled under scripts/dev and tracking sd-scripts v0.12.3. The Python runtime uses PyTorch with pinned dependencies including Accelerate, Transformers, Diffusers, safetensors, bitsandbytes, and LyCORIS.

Training and caption generation share a GPU queue. The GUI also enables a built-in MCP server by default, exposing Streamable HTTP at /mcp/ on the same local service; mcp_server.py provides an optional standalone stdio entrypoint. MCP clients can inspect datasets, submit runs to the existing queue, monitor logs and metrics, and read output images. This is an interface to the training workspace, not a separate execution backend.

### Key Capabilities & Differentiators
The workspace supports LoRA and DreamBooth workflows, with a trainer catalog spanning SD, SDXL, SD3, FLUX.1, Chroma, Lumina, HunyuanImage 2.1, Anima, and MOSS-Image Base / SFT LoRA. The form adapts to the selected trainer and provides common and full parameter views, search, validation, and a setup checklist. Experimental trainers are marked, and MOSS-Image has separate model and dependency requirements. Runs retain configurations, status, and logs. Loss and learning-rate charts are read from TensorBoard-compatible event files without a separate TensorBoard server.

Captioning supports WD/CL taggers, BLIP/GIT-family models, and supported chat VLMs. It skips existing captions by default and lets users select images and review results before writing. The separate Tag Editor supports filters, suggestions, batch additions and removals, text or regex replacement, and normalization. Backups and conflict checks support rollback when caption files have not changed externally.

### Trade-offs & Limitations
Compared with running kohya-ss/sd-scripts directly, SD-Trainer adds trainer-aware forms, dataset cleanup, run history, and agent integration without changing the underlying training engine. That helps when preparing datasets and iterating on experiments in one workspace, but a scripted pipeline may not need the frontend or MCP service. The shared queue means a captioning job can delay training. Size VRAM using representative runs for the selected model family, image resolution, batch size, precision, and training options rather than assuming a single hardware minimum.

Compared with managed training, self-hosting keeps the local training pipeline under your control but leaves driver compatibility, weight acquisition, storage, and job scheduling to you. The Windows cu128 build changes the software compatibility profile, not the GPU generation floor. Keep the default loopback binding where possible: broadening network access also changes who may be able to reach a service that accepts training jobs and exposes logs and outputs. Review AGPL-3.0 obligations before distributing builds or making a modified version available to users over a network.

### Hardware & Deployment Guide
The quickest route on Windows x64 is the NVIDIA portable archive: it includes Python 3.11.9, the built frontend, and matching ONNX GPU runtime. The CUDA 13.0 build pairs with PyTorch 2.14.1 and needs an R580-or-newer driver; the CUDA 12.8 build uses PyTorch 2.11.0. Both require Turing or newer. Source installs need Git and recommend Python 3.11 x64; Python 3.10 must use the cu128 profile. Development checkouts require a frontend build with Corepack/pnpm and Node.js 22.12+ on the 22 LTS line or Node.js 24+. Node.js is not needed at runtime for the built frontend.

The Dockerfile builds the frontend in a Node 22 stage and packages it into a PyTorch CUDA runtime. The host needs a compatible NVIDIA driver and NVIDIA Container Toolkit; run with GPU access, publish port 28000 only to the intended interfaces, and mount datasets, model assets, and outputs under /app/lora-scripts. Supply weights and datasets separately; a self-hosted runtime does not mean the initial setup is offline. The v2 workspace unifies training configuration, captions, tag editing, and run metrics; the release history lists v1.10.0 in October 2024 and v2.0.0 in November 2026.
```

## Key Capabilities
```text
- Training engine: scripts/dev bundles sd-scripts v0.12.3; GUI jobs and Windows/Linux training launchers use the same bundled code.
- Trainer catalog: SD, SDXL, SD3, FLUX.1, Chroma, Lumina, HunyuanImage 2.1, Anima, and MOSS-Image Base / SFT LoRA, with experimental trainers marked in the UI.
- Dataset preparation: WD/CL taggers, BLIP/GIT-family models, and supported chat VLMs generate captions; the tag editor adds previews, backups, and conflict checks.
- Run diagnostics: Job configuration, status, and logs are retained; TensorBoard-compatible events feed loss and learning-rate charts without a separate TensorBoard server.
- Agent integration: Built-in Streamable HTTP MCP at /mcp/ and optional standalone stdio support; agent submissions share the existing queue.
- GPU packaging: Windows NVIDIA portable builds offer CUDA 13.0 and 12.8; Docker selects the PyTorch base and CUDA profile through PYTORCH_IMAGE and CUDA_FLAVOR.
```

## Quick Start / Clone
```bash
docker build -t lora-scripts:local .
docker run --gpus all -p 28000:28000 lora-scripts:local
```
