RBG Pad Pro π οΈ
The outpainting prep node that hands your model a mask for free
- image
- mask
- IMAGE
- MASK
The modern outpainting trick is deceptively simple: pad your image out to a bigger canvas, then ask a fill model to paint over the padding. The whole skill is in the prep - and that's exactly what RBG Pad Pro does. It takes one image (plus an optional mask), expands it to whatever canvas you need, and - this is the part that saves you a whole subgraph - outputs the mask of the padded region along with the image, guaranteed aligned.
That mask is what you feed to Flux Fill or any inpaint model so it knows which pixels are the extension and which are your original. Do this by hand with stock nodes and you're juggling masks, inversions, and resize mismatches. This node collapses the whole thing into one box. It's the little sibling in the ComfyUI-RBG-ImageStitchPlus pack (the bigger one, Image Stitch Plus, joins multiple images together - this one preps a single image).
How it works
The node builds an empty canvas sized to your image plus pad_left/right/top/bottom, optionally padded further by pad_aspect_ratio, then places your (optionally scaled, rotated, flipped) image according to image_position and image_offset_x/y. The four pad_mode choices fill the surrounding emptiness:
- pad - solid
pad_colorfill. The baseline. - pad_edge - fills with the average colour of the image's border. Best for extending a background so the seam is invisible.
- pad_edge_pixel - actually repeats your image's border rows and columns outward. No flat fill at all; the edge just keeps going. Great for textured walls, skies, fabric.
- transparent_fill - doesn't paint anything; it pulls the image's alpha channel into the output MASK. Use it when you want to extract an RGBA channel as a workable mask.
Then mask_blur_sigma gaussian-blurs the mask - that's your feathered transition, so the fill model gets a soft edge instead of a hard line. Everything downstream (rotate, flip, scale, crop) is applied to the mask at the same time as the image, so they can never drift apart.
The inputs that matter
pad_aspect_ratio- pick a preset (1:1, 16:9, 9:16, 21:9, etc.) and the node computes the padding needed to conform your image to that ratio, on top of any manual pads. This is how you standardize outputs for a batch or a social-media grid.pad_noise_strength+noise_mode+noise_seed- sprinkles gaussian noise over just the padded area. Flat colour is the worst thing you can give an outpaint model; a whisper of noise (0.01β0.05) gives it texture to anchor to. Keep the strength low or you'll be painting over static.BorderCrop_threshold+BorderCrop_color- auto-trims a near-uniform border (threshold ~0.01β0.05) before padding. Perfect for stripping letterbox bars off a screenshot.invert_mask- defaults to True. Don't be surprised when the MASK output comes out inverted; the author chose that so the mask marks the padded region for typical outpainting pipelines. If your model paints the wrong half, this is the first switch to flip.show_preview- renders the result inline so you can tweak offsets without a save node.
Install
It's the same pack as Image Stitch Plus, so installing one gives you both:
cd ComfyUI/custom_nodes
git clone https://github.com/RamonGuthrie/ComfyUI-RBG-ImageStitchPlus.git
pip install -r requirements.txt
Restart, and it's under RBG-Suite-Pack. Or just hit ComfyUI Manager and search the pack title. Dependencies are only numpy + Pillow - no models to download, no heavy wheels. The nvidia_rtx_vsr option in the resample dropdown needs a separate pip install nvvfx, an RTX GPU and driver 570+; without those it silently falls back to lanczos, so don't count on it by default.
Where people get tripped up
The number one confusion is invert_mask defaulting to True - wire it straight into an inpaint model and it can look like the node "painted the wrong side." It hasn't; flip the toggle. Second is canvas size surprises: if the output is bigger than your pad values suggest, the aspect-ratio pad is adding on top of them - that's by design. And if you're feeding the MASK output through a resize node before your fill model, resize with the same method as the image or you'll break the alignment that's the whole point of this node.
Inputs (30)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| pad_mode | COMBO | π§± pad | 4 options: π§± pad, πΌοΈ pad_edge, 𧬠pad_edge_pixel, πͺ transparent_fill |
| pad_left | INT | 00β8192 | β |
| pad_right | INT | 00β8192 | β |
| pad_top | INT | 00β8192 | β |
| pad_bottom | INT | 00β8192 | β |
| mask_blur_sigma | FLOAT | 0.00β300 | β |
| pad_color | STRING | #00FF00 | β |
| image_position | COMBO | center | 5 options: center, left, right, top, bottom |
| image_offset_x | INT | 0-8192β8192 | β |
| image_offset_y | INT | 0-8192β8192 | β |
| image_scale | FLOAT | 1.000β10 | β |
| fill_transparent_background | BOOLEAN | false | β |
| transparent_fill_color | STRING | #7F7F7F | β |
| pad_aspect_ratio | COMBO | custom | 12 options: custom, βΉοΈ 1:1 Square (Instagram, Facebook), πΈ 2:3 Portrait (35mm Film), π± 3:4 Portrait (Pinterest, Mobile), π° 5:8 Portrait (Editorial/Magazine), π² 9:16 Portrait (Instagram Stories, TikTok), +6 |
| resize_mode | COMBO | π« none | 3 options: π« none, βοΈ resize_longer_side, βοΈ resize_shorter_side |
| target_size | INT | 102464β8192 | β |
| resample_filter | COMBO | magic_kernel_sharp | magic_kernel_sharp: Costella MK3 + Sharp-2013 | mitchell_netravali: B=C=1/3 Spline | anti_aliased_bicubic: PyTorch AA Bicubic | dwt_haar: Haar LL DWT Downscaling | nvidia_rtx_vsr: AI TensorRT Upscaling |
| auto_crop_aspect_ratio | BOOLEAN | false | Crops the image to match the selected pad_aspect_ratio instead of expanding the canvas with padding. |
| invert_mask | BOOLEAN | true | β |
| flip_horizontal | BOOLEAN | false | β |
| image_rotation | FLOAT | 0.00-360β360 | β |
| BorderCrop_threshold | FLOAT | 0.0000β1 | β |
| BorderCrop_color | STRING | #000000 | β |
| pad_noise_strength | FLOAT | 0.0000β1 | Strength of noise added to the padded area. Useful for outpainting. |
| noise_seed | INT | 00β18446744073709550000 | Seed for the random noise generation. |
| noise_mode | COMBO | Color (Default) | 3 options: Color (Default), Greyscale, Greyscale + Mask |
| divisibility | COMBO | None | Enforce output dimensions to be divisible by this amount (e.g., 8, 16, 32 for model compatibility) |
| show_preview | BOOLEAN | false | β |
| maskopt | MASK | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |
| MASK | MASK | β |