kohya_ss GUI安装教程

kohya_ss GUI安装教程

先附上两张我生成的动漫美女

00013-559677006

00013-559677006

介绍:

This repository contains training, generation and utility scripts for Stable Diffusion.

kohyass是用来训练Stable Diffusion模型的。

1.conda创建python虚拟环境

conda create -n kohyass python=3.10 -y
conda activate kohyass

3.clone项目并下载依赖

git clone https://ghproxy.com/https://github.com/kohya-ss/sd-scripts.git
cd sd-scripts
设置清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
安装依赖
pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
pip install --upgrade -r requirements.txt

4.安装xformers(可选)

git clone https://ghproxy.com/https://github.com/facebookresearch/xformers/
cd xformers/

回退到0.0.4dev0版本,保持和kohya-ss使用的windows预编译版本一致,避免可能的兼容问题

git reset --hard 3633e1afc7bffbe61957f04e7bb1a742ee910ace
cd .git/
vi config
替换所有的github链接为加速链接 https://ghproxy.com/
git submodule update --init --recursive
# 强制使用CUDA,不开启可能会导致xformers未和CUDA一起编译
export FORCE_CUDA="1"
# 进入https://developer.nvidia.com/cuda-gpus#compute
# 设置所用显卡对应的Compute Capability,3090和A5000都是8.6
export TORCH_CUDA_ARCH_LIST=7.0
# PATH环境变量中追加cuda目录,确保编译时能识别镜像预置的cuda11.6
export PATH=$PATH:/usr/local/cuda
# 确保gcc编译时能够识别cuda的头文件
export CPATH=/usr/local/cuda/targets/x86_64-linux/include

pip install -r requirements.txt
pip install -e .

在sd-scripts同级目录安装kohya_ss

git clone https://ghproxy.com/https://github.com/bmaltais/kohya_ss.git
pip install --upgrade -r requirements.txt

启动webui

python ./kohya_gui.py --listen 127.0.0.1 --server_port 7860 --inbrowser --share

效果如下:

image-20230424130232093

最后欢迎大家猫说AI(wx搜索哦),会持续分享更多免费教程! 你的关注就是我的动力!

公众号还接入了chatgpt哦,免费给大家使用!

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值