Skip to content

Requirements for advanced_diffusion_training incomplete #10142

Open
srlynch1/diffusers
#5

Description

@teshi24

Describe the bug

When following the https://github.com/huggingface/diffusers/blob/main/examples/advanced_diffusion_training/README.md
I also had to install / do those things to make it work:

!pip install wandb prodigyopt datasets
!pip install --upgrade peft
  • login to huggingface
  • setup and login to wandb

Those things are not mentioned in the Readme / not updated in the requirements.txt which makes it hard to get started

Reproduction

Execute README preparation things on a new machine

cd diffusers
pip install -e .
cd examples/advanced_diffusion_training
pip install -r requirements.txt
accelerate config default

download dataset

from huggingface_hub import snapshot_download

local_dir = "./data/3d_icon"
snapshot_download(
    "LinoyTsaban/3d_icon",
    local_dir=local_dir, repo_type="dataset",
    ignore_patterns=".gitattributes",
)

run script

MODEL_NAME="stabilityai/stable-diffusion-xl-base-1.0"
DATASET_NAME="./data/3d_icon"
OUTPUT_DIR="3d-icon-SDXL-LoRA"
VAE_PATH="madebyollin/sdxl-vae-fp16-fix"

!accelerate train_dreambooth_lora_sdxl_advanced.py \
  --pretrained_model_name_or_path="$MODEL_NAME" \
  --pretrained_vae_model_name_or_path="$VAE_PATH" \
  --dataset_name="$DATASET_NAME" \
  --instance_prompt="3d icon in the style of TOK" \
  --validation_prompt="a TOK icon of an astronaut riding a horse, in the style of TOK" \
  --output_dir="$OUTPUT_DIR" \
  --caption_column="prompt" \
  --mixed_precision="fp16" \
  --resolution=1024 \
  --train_batch_size=3 \
  --repeats=1 \
  --report_to="wandb"\
  --gradient_accumulation_steps=1 \
  --gradient_checkpointing \
  --learning_rate=1.0 \
  --text_encoder_lr=1.0 \
  --optimizer="prodigy"\
  --train_text_encoder_ti\
  --train_text_encoder_ti_frac=0.5\
  --snr_gamma=5.0 \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --rank=8 \
  --max_train_steps=1000 \
  --checkpointing_steps=2000 \
  --seed="0" \
  --push_to_hub

Logs

No response

System Info

  • 🤗 Diffusers version: 0.32.0.dev0
  • Platform: Linux-6.8.0-49-generic-x86_64-with-glibc2.39
  • Running on Google Colab?: No
  • Python version: 3.11.10
  • PyTorch version (GPU?): 2.5.1+cu124 (True)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Huggingface_hub version: 0.26.3
  • Transformers version: 4.46.3
  • Accelerate version: 1.1.1
  • PEFT version: 0.13.2
  • Bitsandbytes version: not installed
  • Safetensors version: 0.4.5
  • xFormers version: not installed
  • Accelerator: NVIDIA RTX 5000 Ada Generation, 32760 MiB
  • Using GPU in script?: Yes
  • Using distributed or parallel set-up in script?: No

Who can help?

@sayakpaul

Activity

  1. sayakpaul commented on Dec 6, 2024

    @sayakpaul
    Member
  2. linoytsaban commented on Dec 6, 2024

    @linoytsaban
    Collaborator

    Hey @teshi24! Thanks for bringing this up. We don't have those in the requirements as one can successfully finish a train run and save weights locally w/o needing to log in to their hf account / create a wand account (as long as they dont use the flags --push_to_hub and --report_to=wandb). However it is a good point that these are present in our example in the README.
    I think a good solution would be to add a snippet to the readme re: logging to your hf account in order to enable push_to_hub as well as a note re: wandb.
    cc @sayakpaul wdyt?

  3. self-assigned this
    on Dec 6, 2024
  4. sayakpaul commented on Dec 6, 2024

    @sayakpaul
    Member

    cc @sayakpaul wdyt?

    I am good with it!

  5. teshi24 commented on Dec 6, 2024

    @teshi24
    Author

    Yeah, I think that would do the trick 👍
    BTW: good job on the error messages, they helped me a lot with figuring out what to install in addition 👍

  6. github-actions commented on Jan 5, 2025

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

    Please note that issues that do not follow the contributing guidelines are likely to be ignored.

  7. removed
    staleIssues that haven't received updates
    on Jan 6, 2025
  8. github-actions commented on Jan 30, 2025

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

    Please note that issues that do not follow the contributing guidelines are likely to be ignored.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions