LayerUtility: Gemini(Advance)
Gemini — Google's API for prompt writing, without leaving your graph
- image_1
- image_2
- text
This one's not a local model - it's a thin wrapper around Google's Gemini API, and it's here because a lot of ComfyUI workflows want an LLM step (expand a rough idea into a full prompt, describe a reference image, rewrite something for a target style) without pulling in a multi-gigabyte local model just for text. You bring your own API key, the node calls Google, and text comes back into your graph.
The node handles both text-only and vision use: image_1 and image_2 are optional inputs, and if you wire one in, you're expected to reference it in your user_prompt (the README's own phrasing: "explain the purpose of image_1 in user_prompt") since the node doesn't automatically know what role each image plays. model picks which Gemini model handles the request - you get a handful of options spanning the 1.5 line (gemini-1.5-flash, gemini-1.5-pro, gemini-1.5-flash-8b) plus gemini-2.0-flash-exp and an experimental learnlm-1.5-pro-experimental variant. system_prompt sets the model's role (it defaults to framing itself as writing Stable-Diffusion prompts, which tells you what this node was originally built for), and user_prompt is your actual instruction - the default example is literally "Generate a prompt about a girl," which is a reasonable placeholder to understand what this node expects. max_output_tokens, temperature, and words_limit control length and creativity of the response; response_language lets you force English or Chinese output. Output is text.
Getting this running needs one extra step beyond the usual install: an API key. Apply for one at Google AI Studio, then find api_key.ini.example in the plugin's root directory, rename it to api_key.ini, open it in a text editor, and fill in your key after google_api_key=. Skip that step and the node has nothing to authenticate with - it's not a missing-model problem, it's a missing-credentials problem, and it won't show up as a broken install, just as failed API calls.
Install the pack itself through ComfyUI Manager (search "ComfyUI Layer Style Advance") or git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance into custom_nodes/, restart, run the requirements installer. There's no model download for this node specifically - it's pure API glue, so the dependency footprint is small compared to the local-model nodes in this pack.
Where this actually breaks: if you're in a region where Google's endpoints aren't reachable directly (the README specifically flags mainland China as an example), you'll see requests.exceptions.ProxyError or plain connection failures - that's a network-routing problem, not something to debug in the node itself. If instead you're getting authentication errors, double check the api_key.ini file actually has the .ini extension and not .ini.example still, and that there's no stray whitespace around the key. It's also worth knowing this node was chflame163's first Gemini wrapper - a newer GeminiV2 node exists in the wider LayerStyle Advance pack using Google's updated google-genai package with support for more recent models (2.0-flash-lite, 2.5-pro-exp); if you specifically need the newest Gemini models, that's the one to reach for instead.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | 5 options: gemini-1.5-flash, gemini-1.5-pro, gemini-1.5-flash-8b, gemini-2.0-flash-exp, learnlm-1.5-pro-experimental | |
| max_output_tokens | INT | 40961–8192 | — |
| temperature | FLOAT | 0.50–2 | — |
| words_limit | INT | 2008–2048 | — |
| response_language | COMBO | 2 options: en, zh-CN | |
| system_prompt | STRING | You are creating a prompt for Stable Diffusion to generate an image. | — |
| user_prompt | STRING | Generate a prompt about a girl. | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |