Near-sighted Attention
Tiles, pools, and actually gets faster at 1024
- model
- MODEL
This is the flagship of the pack. Near-sighted Attention takes the HyperTile-style tiling of the tile node and stacks the K/V pooling of Slothful Attention on top - two mechanisms, one node, a wall of settings, and a real speed story at bigger resolutions. The author's own numbers show +57.4% on UNet speed at 1024×1024 (−9.4% at 512×512), so it's the node to reach for when you're generating large and want both control and a faster render.
How the two halves work
The tiling half is the HyperTile trick, a fixture of 2024 high-res workflows: the spatial map of a self-attention layer is split into tiles and each tile becomes its own query. Instead of every pixel attending to every pixel, a tile attends to its own neighborhood plus a downsampled view of the whole image - near-sighted, literally. The K and V you end up with are the tile's local samples concatenated with that coarse global view, and the ratio inputs set the balance. High ratio keeps global context (read: consistency); low ratio lets tiles go fully local (read: more detail, more risk of the image falling apart). Tiles get a deterministic per-step random offset so seams don't land in the same place and show up as grid artifacts.
The pooling half is Slothful Attention on top: K and V get thinned by a slothful rate that's decayed by depth and by a Gaussian window over time, with separate in_* / out_* settings for input vs output blocks and AVG/MAX/1D/2D modes. So you get locality from the tiling and style control from the pooling in a single pass.
The settings that matter
There are a lot. In rough order of how much they'll change your output:
base_tile_size/peak_tile_size- tile size in latent space (64 ≈ 512×512 px on SD1.5's shallowest layer). The base value applies early in sampling, the peak value at the peak of the schedule. Smaller tiles = more local detail, weaker consistency.base_global_ratio/peak_global_ratio- the local-vs-global balance over the schedule. The README suggests keepingpeak_global_ratiohigh to protect consistency in the final steps.tiling_max_depth(default 2) - how deep into the U-Net the tiling applies. Above that depth, layers fall back to plain slothful pooling.in_slothful/out_slothfuland the blends - the style knobs carried over from Slothful Attention:in_k_blendquiets fine detail,out_v_blenddrives contrast and sharpness.
One warning the author is explicit about: low tile_size combined with high slothful starves K and V. Both mechanisms shrink the key/value set, and stacked they can leave attention with almost nothing to look at - quality degrades visibly. If that happens, raise the tile size or drop slothful.
Using it
Same wiring as every node in this pack: model in from your loader, patched MODEL out into the KSampler. Slothful Attention alone is a control node; this is where the speed at 1024+ actually shows up.
Install is the shared story: search ComfyUI Manager for "ComfyUI Nearsighted Attention" - the pack was renamed after it shipped as "Slothful Attention," and the registry only knows the new name. The old comfyui_slothful_attention repo 404s now:
cd ComfyUI/custom_nodes
git clone https://github.com/MitoshiroPJ/comfyui_nearsighted_attention
Restart and you're set. No pip packages, no model downloads - torch and einops already ship with ComfyUI. Author-tested on SD1.5, SDXL and SSD-1B; LoRA, LCM-LoRA, ControlNet and IP-Adapter all work.
Troubleshooting
- Attention patchers conflict. Hypernetwork and token merging (ToMe) patch attention too, and the README flags the combination as likely to cause problems.
- Consistency dies before detail does. If the image goes blobby or incoherent, raise
peak_global_ratioandpeak_tile_sizebefore touching the slothful side. - Not a small-image win. Below ~1024×1024 you're paying patch overhead for little speed; this node earns its keep at high res.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| tiling_max_depth | INT | 21–3 | — |
| peak_time | FLOAT | 0.40–1 | — |
| time_decay | FLOAT | 2.00–4 | — |
| base_tile_size | INT | 2416–64 | — |
| peak_tile_size | INT | 3216–64 | — |
| base_global_ratio | FLOAT | 0.20–1 | — |
| peak_global_ratio | FLOAT | 0.80–1 | — |
| in_mode | COMBO | 2D_AVG | 4 options: 1D_AVG, 1D_MAX, 2D_AVG, 2D_MAX |
| in_depth_decay | FLOAT | 2.00–4 | — |
| in_slothful | FLOAT | 6.00–50 | — |
| in_k_blend | FLOAT | 0.000–1 | — |
| in_v_blend | FLOAT | 0.000–1 | — |
| out_mode | COMBO | 2D_AVG | 4 options: 1D_AVG, 1D_MAX, 2D_AVG, 2D_MAX |
| out_depth_decay | FLOAT | 2.00–4 | — |
| out_slothful | FLOAT | 4.00–50 | — |
| out_k_blend | FLOAT | 0.000–1 | — |
| out_v_blend | FLOAT | 0.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |