π‘οΈ Attention Modifier Single Layer Temperature
Sharpen or soften one block
- join_parameters
- Attention modifier
- Parameters as string
Attention temperature is the dial that sits between "too deterministic" and "too diffuse." Before the softmax, attention logits are divided by a temperature; below 1.0 the distribution sharpens (fewer, stronger attention targets - crisper, more focused), above 1.0 it softens (more diffuse mixing - smoother, less spiky). You almost never get to set that per layer. Attention Modifier Single Layer Temperature does exactly that: apply a temperature scaling to one attention layer's computation, for a chosen sigma window, and nothing else.
The inputs
The usual targeting trio, plus one number:
- block_name - Input Blocks, Middle Block, or Output Blocks.
- block_number - the block within that group (0β12).
- unet_attn - Self-Attention Only, Cross-Attention Only, or Both.
- temperature - the dial itself. 1.0 is no change (the tooltip is explicit: "<1.0 = sharper, >1.0 = softer"). A 0.85 on a block that's producing mushy anatomy, a 1.1 on one that's spiking artifacts - those are the realistic moves.
- sigma_start / sigma_end - when it's active; keep it narrow to isolate the effect.
- join_parameters (optional) - chain onto an existing ATTNMOD.
Outputs: the Attention modifier (ATTNMOD wire) and Parameters as string.
How it works, and the honest caveat
The node builds a payload whose expression calls a temperature_patcher(...) helper - a class that reimplements ComfyUI's basic attention with a temperature applied to the logits before softmax. If you've ever poked at comfy.ldm.modules.attention, the code will look familiar, because it's a copy of the basic path with the temperature baked into the scale factor.
Here's the part worth knowing before you build a workflow around it: in this early release, the temperature_patcher class lives in an experimental_temperature.py module that the pack doesn't actually import, and the modifier sub-system's expression handling is minimal. The upshot is this node is the roughest of a rough bunch - it can throw at generation time until the pack wires that helper in. If it does error, that's not your graph's fault, and there's no community to ask yet; this pack has zero footprint out in the wild. My take: it's a fun idea worth one afternoon of experimentation, but don't put it in anything you need to ship today.
When it works, the pattern is: feed the ATTNMOD into the Advanced CFG Controller (Expert) node's attention_modifiers_positive input, keep the sigma window tight, and watch what one block's sharpness does to your output. Install is the pack's usual git clone into custom_nodes plus restart - no models, no extra deps, node lives under model_patches/Advanced_CFG_Controller/attention_modifiers.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| sigma_start | FLOAT | 1000.00β10000 | Start applying temperature scaling at this sigma level |
| sigma_end | FLOAT | 0.00β10000 | Stop applying temperature scaling at this sigma level |
| block_name | COMBO | Input Blocks | Which UNet block type to modify |
| block_number | INT | 00β12 | Specific block number within the block type |
| unet_attn | COMBO | Both Attention Types | Which attention layers to apply temperature scaling |
| temperature | FLOAT | 1.000β10000 | Temperature scaling factor (1.0 = no change, <1.0 = sharper, >1.0 = softer) |
| join_parametersopt | ATTNMOD | Chain multiple attention modifiers together |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Attention modifier | ATTNMOD | β |
| Parameters as string | STRING | β |