ClownStyle_Block_MMDiT
Full transformer-block control for style transfer on MMDiT models
- mask
- blocks
- blocks
Where ClownStyle_Attn_MMDiT only taps the attention math inside an MMDiT block, this node steps back and gives you the whole block - both the attention sublayer and the feedforward sublayer, each broken into five tap points. It's for the same job as the rest of the ClownStyle_* family (chained into ClownStyle_UNet's blocks input to push style-transfer control deeper into Flux, SD3.5, HiDream, AuraFlow or Chroma), just at a coarser, whole-block grain than the attention-only node.
How it works
A modern DiT-style block is built as two sublayers, each following the same shape: a normalization step (sometimes modulated by the model's conditioning, AdaLN-style), the sublayer's core operation, an optional gate, and a residual add back into the stream. This node exposes exactly that structure twice - once for attention, once for feedforward: attn_norm/attn_norm_mod/attn/attn_gated/attn_res for the attention sublayer, and ff_norm/ff_norm_mod/ff/ff_gated/ff_res for the feedforward sublayer. Nine floats total, each a weight for how strongly the chosen mode (the same style-matching algorithms as ClownStyle_UNet) applies at that specific point in the block.
The inputs and outputs that matter
mode- the style-matching algorithm (scattersort,AdaIN,WCT, etc.) applied wherever a tap is nonzero.apply_to(img/img+txt/img,txt/txt) andblock_type(double/double,single/single) - same meaning as onClownStyle_Attn_MMDiT: which token stream and which block family to target.block_list(default"all") /block_weights(default"1.0") - narrow to specific blocks and weight them individually.- The nine floats -
attn_norm,attn_norm_mod,attn,attn_gated,attn_res,ff_norm,ff_norm_mod,ff,ff_gated,ff_res- all default to 0. If you just want "style transfer at this whole block, roughly evenly," turning onattnandffalone gets you most of the way there before you start reaching for the norm/gate/residual taps individually. mask+invert_maskrestrict spatially;tile_h/tile_wonly matter fortiled_modes.blocks(optional in/out) chains with the rest of theClownStyle_*family, ultimately intoClownStyle_UNet.
How to install it
Via ComfyUI Manager, search "RES4LYF". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt
then restart.
Common issues & troubleshooting
Nine floats is a lot to reason about at once - don't turn them all on together. Start with attn and ff, the two "main operation" taps, before layering in the norm/gated/residual variants; each one compounds with the others, and it's hard to tell what's doing what if you enable all nine simultaneously.
This sits between ClownStyle_Attn_MMDiT and ClownStyle_UNet in granularity. If attention-only control feels too narrow and the top-level node's proj_in/proj_out feels too broad, this is the middle rung - reach for it when you want "this whole block, both halves" rather than one specific projection.
Same block-list gotcha as the rest of the family: a malformed block_list string silently fails to select what you meant. Leave it at "all" until the floats are dialed in, then narrow.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | scattersort | 10 options: none, scattersort_dir, scattersort_dir2, scattersort, tiled_scattersort, AdaIN, +4 |
| apply_to | COMBO | img+txt | 4 options: img, img+txt, img,txt, txt |
| block_type | COMBO | single | 3 options: double, double,single, single |
| block_list | STRING | all | — |
| block_weights | STRING | 1.0 | — |
| attn_norm | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| attn_norm_mod | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| attn | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| attn_gated | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| attn_res | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| ff_norm | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| ff_norm_mod | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| ff | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| ff_gated | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| ff_res | FLOAT | 0.00-100–100 | Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0. |
| tile_h | INT | 12816–10000 | Tile size for tiled modes. Lower values will transfer composition more effectively. Dimensions of image must be divisible by this value. |
| tile_w | INT | 12816–10000 | Tile size for tiled modes. Lower values will transfer composition more effectively. Dimensions of image must be divisible by this value. |
| invert_mask | BOOLEAN | false | — |
| maskopt | MASK | — | |
| blocksopt | BLOCKS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| blocks | BLOCKS | — |