Skip to content

Image Preparer Auto Crop

speedyrulz edited this page Oct 31, 2026 · 1 revision

Auto Crop

Auto crop crops your pictures to something you describe, such as face, dog or red car. An AI model, SAM 3.1 (Meta's Segment Anything 3.1), finds it in each picture. The crop is then worked out exactly like the RulZ Mask Intelligent Crop ComfyUI node, with all of its settings. Added in version 0.2.0.

Using it

  1. Pick the pictures. Ctrl+click or Shift+click pictures on the main screen to select them. With none selected, every picture is used.

  2. Click Auto crop… in the top bar, or right-click a picture and choose Auto crop. The first time, the app offers a one-time setup (see below).

  3. Type what to crop in the box at the top.

  4. Click Preview (or press Enter). Each selected picture is checked, starting with the one on screen:

    • the part that was found is tinted red
    • the crop is a dashed box, with everything outside it darkened
    • the line at the bottom shows how many matches there were, how sure the AI was, and the crop size

    Click the small pictures in the strip below to check each one. The first Preview after opening the app takes up to half a minute while the AI loads; after that it's well under a second per picture.

  5. Adjust the crop settings. The dashed box moves straight away. If you change the words or the Finding it settings, click Preview again.

  6. Click Crop…, pick a folder, and every picture is cropped and saved there with the same file name. Your originals are never changed. Pictures where nothing was found are skipped and listed when it's done.

Clean up and crop in one press

Tick Also remove noise and JPEG damage first to apply your clean-up settings (color noise removal, JPEG artifact removal and detail recovery) before cropping. Each picture uses its own settings, the same as Save all…, including Best quality (AI) if that's selected. See Clean-up Options for what each one does.

Settings

Finding it (SAM 3.1)

Setting What it does
Matches All matches: the crop covers every match (for example every face in a group photo). Best match only: just the one the AI is most sure about.
Confidence How sure the AI must be that something matches (default 0.50). Lower finds more, including wrong things; higher finds less.
Mask threshold How sure the AI must be about each pixel for it to count as part of the match (default 0.50). Lower makes the found area bigger, higher makes it tighter.

Crop (Mask Intelligent Crop)

Setting What it does
Padding Same on every side: one value for all sides. Each side separately: separate values for top, bottom, left and right.
All sides / Top, Bottom, Left, Right How much room to leave around what was found, as a percentage (default 10%).
Measured against What the percentage is of. The final crop (default): what was found sits inside a border that's that share of the output. The found area: a share of the found area's size. The whole picture: a share of the picture's size.
Shape limit Never crop narrower or wider than this shape (default 2:3 / 3:2). A crop that would be too tall is made wider; one that would be too wide is made taller. It only ever grows, and stays inside the picture. Off turns it off.
Divisible by Grows the crop so its width and height are multiples of this number, for example 8, 16 or 64 for training. 1 turns it off.

Everything on this screen is remembered for next time.

Setting it up

The first time you click Auto crop…, a window called Set up Auto crop lists what's missing:

What Size Where it goes
PyTorch with NVIDIA GPU support (shared with Best quality mode, so skipped if that's already set up) about 3 GB to download The app's own .venv folder
Transformers and TorchVision, which run SAM 3.1 about 100 MB The app's own .venv folder
The SAM 3.1 model from huggingface.co/unsloth/sam3.1 1.7 GB %LOCALAPPDATA%\RulZ\Image Preparer\models\sam3.1

Click Set up. No Hugging Face account or sign-in is needed. When the download is done, the app checks the model file's size and checksum, so a broken download is never used. If something fails, click Try again; it only does the parts that are still missing. See Troubleshooting.

Auto crop works best on an NVIDIA graphics card (GeForce 20-series or newer) and uses about 2 GB of its memory. Without one it still works, but much more slowly.

SAM 3.1 is by Meta under the SAM License, which comes with the model download.

RulZ AI Tools Suite

The apps

RulzTrainer

README (full reference) Releases

Rulz Training Captioner

Getting started

Using the app

Models and GPUs

Reference

GitHub repository

RulZ LLM Suite

Using the app

Reference

Contributing


Releases · Issues · Source

RulZ Coding Agent

Using the app

Reference

Contributing


Releases · Issues · Source

RulZ Image Organizer

Using RulZ

More

RulZ Image Tournament

Using the app

Developers

RulZ Image Crawler

Getting started

Using the app

Help

README (full reference)

RulZ Image Preparer

Getting started

Using the app

Reference

README (full reference)

RulZ Image Grid

Using the app

Help

README (full reference)

RulZ Simple Video Clip Extractor

Getting started

User guide

Help

Clone this wiki locally