Nodes/ComfyUI Layer Style/LayerUtility: Nano Banana Image Scale
ComfyUI Node Runs on cloud

LayerUtility: Nano Banana Image Scale

Nano Banana Image Scale — resize an image to what Nano Banana actually wants

By chflame163·Created 3 years ago·Updated 5 days ago· 3,113
LayerUtility: Nano Banana Image Scale
  • image
  • IMAGE
method

Nano Banana is the community nickname for Google's Gemini image models (Gemini 2.5/3 Flash and Pro Image) - closed-source, API-only, and genuinely strong at image editing and multi-reference composition. Like most hosted image APIs, it has resolution and aspect-ratio expectations under the hood that aren't always obvious from the outside, and feeding it something outside that comfort zone can mean wasted tokens, unnecessary cropping, or output that doesn't match what you sent in. This node exists purely to close that gap: it resizes your image to whatever's optimal for a Nano Banana call before you send it, so you're not guessing.

How it works

Per the node's own description, it adjusts the scale appropriately for images with different aspect ratios so that all the original information is preserved rather than cropped away - in other words, it's not a naive "force to one fixed size" resize; it accounts for your source image's proportions and picks dimensions that keep the whole picture intact. Exactly which target size it lands on for any given aspect ratio isn't exposed as a setting - the only real knob you get is the resampling algorithm used to get there.

The inputs and outputs that matter

  • image - the image you're about to send to a Nano Banana call.
  • method - the resampling algorithm: lanczos, bicubic, hamming, bilinear, box, or nearest. Lanczos is the sharp, general-purpose default for photographic content; nearest is only for pixel art or masks where you explicitly don't want smoothing.

Output: a single resized IMAGE, ready to hand to whatever node actually makes the Nano Banana API call in your graph.

How to install it

Search ComfyUI Layer Style in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt

Restart; it's under 😺dzNodes → LayerUtility. This node itself needs no model or API key - it's pure image resizing; the actual API call and its credentials live in whatever node you're feeding this into.

Common issues

This node only prepares the image - it doesn't call any API itself, so if your Nano Banana request is failing, the problem is downstream (credentials, quota, the actual API node), not here. If your output looks softer or blurrier than expected, try switching method to lanczos or bicubic - bilinear and box are faster but visibly softer on detailed source images. And because this node deliberately preserves full image content rather than cropping to a fixed frame, don't be surprised if the output isn't an exact round number or a "clean" aspect ratio - that's the point, it's optimizing for what the API actually wants over what looks like a tidy resolution.

Category😺dzNodes/LayerUtility

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
methodCOMBO6 options: lanczos, bicubic, hamming, bilinear, box, nearest

Outputs (1)

NameTypeDescription
IMAGEIMAGE