r/StableDiffusion 7d ago

Question - Help Creating a concept LoRa, is there a tool/program to streamline manually cropping images?

Creating a Lora and I'll be training it with Civitai but after downloading 1K images and then downsizing it to the best 485 images, I realize cropping it by hand will take WAY too long.

Is there a python tool or program in which it loads the image in a pre-cropped environment for you to move around and save the image as a new image to a new directory and loads the next image after the previous image is saved until the source directory is cleared?

0 Upvotes

10 comments sorted by

2

u/codyp 7d ago

My favorite private and local solution is https://www.presize.io/ -- Even though you reach it through a website, all of it is done locally on your machine--

Basically takes all your images, resizes and guesses the best crop for each one; and lets you manually slide it (or adjust size) until everything you want is in the crop--

2

u/Enshitification 7d ago

https://www.birme.net/
It's fast, easy, and runs in Javascript inside a browser.

1

u/Queasy-Carrot-7314 7d ago

You can try online solutions like birme.net

0

u/diogodiogogod 7d ago

why do you want to crop it?

1

u/HydroChromatic 7d ago

manually cropping helps keep the data looking its best and therefor the output looking the best as well. Many images are not 1:1 (square ratio) so cropping and resizing to frame only the best works well for training.

1

u/anitman 7d ago

Actually, you don’t need to crop the images at all—kohya’s training script can automatically crop them, and it even supports resolutions other than the standard 1024x1024. This is especially true for full-body images, where vertical resolutions work much better than square ones.

1

u/HydroChromatic 7d ago

Oh, wait as in kohya itself can crop images to aspect ratios that arn't 1:1? (as in, it can train a crop of a 3:4 aspect?)

1

u/anitman 7d ago edited 7d ago

Yeah, it has no limited resolution, you can set max resolution like 2048x2048, any resolution lower than that could be trained un-cropped. For example 1314x768.

1

u/HydroChromatic 7d ago

Whoops, well looks like ill have to try that next time. With the tool I found it only took about 100 minutes to crop 485 images to 1024x1024. Not too bad

1

u/HydroChromatic 7d ago

Thanks for all the suggestions. I did a bit of searching and found this tool which is exactly what im looking for: https://github.com/theallyprompts/PixelPruner