Unofficial API Call
Run Claude, GPT, or Gemini through one node β if you trust the endpoint
- image1
- image2
- image3
- image4
- image5
- response
- image
- api_request
- api_response
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/completionscall. This is the format most relays speak, and it's how you reach Claude, GPT, and OpenAI-style models.base_urlis the relay's endpoint (defaulthttps://www.chataiapi.com/v1),modelis whatever the relay calls the model (defaultclaude-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-previewmodel returning an actual image, which the node extracts into theimageoutput.
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.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | β | |
| api_key | STRING | β | |
| api_format | COMBO | OpenAI Compatible | 2 options: OpenAI Compatible, Gemini Native |
| model | STRING | claude-3-5-sonnet-20240620 | β |
| temperature | FLOAT | 0.700β1 | β |
| max_tokens | INT | 102464β8192 | β |
| base_url | STRING | https://www.chataiapi.com/v1 | β |
| seed | INT | 00β2147483647 | β |
| system_promptopt | STRING | You are a helpful assistant. | β |
| image1opt | IMAGE | β | |
| image2opt | IMAGE | β | |
| image3opt | IMAGE | β | |
| image4opt | IMAGE | β | |
| image5opt | IMAGE | β | |
| top_popt | FLOAT | 0.950β1 | β |
| frequency_penaltyopt | FLOAT | 0.0-2β2 | β |
| presence_penaltyopt | FLOAT | 0.0-2β2 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| response | STRING | β |
| image | IMAGE | β |
| api_request | STRING | β |
| api_response | STRING | β |