Nodes/comfyui-superside-nodes/Superside GPT Image 2 Edit
ComfyUI Node

Superside GPT Image 2 Edit

GPT Image 2 editing, done properly — mask modes, sensible sizing, and a 4K ceiling explained

By Superside·Created about a month ago·Updated 3 days ago· 1
Superside GPT Image 2 Edit
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • mask_image
  • images
  • info
prompt
api_key
sizematch input + resolution
resolution2K
width1920
height1080
mask_modeoff - edit whole image
invert_maskfalse
qualityhigh
num_images1
output_formatpng
sync_modefalse

OpenAI's GPT Image 2 is a genuinely good edit model, but the default API experience makes you think about output sizes and masks more than you should. This node fixes both of those with two well-thought-out dropdowns, and it's the version of "use GPT Image 2 in ComfyUI" that actually feels designed instead of bolted together.

The sizing story first, because it's the most confusing part of the raw API and this node solves it. GPT Image 2 caps total output at roughly 8 megapixels, so "4K" doesn't mean the same thing at every aspect ratio. The node's size dropdown defaults to match input + resolution: it keeps your input image's own aspect ratio - a tall portrait stays a tall portrait, no surprise cropping - and scales it to the resolution you pick (1K/2K/4K). So you just choose 4K and get the biggest valid output for whatever shape you fed it: ~3840px on the long edge at 16:9 (true UHD), ~2880 at 1:1, ~2528×3264 for a portrait. Other size options: match input (original) keeps the input's exact size, a fixed aspect ratio, or custom pixels (with width/height, multiples of 16). The tooltips spell all this out, and it's the rare node where the defaults are genuinely the right call.

The masking story is the second thing this node gets right. One mask_mode dropdown replaces a pile of fiddly settings:

  • off - edit whole image (default) - the mask is ignored entirely. This is for crop-and-stitch pipelines where a separate stitch node does the masking, which is how the pack's own workflows treat it.
  • guide model (soft) - sends the mask so GPT focuses its edits on the white area, but the model may still re-render the rest.
  • lock outside mask (hard) - the same, plus the result is composited back only inside the mask, so everything outside stays pixel-identical to the input. This is the standalone-inpainting mode, and it's the one that gets you the "nothing else moved" guarantee.

invert_mask flips the white=edit convention if your mask is inverted. quality (auto/low/medium/high), num_images, and output_format (png/jpeg/webp) round out the rest.

Inputs: prompt, image_1, and api_key required; image_2image_6 for multi-reference editing, plus mask_image and everything above. Outputs are images (IMAGE) and info (STRING, result URL).

Under the hood it runs through fal's queued execution path - GPT Image 2 is a slow endpoint, so the node submits and polls with a 20-minute timeout rather than holding one fragile connection open. Expect the graph to wait on this one.

The honest caveats: it's a closed model on metered fal credits, your images leave the machine, and OpenAI's content policy rides along - there's no local abliterate for this. The KB's read on GPT Image 1.5 is "impressive but unreliable access," and GPT Image 2 is the stabilized version of that same line. Use the lock outside mask mode when you need the rest of the frame untouched, and off mode in a stitch pipeline - the tooltips genuinely tell you which.

Install - ComfyUI Manager (search "comfyui-superside-nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Superside/comfyui-superside-nodes
pip install -r requirements.txt

Restart ComfyUI, find it under Superside. Key in the api_key widget (blank falls back to FAL_KEY), no model downloads.

CategorySuperside

Inputs (19)

NameTypeDefaultDescription
promptSTRING
image_1IMAGE
api_keySTRING
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
mask_imageoptIMAGE
sizeoptCOMBOmatch input + resolutionOutput shape. 'match input + resolution' keeps your image's aspect (portrait stays portrait) and scales it to 'resolution' below - just pick 4K for the biggest. 'match input (original)' keeps the input's own size. Or pick a fixed aspect ratio / 'custom pixels'.
resolutionoptCOMBO2KHow large the output is when 'size' is an aspect ratio. GPT Image 2 caps total size to ~8 MP, so 4K gives ~3840 px on the long edge at 16:9 (true UHD), less for squarer ratios (~2880 at 1:1).
widthoptINT192016–4096Only used when size is 'custom pixels'. Must be a multiple of 16.
heightoptINT108016–4096Only used when size is 'custom pixels'. Must be a multiple of 16.
mask_modeoptCOMBOoff - edit whole imageHow to use mask_image: - 'off - edit whole image': ignore the mask, edit everything. Use this in crop-stitch pipelines where a separate stitch node does the masking (this is how it worked before). - 'guide model (soft)': send the mask to GPT so it focuses edits on the white area (the model may still re-render the rest). - 'lock outside mask (hard)': same, plus paste the result back only inside the mask so everything outside stays pixel-identical to the input. Best for standalone inpainting.
invert_maskoptBOOLEANfalseOnly used when mask_mode is not 'off'. Mask convention is WHITE = edit this area, BLACK = keep. Turn ON if your mask is inverted (the area you want to change is black).
qualityoptCOMBOhigh4 options: auto, low, medium, high
num_imagesoptINT11–4
output_formatoptCOMBOpng3 options: png, jpeg, webp
sync_modeoptBOOLEANfalse

Outputs (2)

NameTypeDescription
imagesIMAGE
infoSTRING