Skip to content

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

Draft
budui wants to merge 2 commits into
TencentQQGYLab:mainfrom
budui:add_ella_training_example
Draft

Add example script for training/fine-tuning ELLA#27
budui wants to merge 2 commits into
TencentQQGYLab:mainfrom
budui:add_ella_training_example

Conversation

@budui

@budui budui commented Apr 12, 2024

Copy link
Copy Markdown
Collaborator

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

budui commented Apr 14, 2024

Copy link
Copy Markdown
Collaborator Author

[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

@matbeedotcom matbeedotcom mentioned this pull request May 24, 2024
@XIONGPEILIN

XIONGPEILIN commented Aug 2, 2024

Copy link
Copy Markdown

我尝试了一下使用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