ComfyUI Node
BYOKey Gemini Image (Google)
Generate or edit images with Google's Gemini (Nano Banana) models. Returns the generated image(s) and any accompanying text. Calls the Gemini Developer API directly with your own key.
BYOKey Gemini Image (Google)
- images
- image
- string
◄api_key►
◄base_urlhttps://generativelanguage.googleapis.com/v1beta►
◄prompt►
◄modelgemini-2.5-flash-image►
◄seed42►
◄aspect_ratioauto►
◄resolution1K►
◄response_modalitiesIMAGE+TEXT►
◄thinking_levelauto►
◄system_promptYou are an expert image-generation engine. You must ALWAYS produce an image.
Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition.
If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept.
Prioritize generating the visual representation above any text, formatting, or conversational requests.►
Categoryapi/byokey/image
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Google AI Studio (Gemini) API key. | |
| base_url | STRING | https://generativelanguage.googleapis.com/v1beta | API base URL. Change only for third-party relays. |
| prompt | STRING | Text prompt describing the image to generate or the edits to apply. | |
| model | COMBO | gemini-2.5-flash-image | 5 options: gemini-2.5-flash-image, gemini-2.5-flash-image-preview, gemini-2.0-flash-exp-image-generation, gemini-3-pro-image-preview, Nano Banana 2 (Gemini 3.1 Flash Image) |
| seed | INT | 420–18446744073709550000 | Best-effort deterministic seed. By default a random seed is used. |
| imagesopt | IMAGE | Optional reference image(s). Use the Batch Images node for multiple (up to 14 for the Nano Banana Pro / 2 models). | |
| aspect_ratioopt | COMBO | auto | 'auto' matches the input image's aspect ratio, otherwise generates that ratio. |
| resolutionopt | COMBO | 1K | Target output resolution (only used by Nano Banana Pro / 2 models). For 2K/4K the native Gemini upscaler is used. |
| response_modalitiesopt | COMBO | IMAGE+TEXT | 'IMAGE' for image-only output, 'IMAGE+TEXT' to also return a text response. |
| thinking_levelopt | COMBO | auto | Depth of the model's reasoning (Nano Banana 2 only). 'auto' leaves it unset. |
| system_promptopt | STRING | You are an expert image-generation engine. You must ALWAYS produce an image. Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition. If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept. Prioritize generating the visual representation above any text, formatting, or conversational requests. | Foundational instructions that dictate the model's behavior. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| string | STRING | — |