Custom Flux API Node
Flux Pro and Kontext from the cloud, with an image reference input
- image_prompt
- base64_url
- seed
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 asimage_promptwith animage_strengthfloat (default 0.75) controlling how strongly the input image influences the result. - For
flux-kontext*models, it sends the reference asinput_imageinstead, and - per the tooltip -match_input_imagein the aspect ratio list only works withflux-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-proneeds width and height;flux-1.1-pro-ultrarequiresaspect_ratioinstead. - 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_imagefor 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
seedjust 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_formatis 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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| model | STRING | flux-1.1-pro | flux-1.1-pro need width and height, flux-1.1-pro-ultra required aspect_ratio |
| width | INT | 1024256–1440 | — |
| height | INT | 1024256–1440 | — |
| seed | INT | 00–10000 | — |
| api_url | STRING | https://api.hyprlab.io/v1/images/generations | — |
| api_key | STRING | YOUR_API_KEY_HERE | — |
| image_promptopt | IMAGE | — | |
| image_strengthopt | FLOAT | 0.750–1 | — |
| aspect_ratioopt | COMBO | match_input_image only support flux-kontext-pro/max |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| base64_url | STRING | — |
| seed | INT | — |