Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example script for training/fine-tuning ELLA #27

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

budui
Copy link
Collaborator

@budui budui commented Apr 12, 2024

Add example script for training/fine-tuning ELLA

TODO

  • Support fine-tuning ELLA itself
  • Support fixed ELLA, fine-tuned LoRA
  • Support ELLA+CLIP as condition at the same time during training

@budui budui self-assigned this Apr 12, 2024
@budui budui marked this pull request as draft April 12, 2024 02:20
@budui
Copy link
Collaborator Author

budui commented Apr 14, 2024

[1/3] Train text to image lora with ella.

Modified from https://huggingface.co/docs/diffusers/training/lora#launch-the-script

export MODEL_NAME="runwayml/stable-diffusion-v1-5"
export OUTPUT_DIR="/tmp/finetune_lora_pokemon"
export DATASET_NAME="diffusers/pokemon-llava-captions"
# export DATASET_NAME="/path/to/local/dataset/huggingface/datasets/diffusers___parquet/diffusers--pokemon-llava-captions-d6a88a772327b199/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec"

accelerate launch --mixed_precision="fp16"  train_text_to_image_lora_with_ella.py \
 --pretrained_ella /path/to/the/pretrained/ella-sd1.5-tsc-t5xl.safetensors \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --dataset_name=$DATASET_NAME \
  --dataloader_num_workers=8 \
  --resolution=512 \
  --center_crop \
  --random_flip \
  --train_batch_size=1 \
  --mixed_precision="fp16" \
  --gradient_accumulation_steps=4 \
  --max_train_steps=15000 \
  --learning_rate=1e-04 \
  --max_grad_norm=1 \
  --lr_scheduler="cosine" \
  --lr_warmup_steps=0 \
  --output_dir=${OUTPUT_DIR} \
  --checkpointing_steps=500 \
  --seed=1337

@matbee-eth matbee-eth mentioned this pull request May 24, 2024
@XIONGPEILIN
Copy link

XIONGPEILIN commented Aug 2, 2024

我尝试了一下使用interaction diffusion的代码里面加入ella进行训练,https://github.com/XIONGPEILIN/ella_with_interactiondiffusion-
感觉是哪里出了问题,没有训练成功

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants