Skip to content

Commit

Permalink
Rollback changes. Save compability with Anything v3.0 neural network
Browse files Browse the repository at this point in the history
This update breaks compability with Anything v3.0 AI from Linaqruf. Rollback changes to make training only on fp16 precission.
  • Loading branch information
LuffyTheFox committed Jan 6, 2023
1 parent 862e426 commit dad90cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/dreambooth/train_dreambooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,13 +679,13 @@ def save_weights(step):
# Create the pipeline using using the trained modules and save it.
if accelerator.is_main_process:
if args.train_text_encoder:
text_enc_model = accelerator.unwrap_model(text_encoder, keep_fp32_wrapper=True)
text_enc_model = accelerator.unwrap_model(text_encoder)
else:
text_enc_model = CLIPTextModel.from_pretrained(args.pretrained_model_name_or_path, subfolder="text_encoder", revision=args.revision)
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False, set_alpha_to_one=False)
pipeline = StableDiffusionPipeline.from_pretrained(
args.pretrained_model_name_or_path,
unet=accelerator.unwrap_model(unet, keep_fp32_wrapper=True),
unet=accelerator.unwrap_model(unet),
text_encoder=text_enc_model,
vae=AutoencoderKL.from_pretrained(
args.pretrained_vae_name_or_path or args.pretrained_model_name_or_path,
Expand Down

0 comments on commit dad90cb

Please sign in to comment.