comfyui-FOK_API_tools
ComfyUI custom nodes for calling text and vision LLM APIs through multiple provider-compatible request protocols supporting OpenAI, Anthropic, and Gemini formats.
comfyui-FOK_API_tools
ComfyUI custom nodes for calling text and vision LLM APIs through multiple provider-compatible request protocols.
Nodes
FOK Multi-Protocol Chat Vision API
Sends a prompt and up to four images to an API endpoint, then returns the response text and debug info.
Supported protocol formats:
openai_chat_completionsopenai_responsesanthropic_messagesgemini_generatecontent
This is useful when an API service expects one of these provider-compatible request formats.
Installation
Place this folder under:
ComfyUI/custom_nodes/comfyui-FOK_API_tools
Restart ComfyUI. The node should appear under:
FOK API Tools/API
API Key
Do not put API keys directly into ComfyUI workflows. Workflow files can be exported or shared, so direct key inputs are intentionally not provided.
Create a local key file in this node directory:
api_key.txt
Put only the API key in that file.
An empty example file is included:
api_key.txt.example
The node input api_key_file only accepts a file name in this node directory. Absolute paths and parent directory paths are rejected.
Basic Usage
- Add
FOK Multi-Protocol Chat Vision API. - Select
api_protocol. - Set
model. - Set
api_base_url. - Connect
prompt. - Optionally connect up to four images.
- Put your API key in
api_key.txt.
Protocol URLs
The node appends the protocol endpoint to api_base_url:
| Protocol | Endpoint |
| --- | --- |
| openai_chat_completions | /chat/completions |
| openai_responses | /responses |
| anthropic_messages | /messages |
| gemini_generatecontent | /models/{model}:generateContent |
For Gemini, api_base_url can also be a full URL ending with :generateContent, or can contain {model} as a placeholder.
The node sends provider-compatible JSON bodies and image payloads as base64 PNG data.
Error Handling
on_error controls failure behavior:
skip: return the original prompt.stop: block downstream execution when ComfyUI supportsExecutionBlocker.raise: raise the error and stop execution.
Debug Info
The second output returns debug JSON with request and response metadata. Authentication headers are redacted:
Authorizationx-api-keyx-goog-api-key
Large payloads may be omitted from debug output to avoid dumping base64 image data.