ComfyUI Node
AReA
AReA (arXiv 2610.17227). Replaces FLUX / Z-Image / Krea-2 / Qwen-Image-2.1 image self-attention with a time-dependent attention graph: coarse cross-scale attention on leading steps, DWT-guided windowed attention (Halo + bridge tokens) on the rest. Training-free; a no-op at or below 1024 px.
AReA
- model
- Patched Model
◄width2048►
◄height2048►
◄model_typeauto►
◄enable_areatrue►
◄phase1_steps8►
◄phase1_modeauto►
◄phase1_sigma0.89►
◄poolingauto►
◄halo8►
◄bridge_ratio0.50►
◄bridge_floor_steps2►
◄window_start0►
◄window_hold_steps0►
◄seed0►
CategoryWMNodes/image
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model to patch with AReA. FLUX, Z-Image (Lumina2), Krea-2 and Qwen-Image-2.1 share the same 16 px patch grid, so the same width/height serve any of them. | |
| width | INT | 204816–16384 | Target image width. Must match the width of your empty latent — AReA builds its schedule from this geometry and validates it against the latent at every forward. |
| height | INT | 204816–16384 | Target image height. Must match the height of your empty latent. |
| model_type | COMBO | auto | Specify the model architecture. 'auto' usually works. FLUX and Z-Image (Lumina2 / NextDiT) share a 16 px patch grid, so the same width/height serve either; Krea-2 (SingleStreamDiT) uses the same 16 px token grid (ASSUMED — its VAE downscale is unverified, so a 16x VAE would make its token 32 px) and needs no padding; Qwen-Image-2.1 (QwenImage21Transformer2DModel) uses the same 16 px token grid (MEASURED — its latent format downsamples 16x and 2.1 does not patchify) and pads nothing, and AReA switches its prefix K/V cache off on its own clone (the cached path is indistinguishable from the image segment, so with the cache on AReA would engage on no call at all); Nunchaku's fused kernels bypass the attention seam, so it is reported unchanged. |
| enable_area | BOOLEAN | true | Enable or disable AReA. When disabled, the model is returned with nothing patched. |
| phase1_steps | INT | 80–100 | Number of leading denoising steps that run Phase I (coarse cross-scale attention), clamped to the total step count. 8 = the reference's FLUX constant (of 28). 0 = all Phase II (windowed attention from the first step). Only read when phase1_mode is 'steps'. Z-Image Turbo runs short (8-step) schedules: use 1-3 there (or sigma mode) — 8 of an 8-step run pools every step, which the distilled sampler cannot re-detail. On a SHORT schedule the effective coarse steps are capped at total_steps - 2 (two fine steps must remain, or the pooling footprint never heals): the forward-time log prints the knob, the cap and the effective count once per schedule, so a capped run is readable and the knob stays authoritative below the cap. |
| phase1_mode | COMBO | auto | How the Phase I -> Phase II switch is expressed. 'auto' = resolved per backbone: 'sigma' on Z-Image and Qwen-Image-2.1 (the leading steps still at or above phase1_sigma run Phase I, so the switch follows the schedule) and 'steps' on FLUX and Krea-2. 'steps' = the leading phase1_steps steps run Phase I (the reference's mode). 'sigma' = the leading steps whose noise level is still at or above phase1_sigma run Phase I, so the switch follows the schedule rather than a fixed count (8 of 28 sits at a sigma of roughly 0.88 on a shift-3.0 flow). 'bootstrap' = the paper's Appendix F mode: no Phase I at all, windowed Phase II from the first step; the early steps must have composed the canvas in a separate native-resolution pass whose latent was upscaled and re-noised to phase1_sigma (see the README pattern). |
| phase1_sigma | FLOAT | 0.890–1 | Noise level at which Phase I gives way to Phase II, when phase1_mode is 'sigma'. 0.89 = the paper's value for its first backbone; 0.86 was its Qwen-Image value, so treat this as per-schedule calibration rather than a universal constant. |
| pooling | COMBO | auto | Phase I pooling: which token of each f x f image block the pooled key/value comes from. 'auto' = resolved per backbone: 'subsample' on FLUX, 'mean' on Z-Image and Krea-2, 'medoid' on Qwen-Image-2.1. 'subsample' = block centre. 'mean' = block average for values, and for keys the block-mean direction rescaled to the mean member norm (the centroid keeps every token contributing while the norm keeps the attention temperature at the un-pooled one). 'medoid' = the token closest to the block-mean key — on Qwen-Image-2.1 it keeps ONE real token's key AND value, so the pooled cell carries a single content instead of a synthetic key over a blended value. 'random' = a token drawn per (seed, step, block). Keys must be pooled BEFORE the position rotation, so all four keep the survivors in the query's frame. |
| halo | INT | 80–64 | Widest Halo ring a Phase II window may draw (in patches). Each side of each window draws its own fresh width in [0, halo] at every step; AReA narrows it only when the windowed step would otherwise cost more than a full-attention step. |
| bridge_ratio | FLOAT | 0.500–1 | Rho of the bridge: each Phase II window also attends to R = round(rho * w)^2 of the canvas's most distinctive unrotated keys, spread over an 8x8 cell grid so no region is starved. 0 = no bridge. |
| bridge_floor_steps | INT | 20–16 | How many leading Phase II steps keep the paper's full bridge (R = round(rho*w)^2) and the full halo instead of the cost-capped ones. On short schedules (12 total steps or fewer) the cost cap starves the bridge exactly on the composition-critical steps, so those steps are exempted here; a 28-step FLUX run is never floored (long schedules ignore this knob). 0 = the cost cap on every step. The exemption costs about 1.0-1.4x full attention per floored step (measured 1.25x-1.41x on the 2048px Turbo schedule), and warns once naming the multiplier. |
| window_start | INT | 00–1024 | Window side (patches) Phase II starts its ramp at, instead of the cost-optimal size — smaller gives the early windows more global context. Short schedules only: a long (28-step) schedule ignores this knob. 0 = the cost-optimal start, which is clamped into [w_min, grid]; the ramp still shrinks to w_min. |
| window_hold_steps | INT | 00–8 | Extra Phase II steps that hold the start window before the ramp shrinks it (a start-heavy ramp for short schedules). Short schedules only: a long (28-step) schedule ignores this knob. |
| seed | INT | 00–18446744073709550000 | Seed of every draw (tile placement, Halo widths and reaches, random pooling). Keyed by (seed, step), so the same seed and step always build the same windows and halos — and cond and uncond attend through identical graphs. No global RNG is read. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Patched Model | MODEL | The model patched with AReA. |