Fal Kontext API
Run FLUX.1 Kontext Pro without the 12B weights
- image
- image
- info
- passed_nsfw_filtering
The one thing to know
This node doesn't run a model. It's a cloud wrapper: you feed it an image and an instruction in plain English, it uploads both to fal.ai, BFL's Kontext Pro tier does the edit on their servers, and the result drops back in as a normal ComfyUI tensor. No 12B weights to download, no 24GB of VRAM, no watching a diffusion progress bar crawl. What you pay is a fal.ai API key and a few cents per call.
That's the real pitch. If you've been eyeing Kontext's instruction editing - "change the car color to red", "convert to a pencil sketch", "make it snow" - but balked at running the local Dev model, this is the on-ramp. Kontext Pro and Max are the API-only tiers of the Flux Kontext family; the open-weights Dev model is distilled from Pro and never quite matches it on consistency. So this isn't a cheap stand-in for the local model - for the top tier, the API is the only way to get it into your ComfyUI canvas at all.
How it works
The flow is simple: your IMAGE tensor becomes a PIL image, gets resized to stay under 1.25 megapixels, and is uploaded to fal's storage via fal_client.upload_file(). The node then calls the fal-ai/flux-pro/kontext endpoint with sync_mode on, waits for the queue to finish, downloads the result, and converts it back to a tensor. Same pipeline every edit.
Two honest warnings before you wire it in. First, it's a paid call every time you run the queue - there's no local fallback and no free tier inside the node. Second, the single-image node hides most of the model's knobs. Guidance scale 3.5, 28 inference steps, image prompt strength 0.1, and the safety tolerance are all hardcoded in the source for this node. The Max sibling exposes them; here you get what you get.
Inputs and outputs that matter
You'll actually touch three inputs:
- prompt - the edit instruction, natural language. "Turn this into an oil painting with visible brushstrokes" works way better than a comma pile.
- image - the image to transform. Any IMAGE output works.
- seed -
-1for random (the node swaps in a random one before sending), or a fixed number if you want the same edit twice. Reproducibility costs you nothing here.
aspect_ratio defaults to "Match input image", which is usually what you want; pick 16:9 or 1:1 if you're building for a specific frame. disable_prompt_enhancement is the subtle one: by default the API rewrites and expands your prompt before generating. Flip it on if you want your exact wording sent through untouched.
The outputs are the useful part. image is your result, straight into SaveImage or PreviewImage. info is a string with the request ID, the seed actually used, and whether the content passed the safety check - wire it to a text node if you want to see what happened. passed_nsfw_filtering is a boolean that's True when the output is safe to save, which plays nicely with the "save on true"-style nodes floating around.
Installing it
ComfyUI Manager can find it as "ComfyUI-Kontext-API", or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/SanDiegoDude/ComfyUI-Kontext-API
cd ComfyUI-Kontext-API
pip install -r requirements.txt
Dependencies are light - fal-client, requests, Pillow, numpy - no model files at all. Restart ComfyUI and the node sits under image/generation.
The API key is the fiddly bit. Sign up at fal.ai, generate a key, then either set FAL_KEY as an environment variable or drop a file called .fal_key in the pack's own directory (that's ComfyUI/custom_nodes/ComfyUI-Kontext-API/.fal_key, not the ComfyUI root - the README stresses this) containing only the key, no quotes.
Things that will bite you
- "FAL API KEY NOT FOUND!" - the pack's signature error. You placed the
.fal_keyfile in the wrong directory, or it has whitespace/quotes in it. One key, nothing else. - Upload failures - usually a dead internet connection, an empty fal wallet, or an outdated
fal-client.pip install --upgrade fal-clientfixes the last one. - You got your input image back and no error. The node falls back to returning the original image when the API errors or returns nothing, so a "successful" run that just echoes your input means read the info string.
- It's censored at the weights level. Kontext ships with filtering baked in; don't plan on using it as an unrestricted generator regardless of what you type.
- Debug spam. The pack defaults
DEBUGtoFalseinnodes.py, but if a version you grabbed has it on, every call prints a wall of tensor shapes to the console. Flip it off when it stops being useful.
For instruction-based editing on a budget it's genuinely the easiest path to the top Kontext tier. Just remember the meter's running.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| image | IMAGE | — | |
| seed | INT | -1-1–2147483647 | — |
| aspect_ratio | COMBO | Match input image | 10 options: Match input image, 21:9, 16:9, 4:3, 3:2, 1:1, +4 |
| disable_prompt_enhancementopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| info | STRING | — |
| passed_nsfw_filtering | BOOLEAN | — |