StyleAligned Batch Align ♾️Mixlab
Make everything in a batch look like it belongs together
- model
- MODEL
StyleAligned Batch Align is Mixlab's port of Google's StyleAligned technique (via brianfitzgerald's style_aligned_comfy), and the "batch" in its name is the important word - this is the variant that needs no reference image at all. Instead, it patches your model so that every image generated within the same batch shares attention with the others while sampling, which pulls them toward a common look: same palette, same rendering texture, same general style, even though each one can be driven by a completely different prompt. The original paper's whole pitch was doing this with zero fine-tuning and zero adapter model - just minimal attention sharing during diffusion - and that's exactly what this node does, at the model-patch level, before you ever get to a sampler.
That makes it a different tool from Mixlab's other StyleAligned node, StyleAligned Reference Sampler. That one anchors a batch to an actual reference image you captured earlier. This one has no reference at all - it just makes the members of one batch consistent with each other. Reach for Batch Align when you want a set of variations - icons, comic panels, a series of product shots - that all read as belonging to the same set, without having a single "correct" style image to point at. Reach for the reference-sampler version when you do have one specific look you want everything to match.
The knobs map directly onto the paper's own ablation controls. share_norm picks which of the model's normalization layers get shared across the batch - both, group, layer, or disabled - and share_attn picks which parts of self-attention get shared - q+k, q+k+v, or disabled. In practice, sharing more (both norm types, full q+k+v) pushes the batch toward a stronger, more uniform style at some cost to per-image variety; sharing less keeps more independence between images at the cost of a looser style match. scale, a float from 0 to 1 (default 1), is the overall dial on how strongly that sharing applies - 0 effectively turns the effect off regardless of the other two settings, 1 applies it at full strength. The single output is MODEL - a patched model you feed into your sampler exactly like an unpatched one, generating your batch as normal from there.
Install is the pack-wide standard:
cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git
cd comfyui-mixlab-nodes
install.bat
or via ComfyUI Manager (search "comfyui-mixlab-nodes"), or pip3 install -r requirements.txt in a venv. No model download needed - it patches whatever checkpoint you already have loaded.
The most common disappointment is a batch that doesn't look aligned at all, which usually traces back to scale being too low or share_norm/share_attn set to disabled - those three settings do all the work, so check them first. The opposite problem - every image in the batch looking suspiciously similar, losing the variety your different prompts should have produced - means you've pushed the sharing too hard; back scale off, or drop share_attn from q+k+v to q+k, before assuming your prompts themselves are the issue. And since this descends from an SD-era technique built around self-attention layers a specific way, expect it to behave best on the architectures it was designed against (SD 1.5/SDXL-class models) - wiring it into a very different, newer architecture is more likely to do nothing useful than to error outright, so if the model comes out unaffected, a mismatch between this technique and your base checkpoint's architecture is worth ruling out before digging further.
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 | — |