Nodes/ComfyUI_Fill-Nodes/FL KSampler SEG
ComfyUI Node

FL KSampler SEG

The sampler that finishes the region-caption-encode chain

By filliptm·Created 3 years ago·Updated 2 days ago· 630
FL KSampler SEG
  • model
  • regions
  • latent_image
  • positive
  • negative
  • latent
seed0
steps25
cfg6.5
sampler_name
scheduler
denoise0.55
cascade_start_cornertop_left

This is the payoff node for the four-part Fill-Nodes SEG chain: FL_KsamplerSEG_Regions tessellates your image into overlapping cells, FL_KsamplerSEG_Captioner describes what's in each one, FL_KsamplerSEG_Encoder turns those descriptions into per-region conditioning, and FL_KsamplerSEG actually samples with all of it. The pitch is regional prompting without you drawing a single mask by hand - the model looked at the image, decided what's where, and now each area gets sampled toward its own description instead of one blanket prompt for the whole canvas.

How it works - cascade-paint, not parallel-then-blend

The interesting design choice here is the sampling order. A lot of tiled/regional samplers process every tile against a frozen snapshot of the latent and blend the results afterward - which is fast, but seams show because no tile ever saw what its neighbor became. FL_KsamplerSEG instead walks regions one at a time in a corner-anchored nearest-neighbor order (you pick the starting corner with cascade_start_corner - top-left, top-right, bottom-left, bottom-right, or center), and each region samples against the canvas as it currently stands, including whatever the previous regions already painted into it. That means later regions are conditioning on real, already-generated neighboring content, not a stale pre-region latent - the model does its own seam blending in feature space because it can literally see what's next to it. Slower than a parallel scheme, but it's the reason you don't get the checkerboard-y tile seams that plague naive tiled samplers.

The inputs and outputs that matter

  • regions (SEG_REGIONS) - the fully-encoded bundle from FL_KsamplerSEG_Encoder. This is what actually drives per-area prompting; without it you're just running a normal sampler the hard way.
  • model, latent_image, positive, negative - standard KSampler plumbing. The positive/negative here act as the global fallback, similar in spirit to the encoder's defaults, layered under whatever each region specifies.
  • steps (25), cfg (6.5), denoise (0.55) - note these defaults are already tuned for a second-pass/refinement role (denoise well under 1.0), not a from-scratch generation. That tracks with the whole workflow's shape: you're usually re-touching an existing image region by region, not generating one from noise.
  • cascade_start_corner - changes which region samples first and the walk order after. Worth experimenting with if you notice a directional bias in how earlier vs. later regions turn out.
  • Output: latent - one composited result, ready for your VAE decode.

How to install it

ComfyUI Manager: search "ComfyUI_Fill-Nodes", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes

No exotic dependency for this node specifically - it's built on ComfyUI's own sampler/scheduler machinery. filliptm's pack is large and covers a lot of unrelated ground (image FX, PDF tools, GPT/Gemini/Fal API wrappers, and this KSampler family among them); the heavier requirements live in those other groups, not here.

Common issues & troubleshooting

It's noticeably slower than a normal KSampler pass. That's inherent to the design - each region is its own sequential sampling pass against a live canvas, not one shared pass. More regions from the earlier node directly means more sequential work here.

Results look inconsistent if you skip the earlier chain nodes. This node expects regions to already carry per-region conditioning from FL_KsamplerSEG_Encoder. If you feed it a SEG_REGIONS bundle straight from FL_KsamplerSEG_Regions with no captioning/encoding step, every region just falls back to the same global positive/negative - you'll still get a valid image, you just lose the entire point of the pipeline.

Try a different cascade_start_corner before you touch anything else if one part of the image consistently comes out weaker - since later regions sample against already-painted neighbors, where you start the walk genuinely changes the result, not just cosmetically.

Category🏵️Fill Nodes/Ksamplers

Inputs (12)

NameTypeDefaultDescription
modelMODEL
regionsSEG_REGIONS
latent_imageLATENT
positiveCONDITIONING
negativeCONDITIONING
seedINT00–18446744073709550000
stepsINT251–10000
cfgFLOAT6.50–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
denoiseFLOAT0.550–1
cascade_start_cornerCOMBOtop_left5 options: top_left, top_right, bottom_left, bottom_right, center

Outputs (1)

NameTypeDescription
latentLATENT