guaneec / custom-diffusion-webui

An unofficial implementation of Custom Diffusion for Automatic1111's WebUI.
GNU Affero General Public License v3.0
70 stars 6 forks source link

Feature request: aspect ratio bucketing #3

Open jim-22 opened 1 year ago

jim-22 commented 1 year ago

Aspect ratio bucketing lets you train with an images of multiple aspect ratios by putting similarly-sized images in separate batches. NovelAI has some code for their implementation of it here: https://github.com/NovelAI/novelai-aspect-ratio-bucketing. d8ahazard's Dreambooth implementation also uses aspect ratio bucketing. https://github.com/d8ahazard/sd_dreambooth_extension It would be awesome if this extension could include it.

guaneec commented 1 year ago

This should already be in. I borrowed the data loading code from the WebUI repo, which has AUTOMATIC1111/stable-diffusion-webui#6481 and AUTOMATIC1111/stable-diffusion-webui#6844 merged in. Specifically, you can use "Auto-sized crop" in the preprocess tab and then choose "Do not resize images" when training. If you have any suggestions for how to improve the discoverability and usability of this feature, please do let me know.

jim-22 commented 1 year ago

Cool, I didn't know this was in there. Maybe you can add some more info to the "do not resize images" checkbox? Like "do not resize images (images will be batched by size)" or something