Nodes/ComfyUI_StarNodes/⭐ Star FluxFill Inpainter
ComfyUI Node

⭐ Star FluxFill Inpainter

One node that crops, inpaints, and stitches Flux back together

By Starnodes2024·Created 2 years ago·Updated about 17 hours ago· 102
⭐ Star FluxFill Inpainter
  • model
  • vae
  • image
  • mask
  • clip
  • condition
  • image
  • latent
  • mask
  • clip
  • vae
  • seed
text
seed0
steps30
cfg1.00
sampler_nameeuler
schedulerbeta
denoise1.00
noise_masktrue
batch_size1
differential_attentiontrue
use_teacachefalse

Masked inpainting in Flux is a pain in ComfyUI: you need the Flux guidance node, a noise mask, correct conditioning, and - if you care about not touching the rest of the image - a crop-and-stitch rig so the model only ever sees the region you're changing. Star FluxFill Inpainter (FluxFillSampler) bundles all of it into one node. Give it a Flux model, a CLIP, a VAE, an image, and a mask, plus your prompt, and it returns an inpainted image (and the latent) with the unmasked area left alone.

How it works

The node is built around the crop-and-stitch pattern the community converged on: it crops the region around your mask, grows and blurs the mask so edges blend, samples Flux on that crop with proper Flux guidance, then stitches the result back onto the original. The unmasked pixels never get regenerated, which is the whole point of mask-based inpainting over the edit-model alternatives. It also ships optional differential_attention (on by default, the author's call for "better results") and use_teacache (on by default - the same speed-vs-fidelity tradeoff as the sampler; flip it off for the final pass if you see artifacts).

The inputs that matter:

  • model, clip, vae - your Flux stack (flux1-dev or a GGUF, the CLIP, ae.safetensors).
  • image, mask - the source and the region to change. Wire the mask from a MaskEditor, a segmentation node, or anything else that produces a MASK.
  • text - the fill prompt. This is where you say "red car" while the rest of the scene stays put.
  • noise_mask (default true) - and here's the author's own warning in the tooltip: adding a noise mask so sampling only happens inside the mask "might improve results or completely break things depending on the model." It's the classic Flux-Fill gotcha. If the output looks broken, this toggle is the first thing to try.
  • steps (30), cfg (1 - Flux doesn't want big CFG), sampler/scheduler (euler/simple), denoise.

Outputs: image (the stitched result) and latent (if you want to keep working from latent space).

Honest caveats

Two things to set expectations with. First, the tooltip on noise_mask isn't being dramatic - Flux models are genuinely inconsistent about respecting noise masks, and the fix is a toggle, not a tutorial. Second, mask-based inpainting has been quietly displaced by instruction-edit models (Qwen-Image-Edit, Klein, Kontext) for a lot of tasks, because a sentence like "change the shirt to red" is easier than painting a mask. But edit models change everything they touch and degrade the image over repeated edits; if you need one region swapped and the rest pixel-identical, this is still the right tool - that's the argument the inpainting crowd keeps making, and it's a good one.

Install and dependencies

From the StarNodes pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Starnodes2024/ComfyUI_StarNodes

or Manager → search Starnodes, restart, find it under ⭐StarNodes/Sampler. You need your own Flux model files - the node doesn't download anything. The code leans on scipy for mask dilation/blur, which the pack's requirements.txt doesn't list explicitly but ComfyUI's own environment provides; if you hit an import error on scipy, pip install scipy fixes it.

Category⭐StarNodes/Sampler

Inputs (17)

NameTypeDefaultDescription
modelMODEL
textSTRING
vaeVAE
imageIMAGE
maskMASK
seedINT00–18446744073709550000
stepsINT301–10000
cfgFLOAT1.000–100
sampler_nameCOMBOeuler44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBObeta9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
denoiseFLOAT1.000–1
noise_maskBOOLEANtrueAdd a noise mask to the latent so sampling will only happen within the mask. Might improve results or completely break things depending on the model.
batch_sizeINT11–16Process multiple samples in parallel for better GPU utilization
differential_attentionBOOLEANtrueUse Differential Attention for better results
use_teacacheBOOLEANfalseUse TeaCache to speed up generation
clipoptCLIP
conditionoptCONDITIONING

Outputs (6)

NameTypeDescription
imageIMAGE
latentLATENT
maskMASK
clipCLIP
vaeVAE
seedINT