Nodes/Comfyui-zhenzhen/Zhenzhen Gemini 3.1 Flash Image Edit S2A
ComfyUI Node

Zhenzhen Gemini 3.1 Flash Image Edit S2A

The cheap-async route with 14 reference images

By T8mars·Created about a year ago·Updated 2 days ago· 740
Zhenzhen Gemini 3.1 Flash Image Edit S2A
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • image7
  • image8
  • image9
  • image10
  • image11
  • image12
  • image13
  • image14
  • image
  • image_url
  • task_id
  • response
prompt
modetext2img
modelgemini-3.1-flash-image
aspect_ratioauto
image_size2K
apikey
task_id
response_formaturl
seed0
skip_errorfalse

Google's Gemini 3.1 Flash image model - the one that made "Nano Banana 2" a household name in this subreddit - is a closed API product, and this node is the cheap, async way to reach it: Comfly_gemini_3_1_flash_image_edit_S2A. The "S2A" is the important part: sync-to-async. Jobs go into the relay's async task queue, which means a long generation doesn't hold your graph hostage, and the node can be re-run with the same task_id to fetch a result that finished on the server.

The model supports both text-to-image and full image editing with up to 14 reference images - that's the reference-multi-image editing that made the Gemini image line famous, and 14 is a lot of context to throw at one scene.

The inputs that matter

  • mode - text2img or img2img. Flip to img2img and the image1image14 inputs become the references to edit.
  • model - gemini-3.1-flash-image (default) or the lighter gemini-3.1-flash-lite-image. Lite is capped at 1K - Google's own decision, per the changelog - but it's cheaper and fine for drafts.
  • image_size - 1K, 2K, or 4K. Bigger bills bigger.
  • aspect_ratio - 13 options from auto through 21:9 and 9:21, including the portrait-ish 4:5 and 5:4.
  • task_id - the async lifeline. Leave it empty to submit a new job; paste in a previous one to pull the finished result without paying again.
  • response_format - url or b64_json, seed, and the pack-standard skip_error fill out the optional list.

Outputs mirror the async design: image (IMAGE tensor), image_url, task_id (save this - it's your receipt and your refetch handle), and response (raw JSON).

Install and key

cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-zhenzhen

Restart, or ComfyUI Manager → "Comfyui-zhenzhen". API key from ai.t8star.org, pasted into the apikey widget.

The gotcha that actually matters

Google's risk control on the Gemini image models is real, and the README is blunt about it: this model family needs the premium token group to be stable. If your key is on the cheap default group, expect failures and white images, especially at 4K. Fix it on the website - find your token, edit it, add a "gemini优质" (premium) group. That one step is the difference between "this node is broken" and "this node is great." Upstream 500s also happen and re-running is the standard fix. And as with every async relay node: the result downloads into your graph on the poll, your prompts and reference images have left your machine, and the model's moderation is Google's to enforce, not yours to bend.

Categoryzhenzhen/Google

Inputs (24)

NameTypeDefaultDescription
promptSTRING
modeCOMBOtext2img2 options: text2img, img2img
modelCOMBOgemini-3.1-flash-image2 options: gemini-3.1-flash-image, gemini-3.1-flash-lite-image
aspect_ratioCOMBOauto16 options: auto, 16:9, 4:3, 4:5, 3:2, 1:1, +10
image_sizeCOMBO2K3 options: 1K, 2K, 4K
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
image5optIMAGE
image6optIMAGE
image7optIMAGE
image8optIMAGE
image9optIMAGE
image10optIMAGE
image11optIMAGE
image12optIMAGE
image13optIMAGE
image14optIMAGE
apikeyoptSTRING
task_idoptSTRING
response_formatoptCOMBOurl2 options: url, b64_json
seedoptINT00–2147483647
skip_erroroptBOOLEANfalse开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。

Outputs (4)

NameTypeDescription
imageIMAGE
image_urlSTRING
task_idSTRING
responseSTRING