Nodes/ComfyUI-ZML-Image/HTTP 通用请求
ComfyUI Node

HTTP 通用请求

A full HTTP client inside your graph — no API key required

By zml-w·Created about a year ago·Updated 2 months ago· 218
HTTP 通用请求
  • image_input
  • vars_workflow
  • vars_browser
  • 响应文本
  • 响应图像
  • 状态码
methodPOST
urlhttps://api.example.com
headers请求头
body请求体(图像变量为{{IMAGE_B64}})
timeout30

The pack's HTTP corner is modeled on n8n - the author says the request node is about 80% n8n's UI. What that gives you is a generic HTTP client that can call any REST endpoint from inside a workflow: hit a local Stable Diffusion server, ping an LLM API, POST an image to a background-removal service, poll a queue. The name is a bit of a lie in the best way - despite the "HTTP" branding it's not tied to any one vendor, needs no API key of its own, and will happily talk to whatever you point it at.

How it works

It's a small template engine over a real HTTP call. You fill in method, url, headers, body, and timeout, and the node makes the request using requests (with aiohttp-style async under the hood in the pack). The engine part is the interesting bit: anywhere in the URL or body you can write {{KEY}} and it gets substituted at runtime from a merged variable pool. That pool comes from:

  • the optional vars_workflow input (a ZML_HTTP_Vars_Workflow node, keys A–G),
  • the optional vars_browser input (a ZML_HTTP_Vars_Browser node, arbitrary keys),
  • the special image_input socket, which auto-converts your image to a Base64 PNG string and exposes it as {{IMAGE_B64}} in the body.

So {"image": "{{IMAGE_B64}}", "prompt": "{{A}}"} becomes a real payload at execution time. For POST/PUT/PATCH it sniffs whether the body parses as JSON and sends it as JSON with the right content type; otherwise it sends the raw string.

The inputs

  • method - GET / POST / PUT / DELETE / PATCH.
  • url - the endpoint; supports {{KEY}} substitution.
  • headers - one Key: Value per line, also template-substituted.
  • body - the payload; {{IMAGE_B64}} for your image.
  • timeout - 1–300 seconds, default 30.

Outputs: 响应文本 (STRING), 响应图像 (IMAGE - decoded automatically if the response is an image), and 状态码 (INT).

Installing

Standard pack:

cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image

restart or ComfyUI Manager. Uses requests/aiohttp, both in the pack's requirements.txt and near-universally present. Translation patch at https://github.com/zml-w/ZZZ_ZML_English_Patch.

Common issues

Where people get burned: the response image output only works if the server actually returns image bytes - an API that returns JSON with a URL inside won't fill it, and you'll need a separate download step. And the security frame from the KB's API-node docs applies hard here: this is a node whose whole job is to send your data somewhere, which is exactly the shape of thing that gets weaponized. Only point it at endpoints you trust, and remember that {{IMAGE_B64}} ships your image to whatever URL you type. Debugging tip: wire 状态码 and 响应文本 to a text view node first; a 400 with the body showing is worth more than any guessing.

Categoryimage/ZML_图像/HTTP

Inputs (8)

NameTypeDefaultDescription
methodCOMBOPOST5 options: GET, POST, PUT, DELETE, PATCH
urlSTRINGhttps://api.example.com
headersSTRING请求头
bodySTRING请求体(图像变量为{{IMAGE_B64}})
timeoutINT301–300
image_inputoptIMAGE输入图像,将自动转换为Base64格式,可在请求中使用{{IMAGE_B64}}变量引用
vars_workflowoptHTTP_VARS连接【工作流变量】节点 (A-G)
vars_browseroptHTTP_VARS连接【浏览器变量】节点 (自定义Keys)

Outputs (3)

NameTypeDescription
响应文本STRING
响应图像IMAGE
状态码INT