HTTP Form Image Item
POST a generated image straight from the latent → VAE pipeline
- image
- form_item
This is the node that makes the whole pack worth installing. HTTP Form Image Item takes a ComfyUI IMAGE tensor - the thing that comes out of VAE Decode - and encodes it in memory into PNG, JPEG, or WEBP bytes, packaged as a file item for a multipart form. No saving to disk, no base64 gymnastics, no "upload the file to your server first" dance. The image you just generated is in the POST request.
It's the missing link between "I made an image in ComfyUI" and "my external API needs that image."
How it works
Two required inputs:
name- the form field name (defaults toimage).image- theIMAGEtensor. Feed it from VAE Decode (or Load Image, or anything else outputting an IMAGE).
Then the optional controls that matter:
format-PNG(default),JPEG, orWEBP. PNG for lossless; JPEG/WEBP if the API cares about size and quality.quality(default 95) - applies to JPEG and WEBP. Lower it to shrink the payload.filename(defaultimage.png) - what the server sees as the file name; change the extension to match yourformator some servers complain.
Internally it converts the tensor to a PIL image (handling batch and channel order correctly), re-encodes it to bytes with the format/quality you picked, and attaches the right content type (image/png, image/jpeg, image/webp). If you feed it a batch of images, it takes the first frame - so split batches upstream if you want to upload each one.
One output: form_item (HTTP_FORM_ITEM), which goes into an HTTP Form Data slot, then into HTTPPost with content_type = form-data.
The classic combo
[KSampler → VAE Decode] → [HTTP Form Image Item] ──┐
├→ [HTTP Form Data] → [HTTP Post: form-data]
[prompt → CLIP encode → text] → [HTTP Form Text Item] ┘
One request carrying your rendered image and its prompt/caption to whatever service wants them.
Install
ComfyUI Manager → search "ComfyUI-HTTP" → Install, restart. Manual:
cd ComfyUI/custom_nodes/
git clone https://github.com/wawahuy/ComfyUI-HTTP.git
cd ComfyUI-HTTP
pip install -r requirements.txt
No model downloads. It needs Pillow, which any working ComfyUI install already has.
Where people get burned
If encoding fails for any reason, the node doesn't raise - it silently degrades into a text form item containing Error: .... Your upload "succeeds" but the API gets a string where it expected image bytes. Also watch filename vs format: JPEG data named image.png confuses picky servers. And the "first frame of a batch" behavior will quietly surprise you if you upload from a batched generation - you'll send one image and wonder where the other three went.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | image | — |
| image | IMAGE | — | |
| filenameopt | STRING | image.png | — |
| formatopt | COMBO | PNG | 3 options: PNG, JPEG, WEBP |
| qualityopt | INT | 951–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| form_item | HTTP_FORM_ITEM | — |