Nodes/ComfyUI Slothful Attention/Near-sighted Attention
ComfyUI Node

Near-sighted Attention

Tiles, pools, and actually gets faster at 1024

By MitoshiroPJ·Created 3 years ago·Updated about a year ago· 7
Near-sighted Attention
  • model
  • MODEL
tiling_max_depth2
peak_time0.4
time_decay2.0
base_tile_size24
peak_tile_size32
base_global_ratio0.2
peak_global_ratio0.8
in_mode2D_AVG
in_depth_decay2.0
in_slothful6.0
in_k_blend0.00
in_v_blend0.00
out_mode2D_AVG
out_depth_decay2.0
out_slothful4.0
out_k_blend0.00
out_v_blend0.00

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 keeping peak_global_ratio high 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_slothful and the blends - the style knobs carried over from Slothful Attention: in_k_blend quiets fine detail, out_v_blend drives 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_ratio and peak_tile_size before 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.
CategorySlothfulAttention

Inputs (18)

NameTypeDefaultDescription
modelMODEL
tiling_max_depthINT21–3
peak_timeFLOAT0.40–1
time_decayFLOAT2.00–4
base_tile_sizeINT2416–64
peak_tile_sizeINT3216–64
base_global_ratioFLOAT0.20–1
peak_global_ratioFLOAT0.80–1
in_modeCOMBO2D_AVG4 options: 1D_AVG, 1D_MAX, 2D_AVG, 2D_MAX
in_depth_decayFLOAT2.00–4
in_slothfulFLOAT6.00–50
in_k_blendFLOAT0.000–1
in_v_blendFLOAT0.000–1
out_modeCOMBO2D_AVG4 options: 1D_AVG, 1D_MAX, 2D_AVG, 2D_MAX
out_depth_decayFLOAT2.00–4
out_slothfulFLOAT4.00–50
out_k_blendFLOAT0.000–1
out_v_blendFLOAT0.000–1

Outputs (1)

NameTypeDescription
MODELMODEL