PVL Kontext Dev Inpaint (fal.ai)
Kontext editing, masked and LoRA-loaded, no local weights
- image
- mask
- reference_image
- IMAGE
Flux Kontext is BFL's instruction-based editor: feed it an image plus a sentence and it edits - clothing swaps, background changes, the famously good watermark removal - with strong character consistency because it consumes the reference in-context rather than through an adapter. The catch locally is the 12B weights and, depending on your use, the licensing. This node skips the weights entirely: it wraps fal.ai's fal-ai/flux-kontext-lora/inpaint endpoint, so you get Kontext's editing and a real mask, plus up to three LoRAs and an optional reference image, all running on fal's hardware.
The combination is genuinely useful. Plain Kontext, like most instruction editors, rewrites the whole frame and can drift on regions you didn't mention. Slap a mask on it and you contain the damage to the area you drew - which is exactly the "bolt a mask back on around the editor" pattern the KB's inpainting essay documents people reaching for.
How it works
The node base64-encodes your image, converts your mask (MASK tensor, 1.0 = edit region) to an image, and - if you've connected one - your reference_image too, then POSTs the lot to the fal endpoint. Kontext's LoRA-family pipeline means lora1_name/lora2_name/lora3_name (strings) each pair with a _scale (-2 to 2) and get injected server-side; the LoRA names are whatever the fal deployment exposes, not your local filenames.
Inputs that matter
image,mask, andpromptare required. The mask is what keeps the edit local.reference_image(optional) is the character/identity reference - this is where Kontext's in-context consistency earns its keep.strength(0.88),steps(30),CFG(2.5) - standard diffusion dials; Kontext prefers low CFG.acceleration(none/regular/high),num_images(1-4),output_format(jpeg/png),enable_safety_checker(on by default here),seed(-1 = random).
One IMAGE output.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes
Restart, set FAL_KEY in the launching environment (fal.ai/dashboard). The pack's requirements.txt is heavier than this node needs, but Manager installs it regardless.
Where people get burned
- LoRA names are fal-side. You can't point it at a LoRA sitting in your
models/lorasfolder; the string must match something the fal deployment knows. Leavelora*_nameempty until you've confirmed what's available. - It's paid cloud inference, and Kontext is a big model - runs can take a while, so don't set the workflow up to fire hundreds of calls.
- Censorship carries over. Kontext's known weight-level filtering is in play via the API; if that's a problem for your content, the KB notes Qwen-Image-Edit is the Apache-2.0-licensed alternative that doesn't carry those terms.
- Mask + strong
strengthcan still leak edits outside the mask on the LoRA-family pipeline - check the region borders before you commit to a batch.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| prompt | STRING | — | |
| steps | INT | 301–100 | — |
| CFG | FLOAT | 2.51–20 | — |
| strength | FLOAT | 0.880–1 | — |
| num_images | INT | 11–4 | — |
| enable_safety_checker | BOOLEAN | true | — |
| output_format | COMBO | png | 2 options: jpeg, png |
| sync_mode | BOOLEAN | false | — |
| acceleration | COMBO | none | 3 options: none, regular, high |
| reference_imageopt | IMAGE | — | |
| seedopt | INT | -1-1–4294967295 | — |
| lora1_nameopt | STRING | — | |
| lora1_scaleopt | FLOAT | 1.0-2–2 | — |
| lora2_nameopt | STRING | — | |
| lora2_scaleopt | FLOAT | 1.0-2–2 | — |
| lora3_nameopt | STRING | — | |
| lora3_scaleopt | FLOAT | 1.0-2–2 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |