用 15-30 张图片微调模型,生成品牌风格或角色一致性的图片。

适用场景

Brands wanting consistent visual style, artists creating character series, e-commerce with consistent product styling.

前提条件

ComfyUI with Kohya training extension, GPU 12GB+ VRAM, 15-30 training images, SDXL or SD1.5 base model

工作流图

用 ComfyUI 训练自定义 LoRA 模型

Prepare Dataset
Configure Training Parameters
Start Training
Test the LoRA
Integrate into Pipeline

分步指南

  1. 1

    Prepare Dataset

    Collect 15-30 high-quality images of your subject/style. Crop to 512x512 or 1024x1024. Ensure variety in angles, lighting, and context. Create a text file for each image describing it. Place all in a training folder.

  2. 2

    Configure Training Parameters

    Use the Kohya LoRA training extension for ComfyUI. Set: base model (SDXL or SD1.5), learning rate 1e-4, batch size 1, epochs 10-20, LoRA rank 32-64. Higher rank = more style learning but more overfitting risk.

  3. 3

    Start Training

    Launch training. Monitor loss curves: training loss should decrease steadily, validation loss should not increase (overfitting signal). Training takes 1-4 hours depending on dataset size and GPU. Save checkpoints every 5 epochs.

  4. 4

    Test the LoRA

    Load the trained LoRA in ComfyUI using the LoRA Loader node. Generate images with prompts referencing your trained subject. Adjust LoRA strength (0.5-1.0) to balance style fidelity vs flexibility. Compare with base model outputs.

  5. 5

    Integrate into Pipeline

    Add the LoRA to your standard ComfyUI workflow. Use the LoRA Loader node before the generation node. Set strength to 0.7 as a starting point. Batch generate variations. Save successful prompts and settings for reuse.

标签

#comfyui#lora#training#custom-model#fine-tuning