ComfyUI Node

HTTP Image Loader

Turn a URL into a real IMAGE tensor — even an authenticated one

By wawahuy·Created about a year ago·Updated 12 months ago· 14
HTTP Image Loader
  • session
  • auth
  • image
  • width
  • height
  • format
  • info
◄urlhttps://example.com/image.jpg►
◄headers{}►
◄timeout30►
◄verify_ssltrue►
◄allow_redirectstrue►
◄cookies{}►
◄proxy_url►
◄max_size10485760►
◄resize_modenone►
◄target_width512►
◄target_height512►
◄convert_modeauto►

Stock ComfyUI can only load images from disk. HTTP Image Loader is the node that fixes that: give it a URL and it downloads the image and hands you a proper IMAGE tensor you can feed straight into img2img, ControlNet, a VAE, or anything else that eats images. And because it uses the pack's session/auth plumbing, it can fetch images that aren't public - from behind an API key, a bearer token, or a login cookie. That last part is the bit you can't do with a plain "Load Image from URL" node.

How it works

One required input: url. Then the useful optional ones:

  • session / auth - wire in HTTP Session Manager and HTTP Authentication for protected images.
  • headers / cookies - extra JSON-string headers or cookies, e.g. a Referer some image hosts require.
  • timeout, verify_ssl, allow_redirects, proxy_url - the standard set.
  • max_size (default 10 MB) - a hard cap on the download; bigger images are rejected rather than hogging memory.
  • resize_mode - none, fit (fit inside target, preserve aspect), fill (fill target, may crop), stretch (distort to fit).
  • target_width / target_height - the resize targets (default 512×512), only used when resize_mode isn't none.
  • convert_mode - RGB, RGBA, L (grayscale), or auto. auto converts anything unusual to RGB.

Five outputs: image (the IMAGE tensor), width, height, format (the source format, e.g. JPEG), and info (a string describing what happened - check this one).

The honest caveat about failure

This node does not fail loudly. If the download fails, the URL 404s, or the image exceeds max_size, it returns a small black 64×64 fallback image with the error in the info output. Your workflow keeps running and silently produces a black image downstream - which is a nasty way to find out. Get into the habit of checking info (or format, which becomes "error" on failure) before you trust what you're feeding the sampler.

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. Needs Pillow and torch, both already in any working ComfyUI install.

Where people get burned

Besides the silent-black-image trap: resizing only happens if you set resize_mode, so leaving it at none with target dimensions set does nothing. And max_size defaults to 10 MB - plenty for photos, but a 4K PNG from some sources will trip it, and the symptom (black image, info says too large) looks nothing like a download problem at first glance.

CategoryHTTP/Image Operations

Inputs (14)

NameTypeDefaultDescription
urlSTRINGhttps://example.com/image.jpg—
sessionoptHTTP_SESSION—
authoptHTTP_AUTH—
headersoptSTRING{}—
timeoutoptINT301–300—
verify_ssloptBOOLEANtrue—
allow_redirectsoptBOOLEANtrue—
cookiesoptSTRING{}—
proxy_urloptSTRING—
max_sizeoptINT104857601024–104857600—
resize_modeoptCOMBOnone4 options: none, fit, fill, stretch
target_widthoptINT5121–8192—
target_heightoptINT5121–8192—
convert_modeoptCOMBOauto4 options: RGB, RGBA, L, auto

Outputs (5)

NameTypeDescription
imageIMAGE—
widthINT—
heightINT—
formatSTRING—
infoSTRING—