Previous Post

Ultimate Image Processing APP : Batch Cropping, Zooming In, Resizing, Duplicate Image Removing, Face Extraction, SAM 2 and Yolo Segmentation, Masking for Windows, RunPod, Massed Compute and Free Kaggle Account

Next Post
Ultimate Image Processing APP : Batch Cropping, Zooming In, Resizing, Duplicate Image Removing, Face Extraction, SAM 2 and Yolo Segmentation, Masking for Windows, RunPod, Massed Compute and Free Kaggle Account
1 / 18
DESCRIPTION

Batch Image Cropping, Zooming Subject, Resizing, Segmenting, Masking, Duplicate Removing APP that utilizes YOLO V11, SAM 2 and Gradio

Patreon exclusive posts index to find our scripts easily, Patreon scripts updates history to see which updates arrived to which scripts and amazing Patreon special generative scripts list that you can use in any of your task.

Join discord to get help, chat, discuss and also tell me your discord username to get your special rank : SECourses Discord

Please also Star, Watch and Fork our Stable Diffusion & Generative AI  GitHub repository and join our Reddit subreddit and follow me on LinkedIn (my real profile)

=======

Latest zip file : Ulti_Img_Process_V28.zip

Screenshots zip file : how_to_use_screenshots.zip

We have 1-Click installer for Windows, Massed Compute and a Free Kaggle Notebook. Read this post extremely carefully to learn how to use all

Video Tutorial : Hopefully coming soon

6 Feburary 2026 Update V28

Install error fixed

All installers upgraded to uv install thus like 100x faster to install now

10 November 2025 Update V25

Libraries updated to Torch 2.8, CUDA 12.9

With pre compiled xFormers, Flash Attention, Sage Attention, Segment Anything V2 (SAM2) and groundingdino

Thus now installation way faster and easier

For all of the GPUs starting from RTX 1000 series to 5000 series or Cloud GPUs like A100, B200, etc

A bug with saving images as JPG fixed - this is useful if you have transparent pixel having images and want to train with them to replace transparent pixels with white

Windows Requirements

Python 3.10, FFmpeg, CUDA 12.9, cuDNN 9.12 or above, C++ tools and Git

If it doesn't work make sure to below tutorial and install everything exactly as shown in this below tutorial

https://youtu.be/DrhUHnYfwC0

Follow tutorial along with this post : https://www.patreon.com/posts/click-to-open-post-used-in-tutorial-111553210

1 September 2025 Update V23

Image batch resize cancel fixed

Some errors regarding batch processing on Linux fixed

Just extract latest zip file and overwrite older files for update

25 August 2025 Update V22

SAM2 based auto cropping logic significantly improved

Now it will zoom into the maximum degree and leave no empty space

Moreover, auto crop section now have pixel or percent based padding, so if it too agressively zoom in, you can set some padding

If you are processing trasnparency having images, uncheck Save as PNG

Now when Save as PNG is unchecked, it will first convert to JPG and then process thus the processing will have 0 errors

Previously when you auto crop transparent pixels having png files, it wanst working properly

22 August 2025 Update V21

New feature implemented upon request : Skip images with no SAM2 detection

yolov11l-face.pt selection in Select Detection Class (YOLO) was not working and fixed

Default selection of Select Detection Class (YOLO) is now set to person

Just overwrite previous files to upgrade from V20

11 July 2025 Update V19

Face Extraction tab improved and now it uses super fast yolov11l-face.pt

Moreover now it supports all Yolo classes and SAM2 segment as well

So you can extract other than faces as well

All with multi-threading support

Run Windows install again, if you get any error delete venv folder and run install again

2 June 2025 Update V15

A bug in SAM based automatic cropping fixed now should work perfect hopefully

Now app supports RTX 5000 series on RunPod and Massed Compute as well

I have compiled groundingdino for Linux to make this happen

Just overwrite older files with newest zip content to update

24 April 2025 Update V14

Negative prompt feature implemented to SAM 2 Batch Segmentation APP by SECourses

Run Start_Segmenter.bat to start this app

The logic of negative prompt fairly simple

For example positive prompt face.

Negative prompt eye.

So you get face masked with eyes being unmasked

It mask the face, mask the eyes, and subtract eyes from face mask

Negative prompt masks auto saved inside generated_negative_masks folder

Extract newest zip file into previous folder for update

24 April 2025 Update

Windows Installer updated to support RTX 5000 series fully

I have compiled xFormers and groundingdino with latest official Torch 2.7 for making this work

Also a new amazing feature Generate Tiled Images implemented

This tiled image generation can be used to improve small details of training subject, especially useful for items, objects, products

Ultimate Batch Image Processing Gradio APP by SECourses

Use Windows_Start_App.bat to start this APP

This APP has the following features. Please look at the full screenshots to understand how it works exactly

Image Cropper

This TAB is extremely useful to zoom in and crop the subjects

It supports YOLO Segmentation and also state of the art Grounded SAM 2

With Grounded SAM 2 you can use any keyword to mask / segment and zoom in subjects like person, ear, lips, tanks, cars, t-shirt, etc.

How this tab works is that you enter your desired aspect ratios - enter your desired resolutions here so that it will generate accurate folder names for batch image resize

After finding the subject in processed image like person, it gets it. And then it starts to expand it in the least possible amount to reach your desired aspect ratio like cropping 1920x1080 image into 1024x1024 aspect ratio with subject focus being person

Then it saves these images with full resolution with crop / zoom in into given folder

The folder structure is extremely important so look very carefully and read the screenshot images - it shows all

This processing will never cut / remove any part of the subject so it won't reach desired aspect ration in every case, the Image Resizer tab will cut the image and obtain desired aspect ratio and resolution exactly

This tab is fully multi-threaded and supports running on multiple GPU as well

Image Resizer

This is the second stage of processing images but of course can be used standalone as well

Give the Output Folder of the image cropping processing

It will then look for subfolders with the exact same names of your desired target resolutions

E.g. you want your images to be 1024x1024 pixel then it will look sub folder named as 1024x1024

Again look at the screenshots very carefully to understand how it works

This tab will crop / cut subject as well to reach the desired target aspect ratio and then it will downscale the image into the desired resolution

When cutting body parts of human, it will focus on face and will not part the direction of the image that contains the face

You can also use Resize without cropping (center image and add white background) option as well

This tab is fully multi-threaded and it runs on CPU

Move Low-Res Files 

WIP not tested yet but should be working

Rename Files 

WIP not tested yet but should be working

Extract Faces

With this tab you can extract faces from given folder

It will automatically find the face in given image and save it into desired folder

You can also set positive or negative padding depending on your requirement

This tab is fully multi-threaded

Find Duplicates

This tab is extremely useful to find duplicate images in given folder and move them to the target folder

It supports following algorithms and default parameters working decent:

aHash (Average Hash) : How it works: Calculates the average color of the image, then creates a hash based on whether each pixel is brighter or darker than the average.

dHash (Difference Hash): How it works: Similar to aHash but compares the difference in brightness between adjacent pixels.

pHash (Perceptual Hash): How it works: Uses the Discrete Cosine Transform (DCT) to focus on low-frequency components, making it robust to minor changes.

wHash (Wavelet Hash): How it works: Uses Wavelet transform to capture image details at different scales.

ColorHash: How it works: Creates a hash based on the color histogram of the image.

KAZE: How it works: Detects and describes local features in images using non-linear scale spaces, making it robust to scale, rotation, and some level of viewpoint change.

Multi-Hash: How it works: Combines multiple hashing algorithms (aHash, dHash, pHash, wHash, ColorHash, KAZE) to improve overall accuracy.

This tab is fully multi-threaded and it was super hard to code this one as multi-threaded

SAM 2 Batch Segmentation Gradio APP by SECourses

Use Start_Segmenter.bat to start this APP

It is built upon Grounded-SAM-2

https://github.com/IDEA-Research/Grounded-SAM-2

This APP is super important to decide your subject finding / masking prompt and Box Threshold and Text Threshold

After finding parameters, you can use them in your Batch Processing APP with SAM 2 prompting box instead of YOLO

It will automatically save every Mask and Segmented Image into outputs folder

It supports fully folder Batch Processing as well

It is fully multi-threaded and supports multi-GPU as well, it was really hard to code in Python

Look and read the screenshots very carefully to learn how to use it

You can use generated Masks in training like in Kohya training as well

How To Install and Use:

Windows:

First watch above requirements tutorial and follow every step

Extract zip archive into a drive like c:/ulti_process

Longer directory path causes issues

Double click and install with Windows_Install.bat and that is it

Then run with Windows_Start_App.bat to start Ultimate Batch Processing APP

To run Segmentation APP run with Start_Segmenter.bat

Massed Compute (Recommend Cloud) :

Please register via this link : https://vm.massedcompute.com/signup?linkId=lp_034338&sourceId=secourses&tenantId=massed-compute

We have a special coupon for all GPUs : SECourses

If you want to learn more about GPUs and prices read this link : https://www.patreon.com/posts/126671823

Select RTX A6000 or Better GPU - like L40S or A6000 ADA or A100 or H100

Then select our image SECourses from Creator dropdown

Then follow Massed_Compute_Instructions_READ.txt

Same as my any other Massed Compute installer script

Example tutorial for learn how to install and use Massed Compute

(Starts at 12:58) : https://youtu.be/KW-MHmoNcqo?si=G1WbG-Qw4ujWvOtG&t=778

RunPod (Cloud):

Please register via this link : https://get.runpod.io/955rkuppqv4h

Then follow Runpod_Instructions_READ.txt

Same as my any other RunPod installer script

Use the template written in Runpod_Instructions_READ.txt file

Example tutorial for learn how to install and use RunPod

(starts at 22:03) : https://youtu.be/KW-MHmoNcqo?si=QN8X8Sjn13ZYu-EU&t=1323

Kaggle (Free Cloud - Not Recommend):

Register Kaggle for free and verify your phone number : https://www.kaggle.com/

Upload the Kaggle notebook file from downloaded attachments

Follow the instructions on the Kaggle notebook

How to Use Kaggle Notebooks General Tutorial

(Starts at 27:34) https://youtu.be/KW-MHmoNcqo?si=vkKTvWHbZVrn4x7h&t=1654

SECourses: FLUX, Tutorials, Guides, Resources, Training, Scripts PATREON 32 favs
VIEWS1
FILES20 files
POSTEDNov 9, 2025
ARCHIVEDJun 10, 2026