Nodes/ComfyUI Assistant Node/PVL Gemini with fallback Api
ComfyUI Node

PVL Gemini with fallback Api

Gemini first, GPT as the safety net — a text node that survives outages

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Gemini with fallback Api
  • image
  • text
modelgemini-2.5-flash
thinking_leveloff
tries2
timeout45
temperature1.00
top_p0.95
top_k65
batch1
delimiter[++]
append_variation_tagfalse
debugfalse
instructions
prompt
seed0
api_key
openai_fallbackfalse
force_openaifalse
openai_modelGPT-5 mini
openai_api_key

If your workflow depends on an LLM call in the middle of a generation queue, you learn fast that "Gemini is down" is not a hypothetical. This node is the insurance policy: it runs the pack's Gemini engine, and when a call fails - rate limit, timeout, safety block - it hands that item to OpenAI and keeps going. One node, two providers, and a queue that doesn't die at 2am because one vendor hiccuped.

It's the newer sibling of the pack's PVL Gemini API, and the practical differences are what you'd expect from an API that moved on: the model dropdown leads with the Gemini 3 previews (gemini-3-pro-preview, gemini-3-flash-preview) and adds a thinking_level selector - off, minimal, low, medium, high - that controls how much reasoning the model does before answering. More thinking is slower and pricier and often better on complex instructions.

How it works

Same engine as the rest of the Gemini family: parallel batch calls to generativelanguage.googleapis.com, selective retries with linear backoff, results joined by delimiter. The addition is the fallback path. With openai_fallback on, any item that still fails after its Gemini retries gets re-submitted to api.openai.com with the model you picked in openai_model (default GPT-5 mini). force_openai skips Gemini entirely - useful if you're A/B testing or your Gemini quota is spent for the month.

The fallback is failure-driven, not load-balanced: Gemini stays the primary until it errors. If you want the fallback to not engage - say you'd rather fail loudly than mix providers silently - leave openai_fallback off and this behaves like a fancier PVL Gemini API.

The inputs that matter

  • model and thinking_level - the new-generation controls. Default gemini-2.5-flash with thinking off is the fast/cheap baseline; bump thinking_level when answers are shallow.
  • openai_fallback, force_openai, openai_model, openai_api_key - the resilience block. Set openai_api_key or export OPENAI_API_KEY.
  • batch, delimiter, append_variation_tag - the parallel-variation machinery from the base node.
  • prompt, instructions, optional image, api_key - the payload and key (blank api_key = GEMINI_API_KEY).
  • tries, timeout, temperature, top_p, top_k, seed, debug.

Output: one text string.

Installing it

Same pack, same drill:

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

Restart, export GEMINI_API_KEY and OPENAI_API_KEY (or fill the fields). No downloads.

Common issues

Two failure-mode subtleties. First, the fallback only rescues failures - a Gemini call that returns a confidently wrong answer doesn't trigger OpenAI, it just returns bad text. Don't mistake this node for quality assurance. Second, if both openai_fallback and force_openai are off, a failed batch raises like any plain node - the fallback is opt-in, so a workflow that worked in testing can still die in production if you never flipped the toggle. Also worth knowing: thinking_level values map differently across the model list (the Multi variant even offers numeric 04 forms), so a setting that works on one model may be ignored on another. And the usual: every call bills someone, and with a fallback engaged, potentially two someones.

CategoryPVL/LLM

Inputs (20)

NameTypeDefaultDescription
modelCOMBOgemini-2.5-flash5 options: gemini-3-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite
thinking_levelCOMBOoff5 options: off, minimal, low, medium, high
triesINT21–10
timeoutINT451–600
temperatureFLOAT1.000–2
top_pFLOAT0.950–1
top_kINT651–1000
batchINT11–64
delimiterSTRING[++]
append_variation_tagBOOLEANfalse
debugBOOLEANfalse
instructionsSTRING
promptSTRING
seedINT0
imageoptIMAGE
api_keyoptSTRING
openai_fallbackoptBOOLEANfalse
force_openaioptBOOLEANfalse
openai_modeloptCOMBOGPT-5 mini4 options: GPT-5.1, GPT-5 pro, GPT-5 mini, GPT-5 nano
openai_api_keyoptSTRING

Outputs (1)

NameTypeDescription
textSTRING