sd_dreambooth_extension
sd_dreambooth_extension copied to clipboard
Stop train text encoder after a certain percentage of steps.
WHAT What is this feature of which you speak??
Stop text training after a certain percentage of steps. Keep the % low for better style transfer, more training steps will be necessary for good results. Higher % will give more weight to the instance, it gives stronger results at lower steps count, but harder to stylize,
WHERE From whence did you hear this news?? Provide a URL if possible.
https://github.com/TheLastBen/fast-stable-diffusion https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast-DreamBooth.ipynb
HOW I suppose that could be the same as where if you have a URL, but if there's an example, hook me up.
in https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast-DreamBooth.ipynb
if Train_text_encoder_for>=100: stptxt=Training_Steps elif Train_text_encoder_for==0: Enable_text_encoder_training= False stptxt=10 else: stptxt=int((Training_Steps*Train_text_encoder_for)/100)
... ...
!accelerate launch /content/diffusers/examples/dreambooth/train_dreambooth.py
$Caption
$Textenc
--save_starting_step=$stpsv
--stop_text_encoder_training=$stptxt
in https://github.com/TheLastBen/diffusers/blob/main/examples/dreambooth/train_dreambooth.py
if args.train_text_encoder and global_step == args.stop_text_encoder_training and global_step >= 30:
if accelerator.is_main_process:
print(" [0;32m" +" Freezing the text_encoder ..."+" [0m")
frz_dir=args.output_dir + "/text_encoder_frozen"
if os.path.exists(frz_dir):
subprocess.call('rm -r '+ frz_dir, shell=True)
os.mkdir(frz_dir)
pipeline = StableDiffusionPipeline.from_pretrained(
args.pretrained_model_name_or_path,
unet=accelerator.unwrap_model(unet),
text_encoder=accelerator.unwrap_model(text_encoder),
)
pipeline.text_encoder.save_pretrained(frz_dir)
This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days
Man, I gotta make that robot ignore stuff tagged with "Enhancement".
@OrochiZ - So, I implemented this, and it broke stuff, and instead of fixing what I broke, I just ripped it all out again.
Maybe I'll re-work it, maybe I'll just tell people to train for N steps with it on, then turn it off and continue training. Got a lot on my plate right now, so I'm definitely not eager to break stuff again. :P
Implemented - AGAIN. Cutoff is in epochs (steps per image), so should be similar to a percentage. ;)