General API Node v1.0.7 (FeiMao-326)
Ollama, OpenAI, Gemini, DeepSeek, all of it
- image_1
- image_2
- image_3
- describe
- seed
- image
If you've ever wanted a language model inside your ComfyUI graph - generating prompts, describing images, writing captions, acting as a router - this is the node. It's the heart of the FeiMao-326 utility pack, and it does something most of its competitors don't: it speaks to essentially every LLM backend using one OpenAI-compatible interface. Your local Ollama instance, LM Studio, a remote GPT-5-style API, DeepSeek, Qwen, Groq, even Google Gemini's native endpoint - same node, different three fields.
How it works
Under the hood it's an OpenAI SDK client wearing a ComfyUI costume. You give it an api_baseurl (where the API lives), an api_key, and a model, and it fires a chat completion with your role as the system prompt and your prompt as the user message. The defaults are pointed at local Ollama (http://127.0.0.1:11434/v1, key ollama, model gemma4:e4b), so if you have Ollama running, the thing basically works the moment you add it. No key, no cloud, no setup.
The clever part is what it does beyond that. It's genuinely multimodal: connect image_1 (and image_2, image_3, which appear dynamically as you wire things in) and it base64-encodes the frames and drops them into the request as data URLs, so vision models like qwen-vl-plus or llava can describe what's on screen. Give it a model name containing image- on a Gemini URL and it switches to the image-generation REST endpoint, returning an actual IMAGE from the image output instead of text. force_json_format adds a response_format: json_object to the call, which is how you get clean structured output for the JSON Parser downstream.
The inputs that matter
A few worth your attention:
promptandrole- your message and the system prompt. The default role is deliberately strict: it tells the model to output only the requested content, no "Sure, here's your JSON" chatter.system_proxy- set this to your local proxy (e.g.http://127.0.0.1:7890for Clash) when Python can't reach a foreign API but your browser can. Leave it blank for local Ollama and for domestic APIs.cleanup_local_gpu- on by default. For Ollama it postskeep_alive: 0to unload the model from VRAM after the call, with anollama stopCLI fallback, then clears the PyTorch cache.seed/control_after_generate- to actually vary seeds, wire theseedoutput back into theseedinput and set the mode toincrementorrandomize.
The three outputs are describe (the text reply), seed (the next seed, for the loop trick), and image (only populated on image-gen branches).
Installing it
This ships in the FeiMao-326 pack, so either ComfyUI Manager (search "Comfyui-General-API-Node") or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/FeiMao-326/Comfyui-General-API-Node.git
cd Comfyui-General-API-Node
pip install -r requirements.txt
Restart ComfyUI after that. Dependencies are light - just openai, numpy, Pillow, requests - and there are zero model downloads.
Where people get burned
The most common failure is the openai library missing, which the node itself tells you about in the describe output - run the pip install above. Second is context length: a huge image will trip token limits, and the node helpfully appends a hint about reducing resolution when it catches a token error. If you get an "invalid"/"variant" error while images are connected, your model probably isn't vision-capable; switch to something like llava.
One honest gotcha: system_proxy relies on httpx, which is not in requirements.txt. If proxy mode silently fails, pip install httpx fixes it. And Gemini's OpenAI-compatibility layer ignores the seed parameter, so don't expect deterministic seeds there. The Ollama VRAM cleanup exists because Ollama famously holds models in memory after a call - if it ever misbehaves, OLLAMA_KEEP_ALIVE=0 as an environment variable is the same idea applied globally.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| api_baseurl | STRING | http://127.0.0.1:11434/v1 | — |
| api_key | STRING | ollama | — |
| model | STRING | gemma4:e4b | — |
| role | STRING | You are a helpful assistant. Follow the user's instructions exactly. Output only the requested content without conversational filler, markdown formatting, or explanations. | — |
| prompt | STRING | Describe this image in detail. | — |
| seed | INT | 00–18446744073709550000 | — |
| temperature | FLOAT | 0.600–2 | — |
| max_tokens | INT | 409664–131072 | — |
| control_after_generate | COMBO | 4 options: fixed, increment, decrement, randomize | |
| cleanup_local_gpu | BOOLEAN | true | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| system_proxyopt | STRING | — | |
| force_json_formatopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| describe | STRING | — |
| seed | INT | — |
| image | IMAGE | — |