Apply Flux SEG Attention
The sharper, fiddlier detail booster
- model
- attn_override
- MODEL
SEGAttention implements Smoothed Energy Guidance for Flux, the second of the pack's two training-free enhancement nodes (the other is PAGAttention). Where PAG compares against a structurally broken attention, SEG blurs the image queries before attention runs, computes the "energy" of that smoothed pass, and guides generation to increase it - which in practice sharpens detail and structure. In the README's three-way comparison, SEG is the one on the right that looks most finished, and it's also the one with more knobs to fiddle.
How it works
The node patches the attention so that, inside the guided forward pass, the image query tokens are gaussian-blurred before being used. Blurred queries can't pick out fine structure - the attention map they produce is smoother, lower-energy. The sampler then steers the output toward the gap between the normal prediction and the smoothed one, scaled by scale (default 3.0). In other words: it rewards whatever detail the blur destroyed.
The extra inputs compared to PAG:
- blur (FLOAT, default 10.0) - the gaussian blur radius applied to the queries. Larger blur = more structure removed = stronger guidance. Zero disables the whole effect.
- inf_blur (BOOLEAN, default false) - a mode that replaces the gaussian with an "infinite" blur (mean pooling over the whole image), a cruder but sometimes more stable smoothing. Handy when gaussian blur at your resolution is unstable.
- attn_override (ATTN_OVERRIDE, optional) - which blocks get the smoothed attention (default: single block 0).
Output:
- MODEL - the patched model, straight into your existing guider/sampler chain.
Installation
Standard for the pack: ComfyUI Manager → search "ComfyUI-Fluxtapoz" → install → restart, or git clone https://github.com/logtd/ComfyUI-Fluxtapoz into custom_nodes. Only einshape, no model downloads.
Common issues
- Halos or smearing - the classic gaussian-blur artifact. Drop blur toward 5, or drop scale. If you're at high resolution, the blur radius interacts with it; that's what inf_blur is for.
- "Nothing happened." Scale 0 or blur 0 both disable the effect. With blur 0 the code short-circuits before any guidance.
- SEG vs PAG - SEG is the sharper tool with more failure modes; PAG is the set-and-forget one. If you want one knob and done, PAG; if you want to push detail and don't mind tuning, SEG. Some people run both on different layers via FluxAttnOverride, which is a very Fluxtapoz thing to do.
For the price of an extra forward pass per step, SEG is one of the better free quality levers on Flux - just give it a few minutes of tuning before you judge it.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| scale | FLOAT | 3.000–100 | — |
| blur | FLOAT | 10.000–999 | — |
| inf_blur | BOOLEAN | false | — |
| attn_overrideopt | ATTN_OVERRIDE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |