技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
sd-scripts【数据与研究】Use sd-scripts for Stable Diffusion and image-model training, dataset preparation, image generation, LoRA/model utilities, and troubleshooting across SD1/2, SDXL, SD3, FLUX, Lumina, HunyuanImage, and Anima workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when a user asks for help with sd-scripts, Kohya-style Stable Diffusion training scripts, LoRA/additional-network training, dataset TOML preparation, image generation, or model/LoRA utility workflows.
This skill is self-contained for planning, validation, troubleshooting, and command construction. Heavyweight sd-scripts training/generation/merge commands still require the user to run them in an sd-scripts installation that contains the project scripts, model files, and required ML dependencies.
sub-skills/data-preparation for dataset TOML, DreamBooth/fine-tuning subsets, metadata JSON/JSONL, captions/tags, validation splits, bucketing, masked loss, inpainting data, and safe input validation.sub-skills/training for LoRA/additional-network training, full fine-tuning, Textual Inversion, LECO, ControlNet-LLLite, validation loss, memory flags, optimizer choices, and model-family training commands.sub-skills/generation for image generation, txt2img/img2img/inpainting inference, prompt-file validation, SDXL conditioning, LoRA application during inference, ControlNet/LLLite generation, and minimal inference scripts.sub-skills/model-utilities for LoRA merge/extract/resize/convert planning, checkpoint or Diffusers conversion, safetensors metadata inspection, model-spec metadata, and safe handling of write-heavy utilities.sd-scripts is normally used from a cloned checkout with Python 3.10-3.12 and a workflow-specific PyTorch install. PyTorch is intentionally not pinned in the project requirements because CUDA, driver, GPU architecture, and platform determine the correct wheel.
A typical setup pattern is:
python -m venv venv
source venv/bin/activate
python -m pip install torch torchvision --index-url <matching-pytorch-wheel-index>
python -m pip install --upgrade -r requirements.txt
accelerate config
On Windows, use the venv activation command for PowerShell or cmd, and match the PyTorch CUDA wheel to the installed NVIDIA driver. For RTX 50-series or other new GPUs, use a recent PyTorch/CUDA wheel that supports the architecture.
scripts/check_sd_scripts_environment.py checks the active Python for common dependencies and optional backend availability without importing or running training scripts.sub-skills/data-preparation/scripts/validate_dataset_inputs.py validates dataset config and metadata files without loading models.sub-skills/training/scripts/build_training_command.py prints command templates and never launches training.sub-skills/generation/scripts/validate_prompt_file.py validates prompt files without loading models.sub-skills/model-utilities/scripts/inspect_safetensors_metadata.py reads safetensors metadata without loading tensor payloads.references/repo-provenance.md: source snapshot used to generate this skill; read before deciding whether to refresh the skill.references/troubleshooting.md: cross-cutting install, dependency, hardware, and execution-safety failures.references/developer-notes.md: repo-specific conventions for coding agents and maintainers.--help, metadata inspection, and dry-run planning first.