Nodes/arkennemasis - ChatGPT / Codex / fal AI nodes/arkennemasis fal · Flux General Inpainting · $0.075/MP
ComfyUI Node

arkennemasis fal · Flux General Inpainting · $0.075/MP

A real mask, on a hosted Flux, with a caveat worth reading twice

By Hishamahmer·Created 3 months ago·Updated 9 days ago· 11
arkennemasis fal · Flux General Inpainting · $0.075/MP
  • image
  • mask
  • fill_image_fill_image_1
  • fill_image_fill_image_2
  • fill_image_fill_image_3
  • fill_image_fill_image_4
  • fill_image_fill_image_5
  • fill_image_fill_image_6
  • reference_image
  • images
  • image_paths
  • timings
  • has_nsfw_concepts
  • prompt
  • seed
  • info
◄prompt►
◄image_sizesquare_hd►
◄image_size_width1024►
◄image_size_height1024►
◄num_inference_steps28►
◄seed-1►
◄loras►
◄control_loras►
◄controlnets►
◄controlnet_unions►
◄ip_adapters►
◄easycontrols►
◄guidance_scale3.50►
◄real_cfg_scale3.50►
◄use_real_cfgfalse►
◄use_cfg_zerofalse►
◄num_images1►
◄enable_safety_checkertrue►
◄reference_strength0.65►
◄reference_start0.00►
◄reference_end1.00►
◄base_shift0.50►
◄max_shift1.15►
◄output_formatpng►
◄use_beta_schedulefalse►
◄schedulereuler►
◄negative_prompt►
◄nag_scale3.00►
◄nag_tau2.50►
◄nag_alpha0.25►
◄nag_end0.25►
◄strength0.85►
◄max_cost_usd20.0►
◄reuse_identical_runtrue►
◄extra_json►
◄max_concurrent1►

Instruction editing ate most of inpainting's lunch between 2025 and 2026. Ask a model to change the jacket and it changes the jacket, no mask required. What instruction models can't do is leave the rest of the frame alone - they take the whole picture into context and emit a whole new one, so unmasked regions come back close but not identical, and the drift compounds if you chain edits.

That's the niche this node occupies: it's the mask path, for when you want to say where and not just what. It runs the Flux General endpoint, so it also carries the LoRA/ControlNet/IP-Adapter extensions and the NAG negative-prompt controls.

The three inputs that matter

image - required, the picture being edited.

mask - required, and it's a proper ComfyUI MASK, not a URL. Draw it with the mask editor or wire a segmentation node into it. The pack uploads it as a PNG sized to match your first image, so you don't have to think about resolution - but you do need the mask to line up with the image you actually connected, because a mask from a different crop is the single most common way to get a nonsense result.

strength - defaults to 0.85: 1.0 completely remakes the image, 0.0 preserves the original. This is the dial people get wrong. The classic inpainting guidance is that 0.3–0.6 handles most real work - swapping a garment, changing an expression - and going to 0.8+ is essentially text-to-image inside the mask, composition included. The default here is at the aggressive end, so lower it for detail work.

The rest of the node

Because it's the general pipeline: prompt and negative_prompt, with negatives routed through NAG - nag_scale (3, don't exceed it), nag_tau (2.5), nag_alpha (0.25), nag_end (0.25). The JSON extension fields - loras, control_loras, controlnets, controlnet_unions, ip_adapters, easycontrols - take URLs fal can fetch, not local paths. use_real_cfg (false) costs time and money when enabled. Sampling: image_size (square_hd default, custom for exact dimensions - watch this, since a mask and an image at different aspect ratios will not line up), num_inference_steps 28, seed -1, guidance_scale 3.5, scheduler euler, base_shift 0.5, max_shift 1.15, use_beta_schedule false.

There are also reference_image (with reference_strength, reference_start, reference_end) and six optional fill_image_* sockets for reference-only and Redux-style fill prompting.

Outputs

images and image_paths, saved under output/fal/fal-ai_flux-general_inpainting/, plus timings, has_nsfw_concepts, prompt, seed, and info carrying the request id, cost estimate, saved files and fal's answer.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Hishamahmer/comfyui-arkennemasis

Restart ComfyUI, or use ComfyUI-Manager → Install via Git URL. requirements.txt declares a single dependency, httpx, and it's for the pack's Codex nodes; the fal nodes run on the standard library and download no weights.

FAL_KEY=your-key-from-fal.ai/dashboard/keys

goes in the .env next to run_nvidia_gpu.bat (portable build) or in your ComfyUI folder. No fal node in this pack has a key field - the design decision being that a key in a widget ends up inside shared workflow files.

The caveat, said plainly

You are not compositing locally. The endpoint generates a full frame with your mask as guidance, so pixels outside the mask are regenerated too - they'll look right, they just won't be identical. If your requirement is that nothing outside the mask may change, provably, then the hosted inpainting endpoints are the wrong tool and the local route is the right one: mask locally, run the model, composite the masked region back over the original. That gives you bit-identical untouched pixels, which no API round trip can.

Where this node genuinely wins: you want a mask-guided edit on Flux General without a 12B checkpoint and a ControlNet on your disk, or you want the extensions available at the same time. Then 7.5¢ a megapixel is a reasonable toll.

Cost

$0.075/MP - 1024×1024 ≈ 7.5¢, and use_real_cfg pushes it higher for the same output. max_cost_usd (default $20, 0 for no cap) stops the run before upload if the estimate is over. reuse_identical_run (default on) means the same image bytes, same mask and same settings return the file you already paid for rather than a fresh charge - useful, and worth knowing before you queue a re-run expecting a different sample.

When it goes wrong

The mask landed on the wrong thing. Check that the mask and the image are the same crop and the same orientation. The pack sizes the mask PNG to your image, but it can't know if that mask belongs to a different photo.

A seam appears at the mask edge. Lower strength first. The other classic fix is feathering the mask so the transition isn't a hard line - how much feathering depends on the size of the edit, and it's the field you'll be adjusting in your own mask pipeline rather than on this node.

A tiny detail came out mushy. That's resolution, not the model: the whole frame gets the generation budget. Crop the region, render it large, and paste it back if the detail is what matters.

Categoryarkennemasis/fal/Image/Flux

Inputs (45)

NameTypeDefaultDescription
promptSTRINGThe prompt to generate an image from.
image_sizeCOMBOsquare_hdThe size of the generated image. 'custom' uses the width and height below.
image_size_widthINT102416–14142Width in pixels when image_size is 'custom'.
image_size_heightINT102416–14142Height in pixels when image_size is 'custom'.
num_inference_stepsINT281–50The number of inference steps to perform.
seedINT-1-1–2147483647The same seed and the same prompt given to the same version of the model will output the same image every time. -1 leaves it to the model.
lorasSTRINGThe LoRAs to use for the image generation. You can use any number of LoRAs and they will be merged together to generate the final image. JSON. Empty leaves it out.
control_lorasSTRINGThe LoRAs to use for the image generation which use a control image. You can use any number of LoRAs and they will be merged together to generate the final image. JSON. Empty leaves it out.
controlnetsSTRINGThe controlnets to use for the image generation. Only one controlnet is supported at the moment. JSON. Empty leaves it out.
controlnet_unionsSTRINGThe controlnet unions to use for the image generation. Only one controlnet is supported at the moment. JSON. Empty leaves it out.
ip_adaptersSTRINGIP-Adapter to use for image generation. JSON. Empty leaves it out.
easycontrolsSTRINGEasyControl Inputs to use for image generation. JSON. Empty leaves it out.
guidance_scaleFLOAT3.500–20The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.
real_cfg_scaleFLOAT3.500–5The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.
use_real_cfgBOOLEANfalseUses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. If using XLabs IP-Adapter v1, this will be turned on!.
use_cfg_zeroBOOLEANfalseUses CFG-zero init sampling as in https://arxiv.org/abs/2503.18886.
num_imagesINT11–10The number of images to generate. This is always set to 1 for streaming output.
enable_safety_checkerBOOLEANtrueIf set to true, the safety checker will be enabled. Disabling it requires account authorization; unauthorized requests are always checked, and images flagged as unsafe are returned as black images.
reference_strengthFLOAT0.65-3–3Strength of reference_only generation. Only used if a reference image is provided.
reference_startFLOAT0.000–1The percentage of the total timesteps when the reference guidance is to bestarted.
reference_endFLOAT1.000–1The percentage of the total timesteps when the reference guidance is to be ended.
base_shiftFLOAT0.500.01–5Base shift for the scheduled timesteps
max_shiftFLOAT1.150.01–5Max shift for the scheduled timesteps
output_formatCOMBOpngThe format of the generated image.
use_beta_scheduleBOOLEANfalseSpecifies whether beta sigmas ought to be used.
schedulerCOMBOeulerScheduler for the denoising process.
negative_promptSTRINGNegative prompt to steer the image generation away from unwanted features. By default, we will be using NAG for processing the negative prompt. Empty leaves it out.
nag_scaleFLOAT3.001.01–10The scale for NAG. Higher values will result in a image that is more distant to the negative prompt.
nag_tauFLOAT2.50The tau for NAG. Controls the normalization of the hidden state. Higher values will result in a less aggressive normalization, but may also lead to unexpected changes with respect to the original image. Not recommended to change this value.
nag_alphaFLOAT0.250.01–1The alpha value for NAG. This value is used as a final weighting factor for steering the normalized guidance (positive and negative prompts) in the direction of the positive prompt. Higher values will result in less steering on the normalized guidance where lower values will result in considering the positive prompt guidance more.
nag_endFLOAT0.250.01–1The proportion of steps to apply NAG. After the specified proportion of steps has been iterated, the remaining steps will use original attention processors in FLUX.
imageIMAGEURL of image to use for inpainting. or img2img
strengthFLOAT0.850.01–1The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original.
maskMASKThe mask to area to Inpaint in.
fill_image_fill_image_1optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_2optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_3optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_4optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_5optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_6optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
reference_imageoptIMAGEURL of Image for Reference-Only
max_cost_usdoptFLOAT20.00–100000Safety cap. If the estimated cost of this run is above this many US dollars the node stops BEFORE sending anything to fal. 0 = no cap.
reuse_identical_runoptBOOLEANtrueIf these exact inputs (the settings AND the same pictures/clips/audio) were already paid for and the files are still in output/fal, return them instead of paying again - also after a ComfyUI restart. Turn off for a fresh take with the same settings.
extra_jsonoptSTRINGAdvanced: a JSON object merged into the request last, for any fal field this node has no box for. Example: {"seed": 7}. Leave empty normally.
max_concurrentoptINT11–32How many paid fal calls may run at the same time in one run, across every fal node. 1 (default) = one after another. This node starts its paid part only while fewer than this many fal calls are running. Once any fal node fails, the ones still waiting are not started, so nothing more is billed.

Outputs (7)

NameTypeDescription
imagesIMAGE—
image_pathsSTRING—
timingsSTRING—
has_nsfw_conceptsSTRING—
promptSTRING—
seedINT—
infoSTRINGJSON: request id, cost estimate, saved files and fal's full answer.