Stable Diffusion Webui AI绘画进阶:训练一个LoRA微调模型

AI(Stable Diffusion Webui)LoRA

0. LoRA

LoRALowRank Adaptation of Large Language Models

GPT3 175BStable Diffusion V1150000  A100 GPU Hour

LoRAAI

AILora

AI

LoRA

Lora

  • Windows11
  •  RTX 3060 12G
  •  StableDiffusionWebUI

Lora

1.

Lorakohya_ss

  •  Python 3.10 
  •  Git
  • VS Visual Studio xxx redistributable

PythonPythongit

Visual Studio XXX  redistributable WindowsC Runtime (CRT)Standard C++MFCC++ AMPOpenMP

kohya_ss

git clone https://github.com/bmaltais/kohya_ss.git
cd kohya_ss .\setup.bat

gitgithub访GPU

CUDNN 8.6 

CUDNN

Cudnn

https://b1.thefileditch.ch/mwxKTEtelILoIbMbruuM.zip

kohya_ss

.\venv\Scripts\activate
python .\tools\cudann_1.8_install.py

 

gui.bat --listen 127.0.0.1 --server_port 7860 --inbrowser --share

gui.bat 

URL

2.

a.

b.

c.

Pinterest, Instagram...

1:1

P

QQ

Birme

QQ1:1 

kohya_sstrainDilireba

image : 

log

model

dilireba.json

image100_dilireba100便

100_dilireba

Utilities>Captioning>BLIP Captioning

Image folder to caption : 

Prefix to add to BLIP caption : 

Caption images 线

txt

dilireba a woman in a black dress with a red lipstick西

3.

Open

3

LoraSDWCheckpointSource model

Model Quick PickCustomV1.5,V2.1使线C

chilloutmix

safetensors

Image folder  image 

Output folder  model 

Logging folder  log 

Model output name 便++

Train batch size2 

Seed1234

Learning rate0.0001

Text Encoder 5e5

Unet 0.0001

Network : 128128

512x512

StepStep2 

800

logStart TensorBoard 

LosslossLoss

4.

lora使loramodel

LoraStableDiffusionWebUI

AIwebui 

lora

 a woman dilireba loraLoraLora10.70.8

Lorawearing a suit 穿西

LoraAI

LoraLora线

西

 

 

 

 

THE END