這里參考了https://www.bilibili.com/video/BV1fs4y1x7p2/?vd_source=419c9ebc4060e9bec24d95773bba5275 LoRA 模型訓(xùn)練教程 一鍵包
以及:
https://colab.research.google.com/drive/1_f0qJdM43BSssNJWtgjIlk9DkIzLPadx#scrollTo=8Qp6STJk2Wjh
首先是安裝miniconda 或者 anaconda 來獲得虛擬環(huán)境:
wget https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh
chmod +x Anaconda3-5.3.0-Linux-x86_64.sh
./Anaconda3-5.3.0-Linux-x86_64.sh
建立虛擬環(huán)境:
conda create -n Lora python=3.10
conda init bash #添加conda環(huán)境進(jìn)入Bash configuration file
source /root/.bashrc #重新加載bash配置
conda activate lora # 加載虛擬環(huán)境
這里我們只需要有python 3.10的環(huán)境即可:
之后git得到文件(沒有g(shù)it,自行安裝git):
git clone --recurse-submodules https://github.com/Akegarasu/lora-scripts
cd lora-scripts && git pull && git submodule update --init --recursive
安裝依賴(確保你有pip):
cd home/lora-scripts/sd-scripts/
pip -q install --upgrade -r requirements.txt
安裝xformers:
pip install -U xformers
或者:
conda install xformers
安裝Triton:
pip -q install triton
安裝lion:文章來源:http://www.zghlxwxcb.cn/news/detail-563112.html
pip -q install --upgrade lion-pytorch locon
此時已經(jīng)安裝完成。修改train.sh的數(shù)據(jù)進(jìn)行訓(xùn)練即可。文章來源地址http://www.zghlxwxcb.cn/news/detail-563112.html
到了這里,關(guān)于在Linux云服務(wù)器上部署stable diffusion的lora訓(xùn)練的另一種方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!