HTTP File Upload
Ship a local file to any API endpoint
- session
- auth
- status_code
- headers
- content
- json
Sometimes you don't want to post JSON - you want to post a file. Maybe it's a prompt you generated and saved, a zip of outputs, a config file your workflow built, or just about anything else sitting in a path on disk. HTTP File Upload is the pack's blunt instrument for that: point it at a file path, tell it the multipart field name the server expects, and it uploads via POST with multipart/form-data.
How it works
Under the hood it reads the file, builds a files dict with (filename, bytes, content_type), and posts it - with the same session/auth/header plumbing as every other node in this pack. Three required inputs:
url- where the file goes.file_path- the local path. The node checks it exists and returns an error message instead of crashing if it doesn't.field_name- the form field name the API expects (usuallyfile).
Then the useful optional ones:
filename- leave blank and it's auto-derived fromfile_pathviaos.path.basename.content_type- leave blank and it's auto-detected from the extension (text, json, pdf, images, video, audio are covered; anything unknown becomesapplication/octet-stream).additional_data- a JSON object of extra form fields sent alongside the file.session,auth,headers,cookies,timeout(default 60s - uploads get more headroom than the 30s on plain requests),verify_ssl,proxy_url.
Outputs are the standard four: status_code, headers, content, json.
The honest caveat
The README sells this with "progress and configuration," and there's a chunk_size input (default 8192, up to 1 MB). It doesn't actually stream in chunks - the code reads the whole file into memory and sends it in one shot. For the sizes you're usually moving in ComfyUI that's totally fine, but don't reach for it to push a 2 GB video. For big files, use HTTPFormFileItem inside a form instead, or better, upload from outside ComfyUI.
Install
ComfyUI Manager → search "ComfyUI-HTTP" → Install, then restart. Manual:
cd ComfyUI/custom_nodes/
git clone https://github.com/wawahuy/ComfyUI-HTTP.git
cd ComfyUI-HTTP
pip install -r requirements.txt
No models, nothing heavy - just requests.
Where people get burned
The classic miss is the field name. The server expects name="file", you leave the default, and you get a 400 because the API actually wanted name="upload". Set field_name to match the endpoint's docs. And remember the no-throw behavior: a failed upload returns status_code = 0 with the error text in content, so check the status before you assume the file landed.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| url | STRING | https://api.example.com/upload | — |
| file_path | STRING | /path/to/file.txt | — |
| field_name | STRING | file | — |
| sessionopt | HTTP_SESSION | — | |
| authopt | HTTP_AUTH | — | |
| headersopt | STRING | {} | — |
| additional_dataopt | STRING | {} | — |
| filenameopt | STRING | — | |
| content_typeopt | STRING | — | |
| timeoutopt | INT | 601–300 | — |
| verify_sslopt | BOOLEAN | true | — |
| allow_redirectsopt | BOOLEAN | true | — |
| cookiesopt | STRING | {} | — |
| proxy_urlopt | STRING | — | |
| chunk_sizeopt | INT | 81921024–1048576 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| status_code | INT | — |
| headers | STRING | — |
| content | STRING | — |
| json | STRING | — |