AReA Patch (FLUX.1 High-Res Attention)
What the AReA Patch Is Actually Doing to Attention
- model
- MODEL
The wall this node is aimed at
FLUX.1 was trained on 1024px tiles and is comfortable to about two megapixels. Past that things get strange: two heads, a duplicated torso, detail that dissolves the way scaling-and-tiling always does. The standard workaround is the hi-res fix - generate small, upscale, second pass at 0.3–0.5 denoise so the model adds detail without redesigning the picture.
AReA is a different lever. It comes from a 2026 paper (Rajabi et al., "Adaptive Receptive-Field Attention") and it trains nothing, tiles nothing, changes no weights. It swaps FLUX's self-attention for something that stays sane above the training resolution, so a 3072×1728 canvas is one coherent generation instead of a stitched one. The AReA Patch node is the switch: a MODEL in, a wrapped MODEL out, everything downstream unchanged.
How it works, in plain terms
FLUX's attention compares every image token to every other image token, and its rotary positions are indexed off the training grid. Push to 4K and you're not just paying quadratic cost, you're asking a 1024-native model to reason about positions it has never seen.
The patch fixes both problems in two phases, and the switch between them is decided by step index, not by resolution.
Phase I runs for the first phase1_steps of the schedule. Keys and values get pooled - one token stands in for each f×f block of the patch grid, chosen by subsample, mean, medoid or random - with a bespoke coarse RoPE so queries and pooled keys are measured in the same units. A 128×128 grid gets read roughly as if it were 64×64. That's where pose, room and framing get decided.
Phase II takes over for the rest. Attention becomes windowed, but not at a fixed size: it costs out each candidate against one full-attention pass and picks. A Halo ring of neighbouring patches (up to halo wide) overlaps each window, and a global-KV "bridge" of bridge_ratio tokens pulls in the most informative keys from outside it. A wavelet detail map gates where windows split, so busy areas are worked finer than empty sky.
None of this touches ComfyUI's source - it hooks four documented ModelPatcher extension points, so updates are less likely to break it than packs that monkeypatch comfy/ldm/flux.
The settings you actually touch
Six of the seven inputs have defaults good enough that you can leave them. Start here:
phase1_steps(default 8) - the one that matters most. "8 of 28 for txt2img" is a proportion, not a magic number: keep it around the first third of your step count. On an 8-step turbo run, leaving this at 8 means Phase I eats the whole generation and nobody ever sees a window. For img2img super-resolution it goes to 0, since the structure already exists.native_patches(default 64) - "native training extent in patches per side (FLUX.1: 64 = 1024 px). Canvases at or below this keep plain attention." Translation: the node is inert below 1024px, so leaving it wired into a template costs you nothing on small runs.halo(8) andbridge_ratio(0.5) - the anti-tiling knobs. Raise the halo if you see seams along window edges; raise the bridge if the image reads locally nice but globally incoherent.
pooling you can ignore. seed here does not change your picture - it only draws window jitter, halo widths and random pooling. Your sampler's seed is the one that matters.
Output is a single MODEL, wired wherever your model went before.
Installing it
ComfyUI Manager has it under "ComfyUI-AReA". By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI-AReA
# restart ComfyUI
There is no requirements.txt and nothing to pip install - torch, numpy and tqdm are already in ComfyUI. No extra weights either: the README's checkpoint note is just "normal ComfyUI dit vae and te", i.e. your existing FLUX.1 stack in models/diffusion_models, models/text_encoders and models/vae. The author links the FLUX Turbo LoRA, which the bundled example workflow uses to make 2K runs tolerable.
Load example_workflows/AReA-flux.json before building anything from scratch. It has two paths - a bootstrap txt2img branch at 2048 and an img2img second pass with phase1_steps at 0 - and copying its wiring beats guessing.
Where it bites
"AReA requires a ComfyUI-native FLUX.1 checkpoint." That's the node's own error and it's exact: it checks the loaded diffusion model really is ComfyUI's Flux class with its double/single blocks, pe_embedder and three RoPE axes. All-in-one checkpoints, SDXL models and diffusers-style repos trip it. Load flux1-dev.safetensors (or its fp8 variant) through UNETLoader with clip_l + t5xxl and ae.safetensors.
Kontext, Fill and Redux edits get nothing. When reference latents are present the patch steps aside and lets plain attention run - a safety decision in the code, not something you can configure around. This pack is for plain FLUX.1, which is all the README's "only support flux now" means.
It's not a memory miracle. Windowed attention cuts the cost curve; it doesn't make a 4096² canvas free. At 4K your VAE decode is often what dies, so turn on tiled VAE before blaming the sampler.
One honest note on the author: smthemex (smthem on Hugging Face) ships ComfyUI ports of papers at a pace that's impressive and occasionally rough - names that don't match the workflow, workflows that assume a pack you haven't got. He's usually first to a working port of whatever dropped this week. Treat the bundled workflow as part of the install.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| pooling | COMBO | subsample | Phase I: which token represents each f x f block. |
| phase1_steps | INT | 80–64 | Phase I (cross-scale coarse attention) steps. 8 of 28 for txt2img; set 0 for img2img super-resolution (structure already exists, Phase II only). |
| halo | INT | 80–32 | Phase II: largest Halo width, in patches. |
| bridge_ratio | FLOAT | 0.500–1 | Phase II: each window gets (ratio * w)^2 global-KV bridge tokens. |
| seed | INT | 00–18446744073709550000 | Draws window boundary jitter, Halo widths and random pooling. |
| native_patches | INT | 6416–256 | Native training extent in patches per side (FLUX.1: 64 = 1024 px). Canvases at or below this keep plain attention. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |