Nodes/ComfyUI Gemini Nodes/Unofficial API Call
ComfyUI Node

Unofficial API Call

Run Claude, GPT, or Gemini through one node β€” if you trust the endpoint

By jqy-yoΒ·Created about a year agoΒ·Updated 11 months agoΒ· 7
Unofficial API Call
  • image1
  • image2
  • image3
  • image4
  • image5
  • response
  • image
  • api_request
  • api_response
β—„promptβ€”β–Ί
β—„api_keyβ–Ί
β—„api_formatOpenAI Compatibleβ–Ί
β—„modelclaude-3-5-sonnet-20240620β–Ί
β—„temperature0.70β–Ί
β—„max_tokens1024β–Ί
β—„base_urlhttps://www.chataiapi.com/v1β–Ί
β—„seed0β–Ί
β—„system_promptYou are a helpful assistant.β–Ί
β—„top_p0.95β–Ί
β—„frequency_penalty0.0β–Ί
β—„presence_penalty0.0β–Ί

The node for API relays, mirrors, and gray-market endpoints

Most of this pack talks to Google's official API. This one is for everything else. "Unofficial" here means third-party API relays and proxies - the services that expose OpenAI-compatible or Gemini-native endpoints for models like Claude, GPT, or Gemini without you needing a direct account with the model vendor. It's the node that lets one ComfyUI graph call whatever model a relay happens to serve, complete with image inputs and even image output.

It exists because the ecosystem is full of these aggregators, especially in regions where official API access is awkward. But let's be clear about the trade: an "unofficial" endpoint is a third party standing between you and the model, and it gets your key and your prompts.

How it works

The api_format dropdown switches the entire request format:

  • OpenAI Compatible - builds a /chat/completions call. This is the format most relays speak, and it's how you reach Claude, GPT, and OpenAI-style models. base_url is the relay's endpoint (default https://www.chataiapi.com/v1), model is whatever the relay calls the model (default claude-3-5-sonnet-20240620).
  • Gemini Native - builds a Gemini-format request to a relay that mirrors Google's API, with automatic image extraction from the response. This is the path to Gemini-native image generation through a relay - e.g. a gemini-2.5-flash-image-preview model returning an actual image, which the node extracts into the image output.

Up to five image1–image5 inputs feed multimodal requests in either format, and the standard temperature, top_p, max_tokens, plus frequency_penalty / presence_penalty dials all pass through.

Inputs you'll set

  • api_key - the relay's key, not Google's. This is what you're buying from the aggregator.
  • api_format - OpenAI Compatible vs. Gemini Native; get this wrong and nothing works.
  • base_url - the relay endpoint. Swap in your provider's URL.
  • model - the model name as the relay lists it.
  • image1–image5 - for vision or image-gen via the relay.

Outputs: response (text), image (an IMAGE - populated when the Gemini Native relay returns an image), and the standard api_request / api_response debug dumps, which matter double here because you're debugging someone else's API contract.

Install

Same pack, same steps:

cd ComfyUI/custom_nodes
git clone https://github.com/jqy-yo/comfyui-gemini-nodes
cd comfyui-gemini-nodes
pip install -r requirements.txt

Or "ComfyUI Gemini Nodes" via ComfyUI Manager, restart.

Where people get burned

Biggest one is trust. The ComfyUI ecosystem has a documented history of malicious custom nodes, and an "unofficial API" node pointed at an arbitrary relay is a lot of surface - you're handing a key and your prompts to a third party, and the README's default base_url is just the author's example provider, not an endorsement. Only use relays you actually know. Technically, the failure modes are format mismatches: an OpenAI-compatible endpoint hit with Gemini Native format (or a wrong model name) fails instantly, and the api_request output is where you'll see it. Some relays also throttle or censor heavily. If you have official access to the models you need, the pack's other nodes are simpler and safer - this one is specifically for when you don't.

CategoryπŸ€– Gemini/Unofficial

Inputs (17)

NameTypeDefaultDescription
promptSTRINGβ€”
api_keySTRINGβ€”
api_formatCOMBOOpenAI Compatible2 options: OpenAI Compatible, Gemini Native
modelSTRINGclaude-3-5-sonnet-20240620β€”
temperatureFLOAT0.700–1β€”
max_tokensINT102464–8192β€”
base_urlSTRINGhttps://www.chataiapi.com/v1β€”
seedINT00–2147483647β€”
system_promptoptSTRINGYou are a helpful assistant.β€”
image1optIMAGEβ€”
image2optIMAGEβ€”
image3optIMAGEβ€”
image4optIMAGEβ€”
image5optIMAGEβ€”
top_poptFLOAT0.950–1β€”
frequency_penaltyoptFLOAT0.0-2–2β€”
presence_penaltyoptFLOAT0.0-2–2β€”

Outputs (4)

NameTypeDescription
responseSTRINGβ€”
imageIMAGEβ€”
api_requestSTRINGβ€”
api_responseSTRINGβ€”