Meux Smart Exact Resize
Crop AND pad, decided for you
- image
- IMAGE
Every resize node in ComfyUI assumes you know what you want. Want exactly 1000×600? Fine - but if your source is 1200×500, do you crop the sides or pad the top and bottom? MeuxSmartExactResize is the node that stops asking and just produces the exact size you specified, picking crop or pad per image based on what's safe - and offering three different padding styles when padding is the answer.
It's the kind of node that matters most in batch work, where one workflow has to swallow images of wildly different aspect ratios and emit a single fixed size.
How it works
For each image in the batch, it decides between two operations. In auto mode: if the source is big enough in both dimensions and cropping won't eat your subject (judged by safe_margin_percent), it crops. Otherwise it pads. You can force either behavior with crop_only or pad_only.
Cropping anchors to center, top, bottom, left, or right - the anchor decides which part of the image survives the crop.
Padding has three styles, but don't trust all the names equally:
blur_extend(default) - the image is stretched to fill the canvas, heavily blurred, and the original pasted centered on top. That "blurred canvas behind the photo" look that's everywhere in thumbnails.edge_extend- despite the name, the current code fills with a plain background rather than actually replicating edge pixels. Treat it as the cheap flat option.solid_color- plain black bars.
Inputs: image, target_width, target_height, mode, anchor, safe_margin_percent, padding_mode. Output: a single IMAGE at exactly the target size.
The safe_margin_percent detail is the one that's easy to miss. It defaults to 0.1, meaning auto mode refuses to crop if the target would eat more than roughly a 10% margin around the edges of the source - protecting your subject from an over-aggressive crop.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/fchangjun/Comfyui_MultiSaveImage
cd Comfyui_MultiSaveImage
pip install -r requirements.txt
Or ComfyUI Manager → search "Baidu Meux ComfyTools" → restart.
Where people get burned
- Crop eats the subject. Your
safe_margin_percentis too small, or you're incrop_onlyon a mismatched aspect. Raise the margin or letautodecide. - Unexpected flat bars. That's
solid_color, oredge_extenddoing its thing. If you wanted the pretty blurred look, checkpadding_mode. blur_extendon a huge image. The blur runs at full canvas size and can get slow on 4K targets;edge_extendis the cheap alternative when you don't care about aesthetics.
If your pipeline has a "everything comes out at this exact size" stage - thumbnails, batch compositing, feeding a fixed-aspect video model - this is the node that makes that stage one click instead of a chain of resize/center-crop/pad nodes you re-derive every time.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| target_width | INT | 10001–4096 | — |
| target_height | INT | 6001–4096 | — |
| mode | COMBO | auto | 3 options: auto, crop_only, pad_only |
| anchor | COMBO | center | 5 options: center, top, bottom, left, right |
| safe_margin_percent | FLOAT | 0.100–0.4 | — |
| padding_mode | COMBO | blur_extend | 3 options: solid_color, edge_extend, blur_extend |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |