Nodes/ComfyUI_Fill-Nodes/FL Fal Kontext API
ComfyUI Node

FL Fal Kontext API

Flux Kontext's editing without hosting the weights

By filliptm·Created 3 years ago·Updated about 17 hours ago· 628
FL Fal Kontext API
  • image_1
  • images
  • image_urls
  • status_msg
inputcount1
api_key
seed0
max_retries3
prompt_1Put a donut next to the flour.
guidance_scale3.5
num_images1
aspect_ratio1:1
output_formatjpeg
safety_tolerance2
retry_indefinitelyfalse
sync_modefalse

Flux Kontext - the instruction-based image editor everyone in the Flux ecosystem knows for character-consistent edits and shockingly good watermark removal - called through Fal.ai's Pro-tier API instead of running the open-weight Dev model locally. That distinction matters more than it looks: the Dev weights ship under a Non-Commercial license with an anti-circumvention clause that made NSFW LoRAs for it a license violation and got them purged from CivitAI and HuggingFace. The Pro API sidesteps all of that, because you're not hosting weights at all - you're paying per call.

The mechanism

Same in-context editing approach Kontext is known for: it concatenates your reference image into the model's context alongside a text instruction rather than injecting it through an adapter, which is why Kontext holds a subject's identity across edits better than most alternatives. This node batches, too - inputcount (1-100) controls how many prompt/image pairs get dynamically exposed (prompt_1 is the first of them), and each pair fires as its own async API call, with all the resulting images coming back batched.

Inputs and outputs that matter

api_key is your Fal.ai key. prompt_1 is the edit instruction - "Put a donut next to the flour" is literally the node's own default, a nod to BFL's original Kontext demo prompt. image_1 (optional) is the reference to edit; leave it empty and Kontext just generates from the prompt with no reference. guidance_scale (1-20, default 3.5) sets how strictly it follows the prompt versus improvising. aspect_ratio gives nine presets, num_images (1-4) sets outputs per call, output_format is jpeg or png, and safety_tolerance is a string enum from "1" through "6" - higher numbers loosen Fal/BFL's own content filter on the API, which is separate from anything about the underlying model itself. seed and max_retries round it out; retry_indefinitely and sync_mode are optional overrides for the same reasons as this pack's other Fal nodes.

Outputs: images, image_urls, status_msg.

Installing it

ComfyUI Manager: search Fill-Nodes, install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/filliptm/ComfyUI_Fill-Nodes, then restart.

Where people get burned

Kontext's known weakness - anatomy degrading when a full body is small in frame, heads and hair artifacting - is a property of the Kontext model family itself, not something this node introduces. Don't expect the API tier to fix full-body shots the local model struggles with; keep edits tighter on the subject if you're seeing it.

And because this is the Pro API rather than local weights, none of the Dev-license NSFW restrictions technically apply to what you send it - but Fal's safety_tolerance filtering and BFL's own API-side moderation still gate what comes back, so expect refusals on some prompts regardless of how you set that slider.

Category🏵️Fill Nodes/AI

Inputs (13)

NameTypeDefaultDescription
inputcountINT11–100
api_keySTRING
seedINT00–2147483647
max_retriesINT31–5
prompt_1STRINGPut a donut next to the flour.
guidance_scaleFLOAT3.51–20
num_imagesINT11–4
aspect_ratioCOMBO1:19 options: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, +3
output_formatCOMBOjpeg2 options: jpeg, png
safety_toleranceCOMBO26 options: 1, 2, 3, 4, 5, 6
image_1optIMAGE
retry_indefinitelyoptBOOLEANfalse
sync_modeoptBOOLEANfalse

Outputs (3)

NameTypeDescription
imagesIMAGE
image_urlsSTRING
status_msgSTRING