StyleAligned Batch Align
StyleAligned Batch Align
- model
- MODEL
You've generated a batch of four from the same prompt and they don't look like a batch - one's soft and painterly, the next is crunchy and saturated like a completely different model made it. That's just how diffusion batches work: every item in the batch denoises on its own random trajectory, so even identical prompts and settings drift apart in texture, palette and lighting by the time you can recognize the content. Batch Align is a one-node fix for exactly that: it forces every other image in the batch to match the first image's style, with no training and no reference image needed.
The trick behind it is the StyleAligned technique from a 2023 Google Research paper, and it's a genuinely clever observation: a lot of what reads as "style" isn't in the content, it's in the statistics of self-attention - the query/key pairs and the running normalization stats the model computes at each denoising step. If you force every image in a batch to reuse the first image's attention keys/values and normalization stats at each shared step, the rest of the batch ends up sharing brushwork and palette even though the actual content (a robot vs. a castle vs. a cat) is totally different. That's the whole mechanism - no cross-attention to a reference image, no LoRA, just patching how attention and normalization behave inside the sampler for the duration of that batch.
Practically, this node is a model patcher, the same shape as a LoRA loader: you feed it your model, it hands back a patched model, and you wire that straight into a normal KSampler like nothing changed. The patch only does anything useful once batch_size on your sampler is greater than 1 - at batch size 1 there's only one image, so there's nothing for it to align to.
The knobs that matter:
share_attn- which parts of self-attention get shared. Defaultq+k; set it toq+k+vfor a stronger, more extreme sharing effect, at the cost of image quality in some cases (the README says this outright, and it tracks - sharing values too means less of each image's own content survives).share_norm- whether normalization is shared too. Defaultboth; setgrouporlayerif you want a lighter touch.scale- how hard the effect is applied, 0–1, default 1.
Install it the normal way: search "StyleAligned for ComfyUI" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/brianfitzgerald/style_aligned_comfy and restart. No extra models, no extra Python dependencies - the README is explicit about that, which is refreshing for a node that's touching attention internals.
One thing worth knowing before you reach for this in 2026: the repo carries a maintenance banner saying it's no longer actively maintained, and that lines up with what the community's actually doing - StyleAligned had a real moment right when it landed in late 2023, then discussion basically stopped by 2024 as people moved to IP-Adapter and, more recently, to instruction-editing models like Qwen-Image-Edit for style and character work. It still works the way it always did. It just isn't where new development happens.
A few practical landmines:
It's built for SDXL/SD1.5-era UNet attention blocks. The patch was written before Flux, SD3, Wan, or Qwen existed, and those are DiT architectures with a completely different attention layout - nothing here suggests the pack was updated to target them, and given the "no longer maintained" banner, don't expect it to. If you're generating on a modern base model, this node has nothing to attach to.
If results look muddy or lose detail, back off share_attn to q+k (not q+k+v) and drop scale a bit before giving up on the node entirely - full-strength q+k+v sharing is the setting most likely to flatten out the content you actually wanted.
Stacking this with other attention-patching nodes (other style/consistency nodes, some IP-Adapter setups) on the same model is where things get unpredictable - two patches fighting over the same attention layers rarely behaves the way either one alone does. If you're chasing a bug, unplug the other patches first.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| share_norm | COMBO | 4 options: both, group, layer, disabled | |
| share_attn | COMBO | 3 options: q+k, q+k+v, disabled | |
| scale | FLOAT | 1.00–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |