ComfyUI Extension: rota_do_imperador-openrouter-single-node-public
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.
ComfyUI custom node for OpenRouter chat completions with vision input, reasoning effort selection, and JSON extraction. (Description by CC)
Looking for a different extension?
Custom Nodes (0)
README
openrouter-comfy-node
ComfyUI custom node for OpenRouter chat completions with:
- OpenRouter-only routing (Groq removed)
- Vision input from real ComfyUI
IMAGEtensors (single image or batch) - Reasoning effort selection (
none,low,minimal,medium,high,xhigh) - Robust JSON extraction from responses
Node key:
ArrakisOpenRouterNode- Display name:
Arrakis OpenRouter (Vision + Reasoning)
Inputs
Required:
api_key: OpenRouter API key- You can pass the literal token or an environment variable reference, e.g.
$OPENROUTER_TOKENor${OPENROUTER_TOKEN}
- You can pass the literal token or an environment variable reference, e.g.
system_prompt: Instruction prompt (default enforces JSON-only output)user_prompt: Main user promptuser_image: OptionalIMAGEinput (connect image node directly)- Single image: sends one
image_urlmessage - Batch image: sends one
image_urlmessage per image in the batch - Images are encoded internally as
data:image/png;base64,...
- Single image: sends one
reasoning_level:none,low(default),minimal,medium,high, orxhighmax_tokens: default0(unlimited / omit from payload)model: Defaultx-ai/grok-4.1-fast
Optional:
custom_parameters: Raw JSON merged into request body (except reserved fields)timeout: Request timeout in secondsmax_retries: Retry attempts for retryable errorsenforce_json_output: Injects a strict JSON-only suffix into the system message (default:true)
Message Order
The node builds request messages in this order:
systemmessageusermessage(s) fromuser_prompt- image parts from
user_imageare appended to the same finalusermessage content array (after text) - extra messages from
custom_parameters.messages(if provided)
This keeps prompt text before image context and matches OpenRouter multimodal guidance.
Reasoning
By default, requests include:
"reasoning": {
"effort": "low"
}
You can override via reasoning_level or fully override using custom_parameters.reasoning.
If reasoning_level is none, the node omits the reasoning field from the payload.
Example custom_parameters
{
"response_format": {
"type": "json_object"
}
}
Notes
max_tokensfromcustom_parametersis ignored; use the dedicatedmax_tokensinput.- No dedicated inputs for
temperature,top_p,top_k, etc. If needed, pass them viacustom_parameters. - For strict structure, prefer
response_formatwith JSON schema incustom_parameters. - Non-supported parameters may be ignored by model/provider routing.
- For IMAGE batches, the node samples at most 3 frames (first, middle, last).
- Images over 1 MP are resized before encoding to reduce payload size and cost.
- This repository contains a ComfyUI Python custom node. It is not a standalone Node.js app.
Running
python __init__.pynow prints a local smoke-test status to help diagnostics. - The node now includes a
seedinput. Keep the same value to reuse cache when inputs are unchanged, or changeseedto force a fresh API call.
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.