Slothful Attention
The no-training knob that makes your model think less
- model
- MODEL
The name is the pitch. Slothful Attention doesn't call an API, needs no key, downloads no model - it just makes the diffusion model's self-attention lazier by feeding it fewer key and value samples, and that alone changes how your image comes out. You drop it on the MODEL wire between your checkpoint loader and the sampler, and suddenly you have a handful of sliders that shift the output from "crisper, noisier, more detailed" to "smoother, cleaner, more composed." No training, no LoRA, no extra files. For a control node, that's the whole trick.
What it actually does
Every self-attention layer in the U-Net deals in queries, keys and values: Q asks "what should I look at," K and V are the things it looks at. This node leaves Q alone and thins out K and V. It's essentially Spatial-Reduction Attention - pool the keys and values down to fewer samples, run attention against the smaller set, and the model can't obsess over every pixel anymore.
The raw reduction rate is in_slothful / out_slothful (defaults 6 and 4), but that rate gets decayed on its way into the network:
peak_timeandtime_decayshape strength across the sampling schedule. Effect peaks atpeak_time(default 0.4) and falls off on both sides, faster astime_decayrises. It's a Gaussian window over denoising steps, and it's how you keep early composition and late detail from getting mangled.in_depth_decay/out_depth_decayscale the rate down in the shallow, high-resolution blocks - where pooling would hurt most - so most of the thinning lands at low-res depths where it's cheap.
If the effective rate after both decays drops below 1, the patch is skipped entirely, and the middle block is always left alone. That's also why there's no speedup at small sizes: at 512×512 most blocks skip and you just pay the patch overhead (the author's own table shows −8.5%). At 1024×1024 it's +28.7% on UNet speed.
The knobs that actually matter
Each in_* / out_* parameter applies to the input blocks or the output blocks separately, which is a lot of surface area. The author's own tips keep landing on two: in_k_blend and out_v_blend.
The reduction blends two ways of shrinking K and V: "one" (take every nth sample) and "pool" (average or max-pool n samples). in_k_blend / in_v_blend set that blend for keys vs values independently, and in_mode / out_mode pick 1D (pool across width only) or 2D (both axes) and AVG or MAX. Pure average pooling reads like blur; pure max pooling reads like sharpness.
A rough guide from the README and real use:
- Raise
in_k_blendtoward 0.3–0.5 to quiet noise and fine detail - it reads a bit like a bokeh softness. The author notes biggerin_k_blendreduces noise. out_v_blendis your contrast/sharpness dial. AVG modes come out softer and lower-contrast; MAX modes harder and punchier.- Keep blends at or below 0.5 - past that, output quality starts paying.
- If the image turns mushy, raise
time_decayor lowerpeak_timeto weaken the effect in the final steps.
The single output is a MODEL, and it wires straight into your KSampler's model input. One node in, same sampler out.
Install
ComfyUI Manager is the easy route - but search for "ComfyUI Nearsighted Attention", not "Slothful." This pack was renamed after it shipped, the Manager registry only carries the new name, and the old comfyui_slothful_attention URL now returns a 404. The live repo:
cd ComfyUI/custom_nodes
git clone https://github.com/MitoshiroPJ/comfyui_nearsighted_attention
Restart ComfyUI and the node appears as "Slothful Attention" in the menu. No pip installs, no model downloads - it only needs torch and einops, both already inside ComfyUI. Tested by the author on SD1.5, SDXL and SSD-1B, and it plays nice with LoRA, LCM-LoRA, ControlNet and IP-Adapter.
Troubleshooting
- It's a control node, not a performance hack. Don't expect gains below ~1024×1024; at small sizes it's neutral-to-slightly-slower.
- Attention patchers clash. Hypernetwork and token merging (ToMe) patch attention too, and the README warns they can conflict with this node. If you see weird outputs, check what else is patching the model.
- Blends too high. Past ~0.5 on
in_v_blend, outlines get mushy. Ease back. - K/V starvation is the general failure mode: if the decayed reduction rate makes K and V tiny, detail vanishes. Lower
slothfulor raisetime_decay.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| peak_time | FLOAT | 0.40–1 | — |
| time_decay | FLOAT | 2.00–4 | — |
| 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 | — |