ComfyUI Node

Post Request Node

Send JSON to any endpoint without leaving ComfyUI

By ahkimkoo·Created 3 months ago·Updated 3 months ago· 1
Post Request Node
  • headers
  • text
  • file
  • json
  • any
target_urlhttps://example.com/api
request_body{}
str0
str1
str2
str3
str4
str5
str6
str7
str8
str9

The Post Request Node is the "send some JSON and get an answer" workhorse of this pack. You type a URL, type a request body, and it fires a POST with Content-Type: application/json, then hands back the response as text, bytes, and parsed JSON. It's the node you use when your pipeline has to talk to your own server, a local tool like an RVC voice-conversion service, or any API that expects a JSON payload.

It's part of ComfyUI-HttpRequestNodes, ahkimkoo's fork of felixszeto's ComfyUI-RequestNodes. Think of the whole pack as HTTP plumbing: it doesn't run models or hold keys, it just moves data in and out of your graph. This node handles the plain-JSON case; the same pack has a Binary Post Request Node for raw audio/video bytes and a Rest Api Node if you need every method plus retries.

What you actually set

Only two inputs are required: target_url and request_body (a multiline text box, default {}). The body is parsed as JSON and sent as the request payload. Two optional inputs do the heavy lifting:

  • headers (KEY_VALUE) - extra headers merged over the default Content-Type: application/json. Auth tokens live here.
  • str0 through str9 - ten free-form string inputs that act as fill-in-the-blank slots. Anywhere your request_body contains __str0__, that token gets replaced with the value you wired in. So you can template one body and swap values per run instead of editing JSON by hand.

Outputs are text (raw response string), file (response as bytes), json (parsed), and any (raw bytes as a wildcard).

The gotchas

Two things in this node are worth knowing before they bite. First, if request_body isn't valid JSON, the node doesn't error - it silently sends {"error": "Invalid JSON in request_body"} to the server. A malformed body becomes a working request that your API will reject with confusion on both ends. Second, unlike the Get node in this pack, file here is an io.BytesIO object, not raw bytes - feed the any output (raw bytes) into the pack's Blob-To-* decoders instead if you're round-tripping binary.

The str0str9 placeholders are the most underrated part. Pair the node with a Key/Value Node feeding headers, and you can reuse one POST node across a whole workflow with per-run values.

Install

ComfyUI Manager → search ComfyUI-HttpRequestNodes → Install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/ahkimkoo/ComfyUI-HttpRequestNodes
pip install soundfile imageio imageio-ffmpeg

It shows up under RequestNode/Post Request. No model downloads, and the only real dependencies are the three pip packages above (soundfile, imageio, imageio-ffmpeg) - those matter for the audio/video nodes, not this one. If your requests time out on long-running jobs, note that plain Post doesn't set a generous timeout the way the binary and media nodes do; the Rest Api Node is the better bet for big slow endpoints.

CategoryRequestNode/Post Request

Inputs (13)

NameTypeDefaultDescription
target_urlSTRINGhttps://example.com/api
request_bodySTRING{}
headersoptKEY_VALUE
str0optSTRING
str1optSTRING
str2optSTRING
str3optSTRING
str4optSTRING
str5optSTRING
str6optSTRING
str7optSTRING
str8optSTRING
str9optSTRING

Outputs (4)

NameTypeDescription
textSTRING
fileBYTES
jsonJSON
anyANY