Nodes/ComfyUI 1hewNodes/Image Resize Gemini31FlashImage
ComfyUI Node

Image Resize Gemini31FlashImage

The Gemini 3.1 Flash size table, including the panoramas

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

If you read the Gemini 3.0 Pro resize article, this is the 3.1 Flash version - same idea, bigger table. Nano Banana 2 (Gemini 3.1 Flash, February 2026) is Google's speed-quality hybrid, and it supports a wilder set of input sizes: an extra half-res tier and extreme panoramic aspect ratios like 8:1 and 4:1 that the Pro model doesn't offer. This node pre-sizes your image to that table, locally, with no API call.

It's from ComfyUI 1hewNodes (solo dev 1hew, bilingual README, active development; the preset families were realigned in v3.21.0 and the [1k] 4:1 entry corrected to 2064x512 in v3.18.1 - yes, the author actually maintains these numbers).

How it works

Same machinery as the 3.0 Pro node - pick a preset_size or let auto choose the nearest bucket by aspect ratio - but the preset list is extended in two ways.

First, there's a [0.5k] tier: half-resolution versions of all the standard ratios, capped by [0.5k] 512x512. That's for when you want the absolute smallest valid input (fast analysis, thumbnails, token economy) without dropping below what the model accepts.

Second, there are the extreme ratios. Alongside the familiar 21:9 / 16:9 / 3:2 family, the table adds 8:1, 4:1, and their vertical mirrors 1:8 and 1:4, at every tier - [0.5k] 1456x176 up to [4k] 11712x1408. Those are the panorama buckets, and they're the reason you'd pick the Flash node over the Pro one: if you're sending a wide strip to Gemini 3.1 Flash, this is the only node in the pack with the right sizes.

Everything else matches the family pattern: fit (crop/pad/stretch), pad_color, and synchronized optional image + mask inputs with image and mask outputs so your mask travels through the resize untouched. The node even keeps alias entries for a few deprecated preset spellings, so old workflows don't hard-fail after the table was renumbered.

The inputs that matter

  • preset_size - explicit preset (including 0.5k/1k/2k/4k and the 8:1–1:8 extremes), or an auto tier (default auto (2k | 4k)).
  • fit - crop, pad, or stretch.
  • pad_color - fill for pad.
  • image / mask - resized 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

No model files, no network. The pack's requirements are heavy overall (opencv, scikit-image, ultralytics/rembg for other nodes) so first install is slow. Needs current ComfyUI.

Gotchas

  • Same name-lie as the Pro node - "Gemini 3.1 Flash" is just the preset table; there's no API call and no key. Don't go hunting for a Gemini account.
  • Extreme ratios are extreme - [4k] 11712x1408 is over 16 megapixels. If a panorama comes back with a surprise VRAM spike, remember the 0.5k/1k tiers exist.
  • Aliased presets still work but may not match your saved workflow's exact label - the node normalizes the old spellings to the corrected sizes. Your graph won't break; it just points at the updated dimensions.
Category1hewNodes/image/resize

Inputs (5)

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

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK