NH Remove Resize Padding
Undo the letterbox bars your resize added
- image
- resize_data
- image
- width
- height
- info
Letterbox bars are the tell-tale sign of a workflow that resized an image to fit a model without cleaning up after itself. White stripes on the sides of every output, a watermark-sized reminder that the aspect was padded to fit. NH Remove Resize Padding is the cleanup step: it takes the resize_data that NH's resize nodes recorded and crops the padding back off.
The inputs are minimal - image, the resize_data from a NH Smart Ratio Image Resize or NH Ratio Preset Image Resize, an output_size choice, and resize_method. That's the whole thing, because everything else the node needs traveled along in the resize_data metadata: the content region, the padding, the original source dimensions. You're not re-declaring anything; you're just saying what you want back.
The two output modes
- content_region (default) - crops to exactly the content area, i.e. what was inside the pad bars. You get the un-letterboxed image at the resized dimensions. This is the mode for "I want the image as it was framed before padding."
- original_size - crops to the content region then stretches it back to the source image's original dimensions. Same framing as
content_region, but your output matches the input size again, which matters if a downstream node (or a folder of source-sized outputs) expects that.
There's also a graceful fallback: if the image arrives with no resize_data at all, the node passes the image through untouched and reports that in info - so a graph wired wrong doesn't crash, it just does nothing useful. Keep an eye on info for that message; it's the node's way of saying "you forgot the metadata."
Where it lives in the workflow
The canonical shape is the one the pack README documents:
Load Image -> NH Smart Ratio Image Resize -> (your pipeline) -> NH Remove Resize Padding
Resize in contain_pad mode, run your diffusion or upscaling, then feed the result back through this node with the same resize_data and the pad bars never make it to the final image. resize_data is just a pass-through bundle - you carry it alongside the image the whole way, and Remove Resize Padding consumes it at the end. The outputs are image, width, height, and info, and the width/height reflect whatever mode you chose.
Install
It ships with NH-Nodes:
- ComfyUI Manager → search NH-Nodes → install → restart ComfyUI. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
pip install -r requirements.txt
Then restart ComfyUI.
No models, no dependencies beyond the pack's standard ones.
Common issues
The number-one failure is disconnecting the resize_data wire somewhere mid-pipeline - it's an easy socket to lose in a big graph, and the node's only clue is the "no resize_data found" pass-through in info. The second is mode confusion: original_size re-stretches to the source dimensions, so if your output looks softer or squished, you've picked that mode when content_region was the intent. And if you're feeding it output from a different pack's resize node, stop - this only understands NH's own resize_data type, not a generic bounding box.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resize_data | NH_RESIZE_DATA | — | |
| output_size | COMBO | content_region | 2 options: content_region, original_size |
| resize_method | COMBO | lanczos | 8 options: lanczos, bicubic, bilinear, nearest, nearest-exact, area, +2 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |
| info | STRING | — |