diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

How to pass yaml config file for inference for dreambooth and SD2.1 ?

Open sifrah opened this issue 2 years ago • 1 comments

Here is my training configuration :

accelerate launch train_dreambooth.py \
  --pretrained_model_name_or_path="stabilityai/stable-diffusion-2-1" \
  --pretrained_vae_name_or_path="stabilityai/sd-vae-ft-mse" \
  --output_dir="./zwx/" \
  --revision="fp16" \
  --with_prior_preservation --prior_loss_weight=1.0 \
  --seed=1337 \
  --resolution=768 \
  --train_batch_size=1 \
  --train_text_encoder \
  --mixed_precision="fp16" \
  --use_8bit_adam \
  --gradient_accumulation_steps=1 \
  --gradient_checkpointing \
  --learning_rate=1e-6 \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --num_class_images=50 \
  --sample_batch_size=4 \
  --max_train_steps=1400 \
  --save_interval=500 \
  --save_sample_prompt="photo of zwx women" \
  --concepts_list="concepts_list.json"

i'm using :

from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler

model_id = "mymodel"

# Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")

prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]

image.save("astronaut_rides_horse.png")

And i got theses results : image

Do you know how to import config files https://github.com/Stability-AI/stablediffusion/blob/main/configs/stable-diffusion/v2-inference-v.yaml in diffusers ? Some people told me that this can solve my problem

Thanks,

sifrah avatar Dec 14 '22 23:12 sifrah

Hey @sifrah,

Could you please also post your version of diffusers?

diffusers-cli env

Also we don't recommend using the revision="fp16" - could you try again without passing revision="fp16" ?

patrickvonplaten avatar Dec 19 '22 15:12 patrickvonplaten

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.

github-actions[bot] avatar Jan 14 '23 15:01 github-actions[bot]