Nodes/Comfyui-General-API-Node/General API Node v1.0.7 (FeiMao-326)
ComfyUI Node

General API Node v1.0.7 (FeiMao-326)

Ollama, OpenAI, Gemini, DeepSeek, all of it

By FeiMao-326·Created 12 months ago·Updated 5 months ago· 0
General API Node v1.0.7 (FeiMao-326)
  • image_1
  • image_2
  • image_3
  • describe
  • seed
  • image
api_baseurlhttp://127.0.0.1:11434/v1
api_keyollama
modelgemma4:e4b
roleYou are a helpful assistant. Follow the user's instructions exactly. Output only the requested content without conversational filler, markdown formatting, or explanations.
promptDescribe this image in detail.
seed0
temperature0.60
max_tokens4096
control_after_generate
cleanup_local_gputrue
system_proxy
force_json_formatfalse

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:

  • prompt and role - 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:7890 for 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 posts keep_alive: 0 to unload the model from VRAM after the call, with an ollama stop CLI fallback, then clears the PyTorch cache.
  • seed / control_after_generate - to actually vary seeds, wire the seed output back into the seed input and set the mode to increment or randomize.

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.

CategoryFeiMao-326

Inputs (15)

NameTypeDefaultDescription
api_baseurlSTRINGhttp://127.0.0.1:11434/v1
api_keySTRINGollama
modelSTRINGgemma4:e4b
roleSTRINGYou are a helpful assistant. Follow the user's instructions exactly. Output only the requested content without conversational filler, markdown formatting, or explanations.
promptSTRINGDescribe this image in detail.
seedINT00–18446744073709550000
temperatureFLOAT0.600–2
max_tokensINT409664–131072
control_after_generateCOMBO4 options: fixed, increment, decrement, randomize
cleanup_local_gpuBOOLEANtrue
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
system_proxyoptSTRING
force_json_formatoptBOOLEANfalse

Outputs (3)

NameTypeDescription
describeSTRING
seedINT
imageIMAGE