ComfyUI Node

πŸ”— Egregora Combine

Putting enhanced tiles back together without the ghosting

By lucasgattasΒ·Created about a year agoΒ·Updated 5 months agoΒ· 3
πŸ”— Egregora Combine
  • tiles
  • masks
  • egregora_data
  • IMAGE
β—„scaling_methodlanczosβ–Ί
β—„combine_modeowner_alpha_overβ–Ί
β—„dominance_gamma1.30β–Ί
β—„conflict_boost0.90β–Ί
β—„edge_boost0.75β–Ί
β—„conflict_power1.00β–Ί
β—„edge_power1.20β–Ί
β—„transition_focus1.50β–Ί

The whole point of tiling is that each tile gets processed independently - and that's also the whole problem. Independent processing means neighboring tiles can drift apart, and when they disagree in an overlap, a naive 50/50 average turns cables into double-images and hair into smudge. Egregora Combine is where the pack earns its keep: it stitches your processed tiles back onto the canvas using the masks from the divide stage, and it's the only node in the pack with actual opinions about how to handle disagreement.

It's the last node in the flow - Algorithm β†’ Divide Select β†’ [your enhancement] β†’ Combine - and it's intentionally simple to wire: three required inputs, one IMAGE out. The smarts are in the optional knobs.

How it works

Combine places each processed tile back into its exact padded box from the plan, resizing it to match if your enhancement changed its dimensions. Then it applies the mask you fed in - not a mask it regenerates. That's a design decision worth respecting: split and merge stay aligned because both use the same masks, and it's why you must pass Divide Select's MASK(S) through untouched.

There are two combine_modes:

  • owner_alpha_over (default) - each tile is pasted over what's already on the canvas, weighted by its mask. Owner tiles overwrite; neighbors only touch in the blend band.
  • normalized - accumulates weighted sums and divides at the end. Softer, more "fair" averaging. The README keeps it around for comparison, and for difficult enhancement passes it usually loses to the default.

On top of that, Combine runs adaptive local dominance: it compares each incoming tile against what's already pasted, measures the local disagreement (a per-pixel RGB difference) and the local edge strength (a Sobel filter), and sharpens the mask transition in zones where they're high. Tiles that agree blend gently; tiles that visibly disagree get a decisive owner, which is what suppresses ghosting and duplicated structure.

The inputs that matter

  • tiles / masks / egregora_data - required, in that order from Divide Select. The plan tells Combine where each box sits.
  • scaling_method - how a processed tile is resized back to its box if needed. lanczos default.
  • combine_mode - see above. Leave it on owner_alpha_over unless you're A/B testing.
  • dominance_gamma (1.30) - the base strength of ownership in the blend band. Higher = more decisive, less mixing.
  • conflict_boost (0.90) - how much disagreement increases decisiveness. This is your ghosting dial.
  • edge_boost (0.75) - how much local edge structure increases decisiveness. Cables, hair, metal, text - the thin high-frequency stuff that duplicates worst.
  • conflict_power / edge_power - shape how those two maps respond after normalization; lower makes them broader and more sensitive, higher concentrates them on the strongest zones.
  • transition_focus (1.50) - whether the adaptive behavior hugs the center of the seam or spreads through the whole band.

The README's tested baseline is dominance_gamma 1.30, conflict_boost 0.90, edge_boost 0.75, conflict_power 1.00, edge_power 1.20, transition_focus 1.50. Start there and treat it as one of the rare packs where the defaults are worth trusting.

Install

# ComfyUI Manager: search "Egregora" (pack title "ComfyUI Β· Egregora: Divide & Enhance")

# or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/lucasgattas/ComfyUI-Egregora-Divide-And-Enhance.git

Restart ComfyUI. No requirements.txt, no model downloads, pure torch. GPL-3.0.

Gotchas

Two honest ones. First: if you're seeing ghosting, reach for conflict_boost and dominance_gamma - but remember the mask width itself was set back at Divide Select. The adaptive logic can only sharpen a transition that exists; to widen the blending zone you have to re-run the divide stage with a bigger blend_px. Second: Combine composes whatever it's given, so if you selected a single tile in Divide Select you'll get a one-tile canvas. It's also reading tiles and masks positionally - if your enhancement drops tiles or reorders them, the boxes won't line up. Keep the lists intact.

CategoryEgregora/Core

Inputs (11)

NameTypeDefaultDescription
tilesIMAGEβ€”
masksMASKβ€”
egregora_dataEGREGORA_DATAβ€”
scaling_methodCOMBOlanczos5 options: nearest-exact, bilinear, area, bicubic, lanczos
combine_modeoptCOMBOowner_alpha_over2 options: owner_alpha_over, normalized
dominance_gammaoptFLOAT1.300.1–8β€”
conflict_boostoptFLOAT0.900–8β€”
edge_boostoptFLOAT0.750–8β€”
conflict_poweroptFLOAT1.000.1–8β€”
edge_poweroptFLOAT1.200.1–8β€”
transition_focusoptFLOAT1.500.1–8β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”