メインコンテンツへスキップ

diffusersのControlnetをControl-LoRAに変換する

    自分用備忘録です。わかる人だけ読んでね。

    セットアップ

    cd c:\
    git clone https://github.com/laksjdjf/sd-trainer.git
    cd sd-trainer
    python -m venv venv
    venv\Scripts\activate
    
    pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu121
    pip install diffusers>=0.26.3 accelerate wandb transformers==4.28.1 omegaconf safetensors
    python -m pip install bitsandbytes==0.41.1 --prefer-binary --extra-index-url=https://jllllll.github.io/bitsandbytes-windows-webui 
    
    accelerate config
    
    - This machine
    - No distributed training
    - NO
    - NO
    - NO
    - all
    - fp16
    

    使い方

    accelerate launch tools/create_control_lora.py ^
    --controlnet "プロジェクト固有のコントロールネットのパス" ^
    --unet "プロジェクト固有のUnetのパス" ^
    --output "ControlLoRAの保存先パス" ^
    --rank "ControlLoRAのDim"

    具体例

    accelerate launch tools/create_control_lora.py ^
    --controlnet "D:\Stable-diffusion\controlnet\controlnetXL_line2color.safetensors" ^
    --unet "D:\Stable-diffusion\SDXL\animagine-xl-3.1\unet\diffusion_pytorch_model.safetensors" ^
    --output "D:\Stable-diffusion\controlnet\control-lora-line2color_rank256.safetensors" ^
    --rank 256

    あなたへのおすすめ