Home Creators Posts Import Register Favorites Logout

Downloads

Content

Batch Image Cropping, Zooming Subject, Resizing, Segmenting, Masking, Duplicate Removing APP that utilizes YOLO V26, YOLO Face V12, SAM 2, SAM 3.1 with 1-click installers for Windows, RunPod, SimplePod and Massed Compute (Linux users use this)

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 : Ultimate_Image_Processor_Pro_v1.zip

[click here to choose a membership and Join to download zip files]

28 July 2026 V1.0

We have completey remade the app and read below to understand how it works and full features

Make a fresh install and read the below carefully please

We use latest pre-compiled wheels and Torch 2.13 and CUDA 13

Windows Requirements

Python 3.12.10, FFmpeg, CUDA 13, cuDNN 9.17 or above, Visual Studio Community Edition with all C++ options selected

Don't worry CUDA 13 works with all GPUs - make sure you have updated NVIDIA driver

Follow this requirements tutorial video exactly : https://youtu.be/DrhUHnYfwC0

Follow its updated post with links and screenshots exactly : https://www.patreon.com/SECourses/posts/requirements-written-tutorial-111553210

Installers

All installers automatically downloads all necessary models

I have generated specially compiled BF16 safetensors version of the SAM 3.1 and thus we get almost 100% accuracy with half model VRAM usage

Windows uses Windows_Install_or_Update.bat and then Windows_Start_App.bat

For Runpod and SimplePod please follow : Runpod_SimplePod_Image_Process_Instructions.txt

For Massed Compute or local Linux systems please follow : Massed_Compute_Instructions_READ.txt

How The Ultimate Image Processing Premium by SECourses App Works And What Features It Has

The Ultimate Image Processing Toolkit is a single Gradio app that turns a folder of raw photos into a clean, correctly framed, ready-to-train dataset. It bundles nine tools — SAM 3.1 concept segmentation, YOLO detection, subject-aware cropping, exact-size resizing, tiling, perceptual duplicate removal, low-resolution filtering and batch renaming — and they are designed to feed each other, so the output of one tab is exactly what the next tab expects to read.

One architectural detail matters more than any single feature: the Gradio process never imports torch. Every job runs in a throw-away subprocess that loads the model, does the work and exits, which returns 100% of its VRAM, RAM and CUDA context the moment it finishes. A long session never creeps upwards, and the app sits at zero idle VRAM between runs.

Every screenshot below is from the app running on a real folder of 12 photos (up to 6714 x 5274 px), and every number quoted is the measured result of that run on a single RTX 5090.

Presets — save every setting, everywhere

Before anything else: a preset captures every control in the entire app, across all nine tabs — around 150 of them. The preset you last saved or loaded is restored automatically the next time the app starts, so your working configuration survives a restart.

Selecting a preset in the dropdown changes nothing until you press Load, so a mis-click can never wipe the settings you are in the middle of editing. The built-in Default set lives in code rather than on disk, so it can never be overwritten or deleted — it is always there to fall back to.

Tab 1 — Image Cropper

This is the tab to run first. It finds the subject in every photo of a folder and crops the tightest box that matches each aspect ratio you ask for. The crucial part is the direction it works in: it detects the subject, adds your padding, and then grows the box outwards until the ratio is exact. The subject is never squashed and no part of it is ever cut off.

Output goes to one sub-folder per aspect ratio (1024x1024/, 1280x720/, 1080x1350/ …), which is exactly the layout the Image Resizer tab reads back.

Key features:

Live folder scan — before you press start you already know how many images were found, which extensions and the total size on disk.

Three detection engines — SAM 3.1, YOLO, or SAM 2.1 + GroundingDINO, each with only its own thresholds shown.

All instances (union) — spans every match so nobody gets cropped out of a group photo.

Padding in percent or pixels, applied before the ratio so the ratio stays exact. Negative values crop in tighter.

Annotated previews — optionally writes a copy with the detections drawn on it, so you can check a prompt before committing to a big run.

Safe re-runs — with overwrite off, images whose crops already exist are skipped, so an interrupted batch is cheap to resume.

The three detection engines

Pick a backend and the app swaps in only the knobs that backend actually has.

SAM 3.1 (concept prompts) is the default and the one to use. It detects and segments in a single model from open-vocabulary text, returning pixel-accurate masks with no fixed class list. Its knobs are confidence and max instances.

YOLO (class list) is the fastest option and there is no prompt wording to get wrong — 80 COCO classes plus a dedicated face model. Selecting yolov12l-face.pt swaps in the face model automatically. Its knobs are confidence, NMS IoU, inference size and max detections.

SAM 2.1 + GroundingDINO is the older two-stage pipeline, kept so results from earlier versions stay reproducible. GroundingDINO proposes boxes, SAM 2.1 turns them into masks.

How the cropping logic actually works

Detect → pad → grow outwards to the ratio. And the most important detail of all: nothing is ever upscaled. The aspect ratio you type is used as a ratio, not as a target size, so a 6000 px wide photo yields a 6000 px wide 16:9 crop, not a 1280 px one. Tick "Resize crops to the exact target size" if you want the Cropper to scale as well — otherwise crop here and resize in the Image Resizer tab, where you get to choose the resampling filter. That order throws away the least detail.

Watching a real run

Every batch tab shares the same run panel: a live status card with progress, images/sec and ETA, a copyable log naming each file and how many outputs it produced, and a Stop button that really stops the worker and keeps whatever was already written.

Real run: 12 photos at up to 6714 x 5274 px, cropped to three aspect ratios each — 36 output files in 47.7 seconds.

Real results

Below: the annotated detection preview alongside the 1:1, 16:9 and 4:5 crops of the same photos. Every crop is a plain rectangle of original pixels — the app never resamples during cropping. Note the middle row, where "All instances (union)" keeps both people in frame.

Tab 2 — Segmentation

SAM 3.1 masks from plain English, with an interactive single-image tester and a folder batch that share one set of settings.

Always dial your prompt in on one image first — it takes a few seconds and shows you the exact mask, the confidence score and the mask area in pixels. Then the batch section further down the page uses those identical settings; there is no second set of controls to keep in sync.

You get the segmented overlay, the mask itself (white inside, black outside — ready for inpainting, ControlNet or masked training), and a copyable detections table with label, score, bounding box and mask pixel count for every instance.

Negative prompts

You can subtract one concept from another in a single pass. In the example below the prompt is face. and the negative prompt is eye. lips. — the eyes and mouth are carved straight out of the face mask. The negative mask is saved separately so you can reuse or invert it later.

This is how you build skin-only masks, or segment a car while cutting out the person standing in front of it.

Settings and the YOLO backend

Concepts are separated by periods and the vocabulary is open — you are not limited to a class list. Confidence drops weak instances, max instances caps both the result count and how much VRAM the mask upsample needs on a busy scene, and overlay opacity controls only the preview tint (the saved mask is always pure black and white).

On the YOLO backend you multi-select any number of the 80 COCO classes instead of writing a prompt, with a separate exclude list. The YOLO mask source setting decides where masks come from: SAM 2.1 refined turns each box into a pixel-accurate mask (loads a second model, still fast), while filled boxes is instant and plenty for rectangular crops or inpainting blocks.

Batch processing

Point it at a folder and it writes one mask per image, plus optional annotated overlays and negative masks. Leaving the overlay folder empty makes a run noticeably faster, because the masks then never need upsampling to full resolution for display. "Skip images that already have a mask" makes an interrupted run cheap to resume.

Real run: 12 photos, 33 instances found, 28.8 seconds (0.42 img/s).

Real batch output

The prompt was a single word: face. The bottom row is a red-carpet shot with a crowd in the background — SAM 3.1 found 16 separate faces in it and every one is in the mask.

Tab 3 — Extract Faces & Objects

Cuts the detected region out of each photo and saves it as its own image — the fastest way to build a face dataset. Unlike the Image Cropper this does not force an aspect ratio: you get the detection box plus whatever padding you ask for.

Save every detected instance as its own file — a group photo of five people yields five crops (photo_1.png … photo_5.png). Turn it off and you get exactly one crop per photo, chosen by confidence or by largest area.

Padding — faces almost always look better with 15–30% of breathing room. Percent scales with the face, so close-ups and wide shots come out consistent.

Minimum crop size — one slider that drops background faces too small to be useful, instead of you deleting them by hand later.

Not limited to faces: hand. licence plate. dog. all work.

Real output

33 face crops from 12 photos in 9.6 seconds, at 25% padding. The blurry ones in the top row are exactly what the Minimum crop size slider is for.

Tab 4 — Image Resizer

Writes every input image at one or more exact pixel sizes. Each input is written once per resolution into <output>/<WxH>/, so several dataset buckets come out of a single run.

Run it after the Image Cropper: crop first at native resolution, then resize once with the filter you want. That order loses the least detail.

Real run: 36 files resized in 2.0 seconds — 17.7 images/sec on CPU alone.

It works out what you pointed it at

This used to be the single most common source of confusion, and it is now solved before you press start. Point at an Image Cropper output folder and it reports "Image Cropper layout detected", listing how many files each WxH bucket contributes and naming any resolution that has no matching sub-folder. Point at a plain folder of pictures and it says "Plain folder detected" and does the multiplication for you: 12 images × 3 resolutions = 36 output files.

Framing choices, side by side

Crop to fill keeps the aspect ratio and trims the overflow — no bars, some content lost, and the default. Fit inside keeps every pixel and pads with your chosen background colour. Stretch distorts the image and is almost never what you want.

Separately, Centre the crop on decides where the crop is taken. Image centre is instant and loads no model, but a geometric centre crop can push the subject out of frame. Detected face / subject runs a detector first so the subject stays in frame — slower, since each worker loads its own model, so keep the worker count low in that mode.

Tab 5 — Generate Tiled Images

Slices each photo into an overlapping N×N grid of fixed-size tiles. Because the tiles are cut at native resolution and never upscaled, this is a very good way to turn a handful of very large photos into a high-detail training set.

Tiles per image must be a perfect square — 9 means a 3×3 grid — and the tiles overlap automatically so the whole frame is covered with nothing left out. If an image is smaller than one tile you choose the policy: Skip protects quality, Upscale guarantees output but invents pixels, Shrink the tile keeps the grid but writes smaller tiles for those images only.

Real output

One 3888 x 5648 photo becoming nine overlapping 1024 x 1024 tiles. Across the folder: 108 tiles from 12 photos in 1.2 seconds.

Tab 6 — Find Duplicates

Groups visually identical or near-identical images and moves the extras out of the way, keeping one copy per group. Every comparison uses a true perceptual distance — earlier versions compared hashes as big integers, which is not a similarity measure at all and both missed real duplicates and invented fake ones.

Nothing is deleted. Duplicates are moved to a destination folder keeping their relative structure, and a full report is written next to them, so the whole step is reversible.

You choose which copy survives: highest resolution, largest file, oldest, or first alphabetically.

Choosing an algorithm

The app ships a reference table telling you what each algorithm measures, what it is good at, where it breaks down, and the cutoff to start from — aHash, dHash, pHash, wHash, ColorHash, KAZE local features, and a combined multi-hash mode.

Cutoffs are Hamming distances: how many bits differ out of hash size², so smaller is stricter. Each algorithm gets its own threshold, because a distance of 5 means something completely different for aHash than for pHash. KAZE is the odd one out — it survives rotation, perspective and heavy cropping, but it is quadratic in image count, so keep it for small folders.

There is also a safety cap on image count, because comparison is quadratic and a 100,000-image folder would otherwise run for hours. Anything dropped by the cap is reported explicitly rather than silently ignored.

What actually happened

17 images in, 4 groups found, 4 files moved aside, 0.4 seconds. The test set contained a 50% resize, a byte-identical copy and a heavily re-compressed copy — all four were caught. With the rule set to Highest resolution, the full-size originals stayed and the half-size copies moved; where both members were the same size the tie was broken by name.

Tab 7 — Move Low-Res Files

Quality control for a crop run. Any processed image smaller than your threshold is moved out of the way together with the original it came from, so your two folders stay in sync — you never end up with a source photo whose result has been thrown away.

Set the minimum width and height, then choose whether to reject when either dimension is under the limit (strict) or only when both are. Files are paired by name, and "Same name, any extension" handles the everyday case where the crop is a .png and the original a .jpg. Preview mode is on by default and lists exactly what would move without touching disk. Nothing is deleted — files are moved, so the step is reversible.

Tab 8 — Rename Files

Renames a folder to a clean prefix + number sequence. The rename happens in two passes through temporary names, so a target name already taken by another file in the same folder can never clobber it. Extensions are always preserved.

Set the prefix, the starting number, the zero padding (4 or 5 so files sort correctly everywhere) and the numbering order — by name, by date, or by size. "Only rename image files" leaves captions and JSON sidecars alone. Preview mode is on by default and shows the first 50 planned renames without touching disk.

Tab 9 — Performance & VRAM

Everything on this tab applies to every other tab and is saved with your presets. The shipped defaults are already the fastest configuration that still matches the reference model output — you only need to come here to trade quality for memory, or to try torch.compile.

Run every task in a subprocess (leave it on) — each run starts a fresh Python process, works, then exits, returning 100% of its VRAM and RAM, CUDA context and all.

GPU IDs — comma-separated CUDA indices. With several GPUs the image list is split across them, but each device loads its own copy of the model, so a second GPU only pays for itself on folders of a few hundred images or more. Enter cpu to force CPU processing.

Model precision — the shipped SAM 3.1 checkpoint is stored in bfloat16, so keeping the weights in bfloat16 is bit-identical to the published values. Measured against the float32 path: 0.9992 mask IoU, 46% less VRAM (1.9 GB vs 3.5 GB), ~7× faster model loading and ~5% faster per image.

Load weights straight into VRAM — builds the model on the GPU and reads the safetensors file directly into VRAM, skipping the ~3.4 GB float32 copy in system RAM. Roughly 2.5× faster model loading.

Chunked mask upsampling — upsamples instance masks a few at a time. On a 24 MP photo with 20 instances this is the difference between a ~1 GB spike and a few tens of MB, and the results are pixel-identical.

Attention kernel, TF32, cuDNN autotuner, channels-last, matmul precision — all exposed, all documented inline.

torch.compile the vision backbone — one-off compile cost of roughly one to three minutes (cached afterwards) in exchange for faster steady-state inference. Worth it for large batches, not for a handful of images; if compilation fails the model silently falls back to eager mode.

SAM 3.1 inference resolution — 1008 is what the model was trained at. Lower is faster but loses small objects; higher costs quadratically more and adds no detail the model was trained to use.

Runtime probe

One click imports torch in a throw-away subprocess and reports what your machine can actually do: Python and platform, torch and CUDA versions, every GPU with its compute capability and VRAM, the status of Triton / FlashAttention / xformers / SageAttention / torchao, whether torch.compile is genuinely usable on this box (CUDA root, host compiler, ninja, cache path), and whether each model backend is ready. Then the subprocess exits and the memory is gone — the Gradio server still holds no CUDA context.

The recommended workflow

Each tab writes what the next one expects to read:

1. Find Duplicates — clean first, so you never spend GPU time on near-identical shots.

2. Image Cropper — frame the subject, one sub-folder per ratio, at native resolution.

3. Move Low-Res Files — quality control, results and originals moved together.

4. Image Resizer — point it at the Cropper's output folder for exact pixel sizes.

5. Rename Files — a clean, correctly sorting sequence.

Side branches to run whenever you need them: Segmentation for masks, Extract Faces for a face dataset, Generate Tiled Images for more data out of very large photos, and Performance & VRAM set once for everything.

The one rule that matters most: crop before you resize. Cropping keeps the original pixels, so resizing afterwards starts from the largest possible image and only has to downscale once. The other way round throws away detail you can never get back, and can force an upscale.

What lands where on disk

The Image Cropper's <width>x<height>/ sub-folder layout is not cosmetic — the Image Resizer reads it directly, matching each bucket to the resolution of the same name. That is exactly why the recommended order is crop → resize.

Quick reference

Every tab, the one setting that matters most, and the mistake to avoid — plus four things worth remembering: presets save everything, the folder scan card tells you what will happen before you press start, subprocess mode keeps idle VRAM at zero, and every destructive-looking step (duplicates, low-res, renames) is either a move or has a preview mode.

Files

Comments

Roland

Is it only possible to run locally on Windows only? otherwise only on cloud service? what about macOS?

MathiasF

Thanks for your work! The duplicate finder works great. Is it possible to include also finding duplicates in subfolders?

SECourses: FLUX, Tutorials, Guides, Resources, Training, Scripts

this is tested on linux, windows, cloud. but for mac i dont have mac to test. but most of the functions should work on mac since it is not like cuda depended so windows is local, linux is local, runpod is cloud, massed compute is cloud, kaggle is cloud. i recommend massed compute as cloud service

Ammar Salem

Thank you for another great app. On the official demo of SAM2 it can do Images and Videos, is there a way we can do that here? I try frame by frame but it is not contestant like in comfyui using sam2

Alex

is it possible to crop out other people from a the images? for example i have a dataset with many images with one woman and one man but i only want to crop the woman how can i go about doing this?

MathiasF

Hi, scanning subfolders works fine. But you should not scan structures with a huge number of files. I scanned a folder structure with round about 250.000 images. Scanning was done in under an hour (thumps up!), but the after process of comparing broke after round about 3 hours. My conclusion -> don's scan so many files :-D

Ammar Salem

yes exactly it create mask as black and white that can be used perfectly in so many applications

Casper

The SAM mask is not corresponding with the cropped output. Is this expected behaviour?

Valentyn Shumakher

No natter what images try the app cuts only the first image from the folder. Possible to process batch?

Eungbin Seo

Traceback (most recent call last): File "C:\imagecrop\app.py", line 75, in from SAM_Segmenter import ( File "C:\imagecrop\SAM_Segmenter.py", line 17, in from sam2.build_sam import build_sam2 ModuleNotFoundError: No module named 'sam2'

Eungbin Seo

How can i get Sam2 file...?

Eungbin Seo

Thank you. After the installation, I opened Windows_Start_App and saw that log message above. Once the compilation process you mentioned finishes, will that resolve my issue? or Do i have to download the sam2 file manually?

Firat Güven

There was a compatibility problem during the installation within the following step : git clone https://github.com/IDEA-Research/GroundingDINO cd GroundingDINO pip install -e . The problem is: the source code of GroundingDINO is not compatible with PyTorch 2.7.0 Solution in my case was to use pre-compiled Wheel-file: pip install https://huggingface.co/MonsterMMORPG/SECourses_Premium_Flash_Attention/resolve/main/groundingdino-0.1.0-cp310-cp310-win_amd64.whl After that step I could download the models and start the app.py

HüseyinT

"Venv" kurulumu tamamlandıktan sonra "Windows_Start_App" dosyasını çalıştırınca aşağıdaki hatayı aldım: [2025-04-28 02:23:52,018] [INFO] [real_accelerator.py:222:get_accelerator] Setting ds_accelerator to cuda (auto detect) W0428 02:23:53.612000 9716 venv\Lib\site-packages\torch\distributed\elastic\multiprocessing\redirects.py:29] NOTE: Redirects are currently not supported in Windows or MacOs. Error: SAM2 checkpoint file not found at C:\Users\husey\Downloads\Ulti_Img_Process_V13\models\sam2.1_hiera_large.pt Press any key to continue . . . "Windows_Install" dosyasına tıklayıp V13 kurulumunda cmd ekranında aşağıdaki hatayı almıştım: "... Attempting uninstall: supervision Found existing installation: supervision 0.25.1 Uninstalling supervision-0.25.1: Successfully uninstalled supervision-0.25.1 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. groundingdino 0.1.0 requires supervision>=0.22.0, but you have supervision 0.6.0 which is incompatible. Successfully installed ImageHash-4.3.2 PyWavelets-1.8.0 accelerate-1.6.0 aiofiles-24.1.0 antlr4-python3-runtime-4.9.3 anyio-4.9.0 click-8.1.8 exceptiongroup-1.2.2 fastapi-0.115.12 ffmpy-0.5.0 gradio-5.27.0 gradio-client-1.9.0 groovy-0.1.2 groundingdino-py-0.4.0 h11-0.16.0 httpcore-1.0.9 httpx-0.28.1 hydra-core-1.3.2 iopath-0.1.10 markdown-it-py-3.0.0 mdurl-0.1.2 numpy-2.1.1 omegaconf-2.3.0 opencv-contrib-python-4.11.0.86 orjson-3.10.16 pandas-2.2.3 portalocker-3.1.1 pydub-0.25.1 pygments-2.19.1 python-multipart-0.0.20 pytz-2025.2 pywin32-310 rich-14.0.0 ruff-0.11.7 safehttpx-0.1.6 sam2-1.1.0 seaborn-0.13.2 segment-anything-1.0 semantic-version-2.10.0 shellingham-1.5.4 sniffio-1.3.1 starlette-0.46.2 supervision-0.6.0 tomlkit-0.13.2 typer-0.15.2 tzdata-2025.2 ultralytics-8.3.115 ultralytics-thop-2.0.14 uvicorn-0.34.2 websockets-15.0.1 Cloning into 'GroundingDINO'... remote: Enumerating objects: 463, done. remote: Counting objects: 100% (240/240), done. remote: Compressing objects: 100% (105/105), done. Rremote: Total 463 (delta 175), reused 135 (delta 135), pack-reused 223 (from 1) Receiving objects: 100% (463/463), 12.87 MiB | 1.59 MiB/s, done. Resolving deltas: 100% (241/241), done. .gitattributes: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.52k/1.52k [00:00 snapshot_download(repo_id="MonsterMMORPG/YoloModels",local_dir="models") File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\_snapshot_download.py", line 296, in snapshot_download thread_map( File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\tqdm\contrib\concurrent.py", line 69, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\tqdm\contrib\concurrent.py", line 51, in _executor_map return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs)) File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\tqdm\std.py", line 1181, in __iter__ for obj in iterable: File "C:\Users\husey\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 621, in result_iterator yield _result_or_cancel(fs.pop()) File "C:\Users\husey\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 319, in _result_or_cancel return fut.result(timeout) File "C:\Users\husey\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 458, in result return self.__get_result() File "C:\Users\husey\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 403, in __get_result raise self._exception File "C:\Users\husey\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\_snapshot_download.py", line 270, in _inner_hf_hub_download return hf_hub_download( File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\file_download.py", line 941, in hf_hub_download return _hf_hub_download_to_local_dir( File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\file_download.py", line 1241, in _hf_hub_download_to_local_dir _download_to_tmp_and_move( File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\file_download.py", line 1675, in _download_to_tmp_and_move http_get( File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\huggingface_hub\file_download.py", line 449, in http_get for chunk in r.iter_content(chunk_size=constants.DOWNLOAD_CHUNK_SIZE): File "C:\Users\husey\Downloads\Ulti_Img_Process_V13\venv\lib\site-packages\requests\models.py", line 822, in generate raise ChunkedEncodingError(e) requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(452224224 bytes read, 445859387 more expected)', IncompleteRead(452224224 bytes read, 445859387 more expected)) Virtual environment made and installed properly Press any key to continue . . .

Hipno

Hello Sir! I haven't started yet but I'm just wondering if we are using the last update version, how do we upgrade to this version?

Draxel

I'm sure this is a problem with my system, but I've run through your video a few times. I'm getting an issue with opening input file aio.lib: [2025-04-29 22:58:35,548] [INFO] [real_accelerator.py:222:get_accelerator] Setting ds_accelerator to cuda (auto detect) test.c LINK : fatal error LNK1181: cannot open input file 'aio.lib' Traceback (most recent call last): File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\transformers\utils\import_utils.py", line 1967, in _get_module return importlib.import_module("." + module_name, self.__name__) File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\transformers\models\bert\modeling_bert.py", line 47, in from ...modeling_utils import PreTrainedModel File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\transformers\modeling_utils.py", line 158, in import deepspeed File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\deepspeed\__init__.py", line 25, in from . import ops File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\deepspeed\ops\__init__.py", line 15, in from ..git_version_info import compatible_ops as __compatible_ops__ File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\deepspeed\git_version_info.py", line 29, in op_compatible = builder.is_compatible() File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\deepspeed\ops\op_builder\fp_quantizer.py", line 35, in is_compatible sys_cuda_major, _ = installed_cuda_version() File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\deepspeed\ops\op_builder\builder.py", line 53, in installed_cuda_version output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True) File "C:\Program Files\Python310\lib\subprocess.py", line 421, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Program Files\Python310\lib\subprocess.py", line 503, in run with Popen(*popenargs, **kwargs) as process: File "C:\Program Files\Python310\lib\subprocess.py", line 971, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Program Files\Python310\lib\subprocess.py", line 1456, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified The above exception was the direct cause of the following exception: Traceback (most recent call last): File "L:\Ulti_Img_Process_V14\app.py", line 70, in from SAM_Segmenter import ( File "L:\Ulti_Img_Process_V14\SAM_Segmenter.py", line 19, in from GroundingDINO.groundingdino.util.inference import load_model, load_image, predict File "L:\Ulti_Img_Process_V14\GroundingDINO\groundingdino\util\inference.py", line 12, in from groundingdino.models import build_model File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\groundingdino\models\__init__.py", line 8, in from .GroundingDINO import build_groundingdino File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\groundingdino\models\GroundingDINO\__init__.py", line 15, in from .groundingdino import build_groundingdino File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\groundingdino\models\GroundingDINO\groundingdino.py", line 24, in from transformers import AutoTokenizer, BertModel, BertTokenizer, RobertaModel, RobertaTokenizerFast File "", line 1075, in _handle_fromlist File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\transformers\utils\import_utils.py", line 1956, in __getattr__ value = getattr(module, name) File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\transformers\utils\import_utils.py", line 1955, in __getattr__ module = self._get_module(self._class_to_module[name]) File "L:\Ulti_Img_Process_V14\venv\lib\site-packages\transformers\utils\import_utils.py", line 1969, in _get_module raise RuntimeError( RuntimeError: Failed to import transformers.models.bert.modeling_bert because of the following error (look up to see its traceback): [WinError 2] The system cannot find the file specified

Hipno

Wow that's so simple! You've honestly made using these systems so incredibly easy to use. Theres literally no other professional in the AI space doing work as amazing as you!!!!

Mig Test

=== Error Occurred === Error details: too many values to unpack (expected 4) Traceback (most recent call last): File ".\Ulti_Img_Process_V14\app.py", line 489, in process_image segmented_image, mask_image, mask_coordinates, _ = sam2_process_image( ValueError: too many values to unpack (expected 4) Line 489 should be change "_" to "*_" as follows: segmented_image, mask_image, mask_coordinates, *_ = sam2_process_image( The *_ variable (a conventional “throw‑away” name) absorbs however many additional values the function hands back, so the unpacking always succeeds even if the library adds new outputs.

RayHell

Exact same issue with a fresh install

Draxel

To confirm, I did build the new computer and I had the same error, so this must be a me issue.

Dan

Hi, is application of this a default recommendation when finetuning flux?

cool1

For the SAM 2 Segmenter app, can we please have options to: 1) Have an option for whether we want the thing searched for shown as text or not (there's a text threshold but not an option to turn it off completely). eg a "show text?" checkbox. 2) Have an option for it not to show the numerical value next to each bounding box (I assume that figures how close the area matched what was searched for). 3) It would be helpful if it could also take a .mp4 video as input instead of only having an image/source folder of images input. This would save having to output a png sequence of a video file to process. Also could there be a way for, where if it could process a video or where the batch option is processing a png sequence, that it took the previous frame(s) into account when drawing the coloured bounding boxes and other coloured outlines (eg. of a person/car etc. ) so that if you play back a video of it the colour of the bounding box or person outline don't keep changing every frame but stay the same for that person/object (so it won't flicker as much and it will look more consistent).

Oleh 23

I'm running your workflow on a system with RTX 5090 + CUDA 12.8, and I’ve noticed two issues: ImageCropper – it crops the images to a different resolution than specified in the prompt line. === Processing IMG_8026.JPG === 1. Original image size: 3024x4032 === SAM2 Processing === 6. Input array shape to SAM2: (4032, 3024, 3) 7. Output segmented image shape: (4032, 3024, 3) 9. Number of coordinates: 3972756 9.1. First few coordinates: [(1381, 1302), (1381, 1303), (1381, 1304), (1381, 1305), (1381, 1306)] 7. Output segmented image shape: (4032, 3024, 3) 9. Number of coordinates: 3838208 9.1. First few coordinates: [(1480, 1373), (1480, 1374), (1480, 1375), (1480, 1376), (1480, 1377)] 10. Initial bbox: [8, 1381, 2537, 4031] === Processing Crops === --- Processing aspect ratio 960x544: --- Trying to reach 100% of target aspect ratio 1.7647058823529411 Trying to reach 99% of target aspect ratio 1.7647058823529411 Trying to reach 98% of target aspect ratio 1.7647058823529411 Trying to reach 97% of target aspect ratio 1.7647058823529411 Trying to reach 96% of target aspect ratio 1.7647058823529411 Trying to reach 95% of target aspect ratio 1.7647058823529411 Trying to reach 94% of target aspect ratio 1.7647058823529411 Trying to reach 93% of target aspect ratio 1.7647058823529411 Trying to reach 92% of target aspect ratio 1.7647058823529411 Trying to reach 91% of target aspect ratio 1.7647058823529411 Trying to reach 90% of target aspect ratio 1.7647058823529411 Trying to reach 89% of target aspect ratio 1.7647058823529411 Trying to reach 88% of target aspect ratio 1.7647058823529411 Trying to reach 87% of target aspect ratio 1.7647058823529411 Trying to reach 86% of target aspect ratio 1.7647058823529411 Trying to reach 85% of target aspect ratio 1.7647058823529411 Trying to reach 84% of target aspect ratio 1.7647058823529411 Trying to reach 83% of target aspect ratio 1.7647058823529411 Trying to reach 82% of target aspect ratio 1.7647058823529411 Trying to reach 81% of target aspect ratio 1.7647058823529411 Trying to reach 80% of target aspect ratio 1.7647058823529411 Trying to reach 79% of target aspect ratio 1.7647058823529411 Trying to reach 78% of target aspect ratio 1.7647058823529411 Trying to reach 77% of target aspect ratio 1.7647058823529411 Trying to reach 76% of target aspect ratio 1.7647058823529411 Trying to reach 75% of target aspect ratio 1.7647058823529411 Trying to reach 74% of target aspect ratio 1.7647058823529411 Trying to reach 73% of target aspect ratio 1.7647058823529411 Trying to reach 72% of target aspect ratio 1.7647058823529411 Trying to reach 71% of target aspect ratio 1.7647058823529411 Trying to reach 70% of target aspect ratio 1.7647058823529411 Trying to reach 69% of target aspect ratio 1.7647058823529411 Trying to reach 68% of target aspect ratio 1.7647058823529411 Trying to reach 67% of target aspect ratio 1.7647058823529411 Trying to reach 66% of target aspect ratio 1.7647058823529411 Trying to reach 65% of target aspect ratio 1.7647058823529411 Trying to reach 64% of target aspect ratio 1.7647058823529411 Achieved 64.00% of target aspect ratio 15. Final bbox: [0, 1381, 2993, 4031] 16. Cropped image size: (2993, 2650) 10. Initial bbox: [8, 1480, 2553, 4031] ImageResizer – constantly throws a FolderNotFound error, even though the input/output folders exist and are correctly defined. Could this be a version mismatch or something specific to the 5090 setup? I’m using the exact workflow and dependencies provided in your guide.

SECourses: FLUX, Tutorials, Guides, Resources, Training, Scripts

nope you are doing wrong. image cropper crops into aspect ratio as much as possible without cropping the subject. image resizer will make it exact resolution and it scans the sub folders of given folder. sub folders has to be like 1024x1024, 1536x1024 - whatever you give check the very top screenshots i put explains a lot

Error_404_unknown

Not sure if I'm just dumb but I have a feature request (unless it's there and I just can't find it) I am trying to use extract faces tab but I just keep getting "no face found" it works with yolo cropping tab but the crops are a little tight. Is there a way to lower the confidence? If not can this be added? Or if not can padding be added to the yolo tab?

TsT65

Can you have it detect left/right inverted or mirrored faces and fix them? It's a problem with training faces that some training images are flipped, and it's hard to see manually.

Scipio

I've recently subscribed and followed the youtube tutorial to set up python, cudann, visual studio etc, but for some reason whenever I try and start one of the programs after the 'one click install' it says gradio is missing. Did I miss a step and if so, how do I fix it?

cool1

I asked in the past and I think you said you could, but could the SAM2 be able (with an option for it) to output a black (blank) mask image (no white) for frames where the object you asked it to search for couldn't be found in that source image (frame)? That way it can work for rotoscoping video a lot more easily and allow simpler matching of the exported mask frames with the original frames (since currently it doesn't output frames where it can't see the object, which causes problems when you import it into things like After FX as it puts "missing frame" chequered background on each missing png sequence frame for frames SAM2 didn't see the thing to mask). Also could the there be please be an option in SAM2 GUI to process all the frames in video? And for the SAM2 segment outputs can there be checkboxes to say whether you want it to add the text and numeric value next to the box and for whether you the boxes/segments drawn 1) in the colours as they do now or 2) all in the same colour (so that it doesn't flicker between colours if they're frames of a video - where it can currently draw a box around the same object but it gets drawn in different colours on every source frame which can look flickery when played back at normal speed)?

cool1

Okay thanks. I'll try. I haven't created .pdfs for a long time so I'm probably not that good at them. It might be easier to create an image for each thing but I'll try that. I sent before a dropbox link (now expired) where it showed some frames and explained the point about it being better if it could output frames even when the object to be masked isn't seen by SAM2.

cool1

Okay thanks. I'll do that.

Scipio

I sent the email

cool1

Thanks a lot if that's about my requests. Yes I can remind you later if needed.

Aristotel NPS

I will also wait for the solution to the problem, thank you

Mig Test

On the 'Image Cropper' tab, if I use SAM2 and nothing is detected, the source image will be copied to the destination unaltered. Can you please change the behavior so that the file is skipped instead? Use case: I'm trying to exact all hands from a large gallery of images to do hand training. I would like the output folder to contain only hands, but it contains hands AND all images where no hands are present.

Mike Kjeldgaard

image cropper does nothing for me. with debug on, no logs. image resizer works...

Caleb

Have you done any testing to see if tight crops on the subject or empty backgrounds make better training datasets? I thought that having some context behind the subject helped with flexibility but I could be wrong.

Aleksei Goferman

Hi, I just installed v20. If I want to switch to v21, should I delete everything first or simply overwrite the existing files?

Aleksei Goferman

I copied everything from v21 into the v20 folder and completely overwrote it. Now it doesn’t start anymore — the CMD window just stays blank.

Aleksei Goferman

A new installation in the v20 folder didn’t help. It only works when I do a completely fresh installation of v21.

Lou

Just came by to show my appreciation for what you and your team do. Great program.

Everlive

Hello! Is there a way to install and make it run on Linux (Ubuntu)? Thanks!

Everlive

Thank you! I had to move away from Windows, will see how I go.

Taiga

IMAGE RESIZER input folder: z:\1024x1024 (filename example: WA_a_1_07.jpg) output folder: z:\resize resolutions: 1024x1024 message: No images found to process in the specified resolution folders.

Michael

Hi, is it also possible to run the installer (maybe Runpod ...) on my local MacBook? Or is it in this case needed to spend money in runpod or mass compute for image pre-processing?

Wolkenfels

during Windows_install. i get this error: (V26) ERROR: flash_attn-2.8.2-cp310-cp310-win_amd64.whl is not a supported wheel on this platform. and when i try to start the app i get: File "C:\comfyui\Ulti_Img_Process_V26\app.py", line 1, in import gradio as gr ModuleNotFoundError: No module named 'gradio' is there an easy way to fix this?

Wolkenfels

tried pip install gradio after that the error changes to miissing import cv2 dont know what package that shoule be.

Dan L.

Has anyone had trouble with the Windows v28 Installer recently? I'm getting so many errors, that I don't know where to start. Makes me think it's something on my end. I'm new to all of this. Tried fresh installs in several folders. My connection is fine. The last section of errors is as follows: Traceback (most recent call last): File "D:\AI\Ulti_Img_Process28\HF_model_downloader_img_process.py", line 2, in snapshot_download(repo_id="MonsterMMORPG/YoloModels",local_dir="models") File "D:\AI\Ulti_Img_Process28\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "D:\AI\Ulti_Img_Process28\venv\lib\site-packages\huggingface_hub\_snapshot_download.py", line 248, in snapshot_download raise LocalEntryNotFoundError( huggingface_hub.errors.LocalEntryNotFoundError: An error happened while trying to locate the files on the Hub and we cannot find the appropriate snapshot folder for the specified revision on the local disk. Please check your internet connection and try again. . . . Virtual environment made and installed properly Press any key to continue . . .

Dan L.

Will do! Thanks so much!

Dan L.

Just passing by to remind you of this. Thanks in advance!

Dan L.

Just saw the post, it looks very impressive! I'm very grateful, thank you so much. When my laptop finishes a multi-day chkdsk /r task on a bunch of 3.5 inch drives, I'll use the completely new version!

Dan L.

Will do! Thanks again.