Nodes/RUI-Nodes/ZenMux API 连接 / ZenMux API Connector
ComfyUI Node

ZenMux API 连接 / ZenMux API Connector

One key to 130+ LLMs, from Claude to DeepSeek, priced in the dropdown

By rui40000·Created 3 years ago·Updated about 8 hours ago· 17
ZenMux API 连接 / ZenMux API Connector
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • text
  • model_id
  • usage_stats
api_key
modelopenai/gpt-5.4-nano [入$0.2/M 出$1.25/M]
system_promptYou are a helpful assistant.
user_prompt
seed0
temperature0.7
top_p1.00
max_tokens1024
detailauto
image_max_size1024
base_urlzenmux.ai/api/v1
proxy_url
max_retries3
timeout180
usd_to_cny7.20

You don't need one node per LLM provider. ZenMux API 连接 / ZenMux API Connector is a single ComfyUI node for the ZenMux aggregator (zenmux.ai), which routes ~20 vendors - Anthropic, OpenAI, Google, DeepSeek, Qwen and friends - through one OpenAI-compatible endpoint. 138 models in the dropdown, and every single option carries its price in the label: anthropic/claude-sonnet-5 [入$2/M 出$10/M]. It's the most practical way to A/B the whole model landscape from inside a workflow without a stack of API keys and a stack of custom nodes.

That price-in-the-label detail is the killer feature, honestly. Picking a model becomes a budget decision you can read at a glance, and the list is sorted by vendor so the search box filters fast - type anthropic/ or qwen/ and the noise disappears.

How the model list works

Unlike the pack's YueGuang node, ZenMux's catalog comes from a bundled snapshot, zenmux/models_snapshot.json, so it stays current without a network fetch at runtime. When prices move, you refresh it yourself:

cd ComfyUI/custom_nodes/RUI-Nodes
python zenmux/build_snapshot.py

Old workflows survive updates: the node parses the model id out of a saved price-stamped label even when the price text no longer matches exactly, and VALIDATE_INPUTS is deliberately lenient so a stale label doesn't brick a whole graph.

Inputs and outputs

  • api_key - ZenMux key. It saves into the workflow JSON, so scrub it before sharing files.
  • model - default openai/gpt-5.4-nano, price-tagged and vendor-prefixed. Pick a vision-capable model if you plan to send images - otherwise they're silently ignored.
  • system_prompt / user_prompt - role vs. ask; keep format rules in the system prompt.
  • seed - realistically a re-run trigger; most of these models don't honor reproducibility anyway.

Optional: temperature (0.7), top_p (leave at 1.0), max_tokens (1024 - this is also your cost ceiling), image_1image_6, detail (low/auto/high), image_max_size (default 1024; smaller = cheaper and faster), base_url (default zenmux.ai/api/v1, no :// - the frontend eats the protocol and the backend re-adds it), proxy_url (127.0.0.1:7890 style), usd_to_cny (display only).

Outputs: text, model_id (the real id, e.g. openai/gpt-5.4-nano, for downstream logging), and usage_stats - a four-line per-run report of tokens in/out, output character count, model + unit prices, and the USD/CNY cost conversion.

The retry magic

New models are fickle about sampling params. Some deprecate temperature outright; gpt-5 reasoning models insist on max_completion_tokens instead of max_tokens. Rather than making you chase per-model settings, the node catches the 400, strips or renames the offending parameter, and retries automatically. It logs the fix to the ComfyUI console - worth a glance if a call ever behaves unexpectedly, and it costs nothing on healthy requests.

Versus the YueGuang node

Same interface, same outputs, swappable. The differences that matter: ZenMux has the bigger catalog (138 vs 25 models) with vendor-prefixed ids and an online-refreshable snapshot; YueGuang keeps its list built-in and offline. If you're already on one aggregator, the other is one node swap away - which is honestly how this pack likes to do things.

CategoryRui-Node🐶/AI模型🤖

Inputs (21)

NameTypeDefaultDescription
api_keySTRINGZenMux 的 API Key。 ⚠ 工作流会连同此值一起保存,分享 json 前记得清空。
modelCOMBOopenai/gpt-5.4-nano [入$0.2/M 出$1.25/M]模型,标签里直接带了输入/输出单价。 列表按厂商聚类排序——在下拉的搜索框输入厂商前缀 (如 qwen/ 、anthropic/ )即可快速过滤。 要传图请选支持视觉的型号,否则图会被忽略。
system_promptSTRINGYou are a helpful assistant.系统提示词:设定模型的角色与总体行为准则。 输出格式要求(如「只返回 JSON」)写在这里最稳定。
user_promptSTRING用户提示词:这一次具体要模型做什么。
seedINT00–18446744073709550000随机种子。多数模型并不真正支持复现, 这里主要用于强制节点重新执行(改了它就不会走缓存)。
temperatureoptFLOAT0.70–2采样温度:越低越稳定保守,越高越发散。 结构化输出用 0~0.3,创意文案用 0.7~1.0。 部分新模型已弃用该参数,节点会自动重试并剔除它。
top_poptFLOAT1.000–1核采样:只在累计概率前 top_p 的词里挑。 与温度作用重叠,一般固定 1.0 只调温度,别两个一起动。
max_tokensoptINT10241–200000回复的最大长度上限。设小了会把回答从中间截断。 注意它同时是费用上限的重要因素。
image_1optIMAGE要一并发给模型的图像 1(需模型支持视觉)。 会按下方最大边长压缩后转 base64 提交。
image_2optIMAGE图像 2。
image_3optIMAGE图像 3。
image_4optIMAGE图像 4。
image_5optIMAGE图像 5。
image_6optIMAGE图像 6。图越多越贵、越慢。
detailoptCOMBOauto图像细节级别: low 便宜快速,只看大致内容; high 切块细看,认小字/细节更准但更贵; auto 由服务端决定。
image_max_sizeoptINT1024256–4096上传前把图缩放到的最大边长。 调小可显著省钱提速,但小字与细节会看不清。
base_urloptSTRINGzenmux.ai/api/v1接口地址,一般不用改。 **不要写 https://** —— ComfyUI 前端会吞掉 "://", 协议由后端自动补全,这里只填域名和路径。
proxy_urloptSTRINGHTTP 代理,同样不要带协议前缀,只填 IP:端口, 例如 127.0.0.1:7890。留空表示直连。
max_retriesoptINT30–10网络失败后的自动重连次数,0 表示不重连。 会触发重连的情况:SSL 握手被打断 (SSLEOFError)、连接被重置、读超时、响应体 截断,以及 429 限流和 5xx 服务端临时故障。 不会重连的情况:参数类 400、鉴权类 401/403 —— 这些重试多少次都是同样的结果。 退避按 1s→2s→4s 指数增长并带随机抖动,避免 多个节点同时重连再次压垮服务端;服务端给了 Retry-After 时以它为准。
timeoutoptINT18010–1800单次请求的超时秒数。 长文本或多图推理较慢时可调大。 超时会计入上面的重连次数。
usd_to_cnyoptFLOAT7.200.1–100美元兑人民币汇率,仅用于把 usage_stats 输出里的 费用换算成人民币显示,不影响实际计费。 可按当日牌价自行调整。

Outputs (3)

NameTypeDescription
textSTRING
model_idSTRING
usage_statsSTRING