π Egregora Combine
Putting enhanced tiles back together without the ghosting
- tiles
- masks
- egregora_data
- IMAGE
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.
lanczosdefault. - combine_mode - see above. Leave it on
owner_alpha_overunless 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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| tiles | IMAGE | β | |
| masks | MASK | β | |
| egregora_data | EGREGORA_DATA | β | |
| scaling_method | COMBO | lanczos | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
| combine_modeopt | COMBO | owner_alpha_over | 2 options: owner_alpha_over, normalized |
| dominance_gammaopt | FLOAT | 1.300.1β8 | β |
| conflict_boostopt | FLOAT | 0.900β8 | β |
| edge_boostopt | FLOAT | 0.750β8 | β |
| conflict_poweropt | FLOAT | 1.000.1β8 | β |
| edge_poweropt | FLOAT | 1.200.1β8 | β |
| transition_focusopt | FLOAT | 1.500.1β8 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |