File size: 1,501 Bytes
e5615b2 58a7ae2 4317407 e5615b2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#使用 bash指令執行這個腳本 ---> bash trainFlux.sh
#!/bin/bash
cd /workspace
wget --trust-server-name --content-disposition https://huggingface.co/housearch/thu/resolve/main/trainFlux/download_caption_flux.py
wget --trust-server-name --content-disposition https://huggingface.co/housearch/thu/resolve/main/trainFlux/landscapeOverhead_A6000_flux.json
python -m venv env
source /workspace/env/bin/activate
pip install datasets huggingface_hub Pillow
python download_caption_flux.py
deactivate
cd /workspace
git clone https://github.com/bmaltais/kohya_ss
cd kohya_ss
#預設是訓練SD1.5, SDXL的版本,如果要訓練SD3, Flux 必須切換至sd3-flux.1
git branch -a
git checkout sd3-flux.1
./setup-runpod.sh
./gui.sh --share --headless
'''
另開 terminal 視窗,把以下內容貼上並按下enter執行,直接下載訓練Flux LoRA必須的相關模型(節省時間)
wget --trust-server-name --content-disposition https://huggingface.co/realung/flux1-dev.safetensors/resolve/main/flux1-dev.safetensors
wget --trust-server-name --content-disposition https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors
wget --trust-server-name --content-disposition https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
wget --trust-server-name --content-disposition https://huggingface.co/StableDiffusionVN/Flux/resolve/main/Vae/flux_vae.safetensors
'''
#./gui.sh --share --headless --config "/workspace/config.toml"
|