Skip to content

Instantly share code, notes, and snippets.

@kaigouthro
Created September 5, 2023 06:58
Show Gist options
  • Save kaigouthro/a8e20046f8b374df29fd807b9fc374a6 to your computer and use it in GitHub Desktop.
Save kaigouthro/a8e20046f8b374df29fd807b9fc374a6 to your computer and use it in GitHub Desktop.
60 second sdxl Dreambooth lora training

step 1.

make sure you have virtualenv

sudo apt install python3-venv
pthon -m pip install virtualenv

step 2.

create a virtualenv

cd ~
mkdir dreambooth
cd dreambooth
virtualenv -p python3 venv
source venv/bin/activate

step 3:

install hugginfaces autotrainer

pip install autotrain-advanced torchvision

step 3.

try running the autotrainer setup:

autotrainer setup

step 4.

if it fails (like it did for me first time..)

check if ou need to use a slightly earlier transformers/bits and bytes from what ou have ( it noted in m error)

step 5.

put your imagss inn a /images folder, and run the autotrainer with the default hugginface settings.. hange the instance prompt string to your own prompt, and voila.

autotrain dreambooth --model stabilityai/stable-diffusion-xl-base-1.0 \
    --project-name my_dreambooth_project --image-path images/ \
    
    --prompt "photo of a <YOUR_PROMPT> <YOUR_CLASS>"    \
    
    --resolution 1024 --batch-size 1  \
    --num-steps 500 --gradient-accumulation 2  \
    --lr 0.00001 --fp16 --xformers  \
    --train-text-encoder --use-8bit-adam  \
    --gradient-checkpointing
    

and DONE yo.. sdxl 1.0 dreambooth in 60 seconds

@otorre1
Copy link

otorre1 commented Sep 8, 2023

i'm tryingto use in Kaggle, but this message appears

upgraded, 4 newly installed, 0 to remove and 69 not upgraded.
Need to get 9849 kB of archives.
After this operation, 2982 kB of additional disk space will be used.
Do you want to continue? [Y/n]

i press Y but didnt work

How can i install in silent mode?

@kaigouthro
Copy link
Author

i'm tryingto use in Kaggle, but this message appears

upgraded, 4 newly installed, 0 to remove and 69 not upgraded. Need to get 9849 kB of archives. After this operation, 2982 kB of additional disk space will be used. Do you want to continue? [Y/n]

i press Y but didnt work

How can i install in silent mode?

did ou ignore creting a new virtual environment?
and this is a hard approach, ie: run directly from command line on a a computer ou have direct access to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment