πͺ Attention Modifier Bruteforce
Brute-force which layer does what
- join_parameters
- Attention modifier
- Parameters as string
The hardest part of the pack's attention modifiers isn't writing the expression - it's finding which UNet block to aim it at. There are dozens of them, they're numbered confusingly, and every checkpoint reacts differently. Attention Modifier Bruteforce is the pack's answer to that: instead of making you pick a block, it cycles through a list of blocks for you, driven by the seed. Change the seed, get a different block; iterate until one of them does what you want.
How the cycling works
You give it three comma-separated lists - unet_block_id_input, unet_block_id_middle, and unet_block_id_output (defaults like 4,5,7,8 / 0 / 0,1,2,3,4,5). The node flattens them into one sequence - all the input blocks, then middle, then output - and picks one entry using seed % len(sequence). So seed 0 targets the first block, seed 1 the second, and so on. Same seed, same block: deterministic, which is the whole point when you're A/B testing generations.
That's what "bruteforce" means here - it's not a clever search, it's a controlled rotation. Bump the seed by one, regenerate, and compare. The Parameters as string output even tells you your progress: Progress: 3/12 plus which block is currently selected. When you land on a block that produces the effect you want, note the seed, then take the same settings over to Attention Modifier Parameters to lock it in without the rotation.
The other inputs
The rest is shared with the sibling modifier nodes:
- self_attn_mod_eval - the Python expression for the attention modification (default
attnopt). - sigma_start / sigma_end - the sigma window where the patch is live (defaults 1000 β 0 = whole run).
- unet_attn - Self-Attention Only, Cross-Attention Only, or Both.
- join_parameters (optional) - chain this onto an existing ATTNMOD wire.
Outputs: the Attention modifier (ATTNMOD wire) and the Parameters as string.
Where it fits and what to watch
Like every modifier in this pack, it does nothing on its own - the ATTNMOD output has to feed the Advanced CFG Controller (Expert) node's attention_modifiers_positive (or _negative/_global) input to be applied. The standard flow: Bruteforce β (Concat if you're stacking) β Expert.
Two honest warnings. First, the "cycling" is per-wire, not per-generate - the node picks one block and sticks with it for that run, so to actually scan blocks you regenerate with a new seed each time. Second, this whole attention-modifier subsystem is the newest, least-tested part of a pack that already has no community footprint. In this early build the expression field is treated more as a backend selector than a full eval, so keep the Parameters string visible and sanity-check that the block you think you're patching is the one in the payload. Treat it as a tinkering tool with training wheels - the training wheels being the seed, which is the one knob that can't break anything.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00β18446744073709550000 | Seed for selecting which attention block to modify |
| sigma_start | FLOAT | 1000.00β10000 | Start applying attention modifications at this sigma level |
| sigma_end | FLOAT | 0.00β10000 | Stop applying attention modifications at this sigma level |
| self_attn_mod_eval | STRING | Python expression for attention modification | |
| unet_block_id_input | STRING | Input block IDs to cycle through (comma-separated) | |
| unet_block_id_middle | STRING | Middle block IDs to cycle through (comma-separated) | |
| unet_block_id_output | STRING | Output block IDs to cycle through (comma-separated) | |
| unet_attn | COMBO | Both Attention Types | Which attention layers to modify |
| join_parametersopt | ATTNMOD | Chain multiple attention modifiers together |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Attention modifier | ATTNMOD | β |
| Parameters as string | STRING | β |