Nodes/ComfyUI 1hewNodes/Image Resize Gemini30ProImage
ComfyUI Node

Image Resize Gemini30ProImage

Resize for Nano Banana Pro without calling any API

By 1hew·Created about a year ago·Updated 7 days ago· 33
Image Resize Gemini30ProImage
  • image
  • mask
  • image
  • mask
preset_sizeauto (2k | 4k)
fitcrop
pad_color1.0

Here's the thing about Google's Gemini image models (Nano Banana Pro, the "Gemini 3 Pro Image" API): they have a short list of recommended input sizes, and if you hand them anything else they'll do their own thing - resize, crop, or silently disappoint. Image Resize Gemini30ProImage is a local adapter that snaps your image to one of those preset sizes before you send it anywhere. No API, no key, no network - it's just a resize node with Google's dimension table baked in.

It's from ComfyUI 1hewNodes (solo dev 1hew, bilingual README, active development). If you're feeding a ComfyUI workflow's output into Gemini/Nano Banana for editing or analysis, this is the sizing glue.

How it works

Pick a preset_size and the node resizes your image to match. The presets are Gemini 3.0 Pro's recommended buckets across three tiers - [1k], [2k], [4k] - each covering ten aspect ratios (21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16). The [2k] 2048x2048 and [4k] 4096x4096 entries are the ones you'll recognize from Google's 4K-native marketing.

The default preset_size is the auto family, and this is where the node gets clever. Feed it an image with no preset selected and it computes your image's aspect ratio (in log space) and picks the nearest preset automatically, within the tiers you allowed - auto (2k | 4k) means "use the 2K or 4K bucket closest to my input." So a 1536x2048 image lands on [2k] 1856x2304 rather than getting mangled to a random square. fit then decides how to fill that box: crop (cut to fit, the default), pad (letterbox with pad_color), or stretch (deform to fit - the option for when exact dimensions matter more than aspect).

It also mirrors the transform onto an optional mask input, so if you're sending both an image and a mask to a Gemini editing flow, they resize in perfect sync. Outputs: image and mask.

The inputs that matter

  • preset_size - explicit preset, or an auto tier option (default auto (2k | 4k)).
  • fit - crop, pad, or stretch.
  • pad_color - fill for the pad fit.
  • image / mask - optional inputs; outputs resize in sync.

Installing it

ComfyUI Manager → search "1hew" / "ComfyUI 1hewNodes" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes

Pack requirements are heavy (opencv, scikit-image, plus detection deps) - first install is slow; this node needs numpy/torch. No models. Needs current ComfyUI (modern node API).

Gotchas

  • The name is a lie (in a good way) - "Gemini" here means the presets match Google's Gemini 3.0 Pro size table, not that this node talks to Google. There's no network call and nothing to sign up for.
  • auto needs an image - with no image connected, the auto tiers have nothing to measure; wire an image in or pick an explicit preset.
  • Watch the 4K bucket - [4k] 6336x2688 is huge. If you're previewing or pasting into tight VRAM, pick the 1K/2K auto tier instead.
Category1hewNodes/image/resize

Inputs (5)

NameTypeDefaultDescription
preset_sizeCOMBOauto (2k | 4k)36 options: auto, auto (1k), auto (2k), auto (4k), auto (1k | 2k), auto (2k | 4k), +30
fitCOMBOcrop3 options: crop, pad, stretch
pad_colorSTRING1.0
imageoptIMAGE
maskoptMASK

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK