LayerUtility: Gemini V2(Advance)
Gemini V2 — the updated Gemini wrapper, newer models and a seed
- image_1
- image_2
- text
This is the pack's original Gemini node rebuilt on Google's newer google-genai package, which is what unlocks a more current model list. Same underlying idea as the whole API-node family in this pack: no local model, no VRAM cost, just a network call so your graph can get an LLM text step - expanding a rough idea into a full prompt, describing an image, rewriting for a target style - without pulling in gigabytes of local weights.
The inputs and outputs that matter
model- three choices:gemini-2.0-flash-lite,gemini-2.0-flash, andgemini-2.5-pro-exp-03-25. If you specifically need the newest models Google's offered, this is the node to reach for over the originalGemini, which is stuck on the 1.5 line andgemini-2.0-flash-exp.image_1/image_2(optional) - wire in a reference image for vision use; since the node doesn't automatically know what role an image plays, describe its purpose directly inuser_prompt(the same convention as the originalGemininode).system_prompt- defaults to framing itself as writing a Stable Diffusion prompt, which tells you what this node was built around, even though nothing stops you from overriding it for other text tasks.user_prompt- your actual instruction.max_output_tokens(default 4096),temperature(default 0.5),words_limit(default 200) - length and creativity controls.response_language-enorzh-CN, to force the reply language.seed- new in V2. Sent along with the request to Google's API; useful if you want more reproducible output across otherwise-identical calls, though a text API's determinism is never guaranteed the way a diffusion sampler's is.
Output is text.
How to install it
Recommended: ComfyUI Manager, search "ComfyUI Layer Style Advance". Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git
Then install_requirements.bat / install_requirements_aki.bat, or pip install -r requirements.txt plus repair_dependency.bat. Restart. No model download here - it's API glue, though pulling in the newer google-genai package is part of what the requirements install handles.
API key: apply at Google AI Studio, then find api_key.ini.example in the plugin's root directory, rename it to api_key.ini, and fill in your key after google_api_key=. This same key covers every Gemini node in the pack - Gemini, GeminiV2, GeminiImageEdit, and PromptEmbellish all read from it.
Common issues & troubleshooting
Authentication errors. Double-check api_key.ini actually has the .ini extension (not still .ini.example), and that there's no stray whitespace around the key itself.
Connection failures, ProxyError, or requests that just hang. The README specifically flags mainland China as a region where Google's endpoints aren't directly reachable - that's a network-routing problem, not a node bug. If you're in an affected region, you'll need a working proxy or VPN for this node to function at all.
Response feels heavily filtered, refuses, or comes back generic. Google's Gemini stack applies its own content-safety filtering server-side, and it's tightened over time - that's outside this node's control. If you're hitting refusals on borderline prompts, that's the API declining the request, not an error to debug locally.
Not sure whether to use this or the plain Gemini node. Use V2 unless something specific in your workflow was already built around the older 1.5-line models - there's no reason to prefer the older node for a new build.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | 3 options: gemini-2.0-flash-lite, gemini-2.0-flash, gemini-2.5-pro-exp-03-25 | |
| max_output_tokens | INT | 40961–8192 | — |
| temperature | FLOAT | 0.50–2 | — |
| words_limit | INT | 2008–2048 | — |
| response_language | COMBO | 2 options: en, zh-CN | |
| seed | INT | 00–2147483647 | — |
| 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 | — |