ComfyUI Node

Custom Flux API Node

Flux Pro and Kontext from the cloud, with an image reference input

By AhBumm·Created 2 years ago·Updated 3 months ago· 11
Custom Flux API Node
  • image_prompt
  • base64_url
  • seed
prompt
modelflux-1.1-pro
width1024
height1024
seed0
api_urlhttps://api.hyprlab.io/v1/images/generations
api_keyYOUR_API_KEY_HERE
image_strength0.75
aspect_ratio

Flux Pro and Flux Kontext are API-only products. If you want their quality without buying a GPU farm or waiting for a local 12B checkpoint to crawl, you call them over HTTP - and this is the node that does it from inside ComfyUI. The imgInput in the class name is the selling point: unlike the pack's simpler image nodes, this one takes a real ComfyUI IMAGE as an optional reference, so you can do image-plus-prompt generation (the Kontext style-transfer thing, or img2img-ish work) without leaving the graph.

How it works

It POSTs to whatever api_url you give it (default https://api.hyprlab.io/v1/images/generations, an OpenAI-style images endpoint - swap it for your actual provider) with a Bearer API key. If you feed it an image_prompt, the node encodes that tensor to a PNG base64 data URL and tucks it into the request. The interesting part is the per-model behavior baked into the code:

  • For flux-1.1-pro, the reference goes in as image_prompt with an image_strength float (default 0.75) controlling how strongly the input image influences the result.
  • For flux-kontext* models, it sends the reference as input_image instead, and - per the tooltip - match_input_image in the aspect ratio list only works with flux-kontext-pro/max.
  • Anything else falls through to the generic path, also using image_prompt/image_strength.

The response is expected to be data[0].b64_json, which it wraps as a data:image/webp;base64, URL. That's a STRING output - wire it into Load Image from URL (BillBum) to get a tensor.

The inputs that matter

  • model - defaults to flux-1.1-pro. The tooltip is the cheat sheet: flux-1.1-pro needs width and height; flux-1.1-pro-ultra requires aspect_ratio instead.
  • width / height - 256 to 1440, stepped at 32. Ignored by the ultra variants.
  • aspect_ratio - the Combo box with the usual ratios, plus match_input_image for Kontext Pro/Max.
  • image_prompt (optional IMAGE) and image_strength - the reference input and its weight.
  • seed - maxes out at 10000 here, which is low, so don't expect a huge seed space. The output seed just echoes it back.
  • api_url / api_key - again, defaults point at HyprLab; change them before anything else.

Outputs: base64_url (STRING) and seed (INT).

Installing it

Same pack, same dance as the rest. ComfyUI Manager → search "billbum" → install "Customizable API Call Nodes by BillBum", or:

cd ComfyUI/custom_nodes
git clone https://github.com/AhBumm/ComfyUI_BillBum_APIset_Nodes.git
cd ComfyUI_BillBum_APIset_Nodes
pip install -r requirements.txt

Restart, done. Nothing heavy to download - the heavy lifting happens on the API's servers.

Common issues

  • Model/parameter mismatch. Sending width and height to an ultra model (or aspect_ratio to a non-ultra one) gets you a 400. Read the tooltip, pick the right parameter set for the model.
  • Endpoint must return b64_json. This node expects base64 back; if your provider returns URLs instead, you'll get an "Unexpected response format" error. The pack's generic Image API Call Node handles the URL-returning case.
  • It's a paid API. Flux Pro runs on credits, and output_format is hardcoded to webp. That's fine for display; if you need PNG for a pipeline, convert downstream.

The gap this fills: Flux Pro/Kontext quality and image-reference workflows, all in one node, no local model. If you're already paying for a Flux API key, this is the cleanest way to point ComfyUI at it.

CategoryBillBum_API

Inputs (10)

NameTypeDefaultDescription
promptSTRING
modelSTRINGflux-1.1-proflux-1.1-pro need width and height, flux-1.1-pro-ultra required aspect_ratio
widthINT1024256–1440
heightINT1024256–1440
seedINT00–10000
api_urlSTRINGhttps://api.hyprlab.io/v1/images/generations
api_keySTRINGYOUR_API_KEY_HERE
image_promptoptIMAGE
image_strengthoptFLOAT0.750–1
aspect_ratiooptCOMBOmatch_input_image only support flux-kontext-pro/max

Outputs (2)

NameTypeDescription
base64_urlSTRING
seedINT