conda create -n env_kohya_ss python==3.10.0
进入虚拟环境
conda activate env_kohya_ss
clone源码
git clone https://github.com/bmaltais/kohya_ss.git
进入项目根目录
cd kohya_ss
安装相关库
# 根据环境选择
pip install -r requirements_linux.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install -r requirements_windows_torch2.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
./gui.sh --listen 127.0.0.1 --server_port 7860 --inbrowser --share
output/train
文件夹output/train
文件夹models,logs
dataset/100_dataset
kohya_ss/dataset
kohya_ss/dataset/100_dataset # 100_dataset数据集文件夹,100_表示训练的批次
训练数据集路径为父级路径
kohya_ss/dataset
# output_models: 输出训练底模路径
kohya_ss/output/train/models
# output_logs:输出训练日志路径
kohya_ss/output/train/logs
# prompt :good,得到的底模名称
kohya_ss/models/2dn_2.safetensors
训练数据集路径为父级路径
kohya_ss/dataset
# output_models: 输出训练底模路径
kohya_ss/output/train/models
# output_logs:输出训练日志路径
kohya_ss/output/train/logs
# prompt :good,得到的底模名称
SDXL Model
ImportError: cannot import name 'StableDiffusionXLPipeline' from 'diffusers'
diffusers0.16.1版本改为0.18.2
pip uninstall diffusers
pip uninstall diffusers==0.18.2
StableDiffusionXLPipeline requires the invisible-watermark library but it was not found in your environment. You can install it with pip: pip install invisible-watermark>=2.0
pip install invisible-watermark>=2.0