Zhenzhen Gemini 3.1 Flash Image Edit S2A
The cheap-async route with 14 reference images
- image1
- image2
- image3
- image4
- image5
- image6
- image7
- image8
- image9
- image10
- image11
- image12
- image13
- image14
- image
- image_url
- task_id
- response
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 -
text2imgorimg2img. Flip toimg2imgand theimage1–image14inputs become the references to edit. - model -
gemini-3.1-flash-image(default) or the lightergemini-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, or4K. Bigger bills bigger. - aspect_ratio - 13 options from
autothrough 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 -
urlorb64_json, seed, and the pack-standardskip_errorfill 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.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| mode | COMBO | text2img | 2 options: text2img, img2img |
| model | COMBO | gemini-3.1-flash-image | 2 options: gemini-3.1-flash-image, gemini-3.1-flash-lite-image |
| aspect_ratio | COMBO | auto | 16 options: auto, 16:9, 4:3, 4:5, 3:2, 1:1, +10 |
| image_size | COMBO | 2K | 3 options: 1K, 2K, 4K |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| image6opt | IMAGE | — | |
| image7opt | IMAGE | — | |
| image8opt | IMAGE | — | |
| image9opt | IMAGE | — | |
| image10opt | IMAGE | — | |
| image11opt | IMAGE | — | |
| image12opt | IMAGE | — | |
| image13opt | IMAGE | — | |
| image14opt | IMAGE | — | |
| apikeyopt | STRING | — | |
| task_idopt | STRING | — | |
| response_formatopt | COMBO | url | 2 options: url, b64_json |
| seedopt | INT | 00–2147483647 | — |
| skip_erroropt | BOOLEAN | false | 开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_url | STRING | — |
| task_id | STRING | — |
| response | STRING | — |