ClownStyle_TransformerBlock_UNet
The finest-grained style-transfer dial RES4LYF has
- mask
- blocks
- blocks
This is the deepest control point in RES4LYF's U-Net style-transfer stack - one rung past ClownStyle_SpatialBlock_UNet, targeting a single transformer block inside the spatial-transformer submodule directly. If ClownStyle_Block_UNet is "turn style transfer up on this whole stage" and ClownStyle_SpatialBlock_UNet is "turn it up on the attention submodule specifically," this node is "turn it up on exactly the self-attention, or exactly the cross-attention, or exactly the feedforward, inside that submodule." Chains into ClownStyle_UNet's blocks input the same way as the rest of the family.
How it works
Every attention block in classic Stable Diffusion / SDXL U-Nets follows the same three-sublayer shape: self-attention (the image attending to itself), then cross-attention (the image attending to your text conditioning), then a feedforward layer - each preceded by its own normalization and each with its own residual connection back into the stream. This node exposes all nine of those pieces individually: norm1/self_attn/self_attn_res for the self-attention sublayer, norm2/cross_attn/cross_attn_res for cross-attention, and norm3/ff/ff_res for feedforward. Every one is a float weight, default 0, for how hard the chosen mode applies at that exact point.
The inputs and outputs that matter
mode- the style-matching algorithm (scattersort,AdaIN,WCT, and the rest - same set asClownStyle_UNet).block_type(input/middle/output, or combinations) - which U-Net stage(s) to target.block_list(default"all") /block_weights(default"1.0") - narrow to and weight specific block indices.self_attn/cross_attn/ff- the three main operation taps. If you only turn on one thing here, start withself_attn- it's where most style-related information (texture, composition, color) tends to live, versuscross_attnwhich is more about how the image reads your prompt.norm1/norm2/norm3andself_attn_res/cross_attn_res/ff_res- the normalization and residual taps for each of the three sublayers, for when the main operation taps alone aren't giving you the precision you want.mask+invert_maskrestrict spatially;tile_h/tile_wapply only totiled_modes.blocks(optional in/out) chains this into 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 taps at zero by default - turn on self_attn alone first and see what it does before adding anything else. This is the most granular node in the family; stacking multiple taps at once makes it very hard to tell which one is responsible for what you're seeing.
If you find yourself here without having tried the coarser nodes first, back up. ClownStyle_UNet's own proj_in/proj_out, then ClownStyle_Block_UNet's spatial tap, then ClownStyle_SpatialBlock_UNet, are each a smaller search space - most workflows don't need to come all the way down here, and it's a lot easier to reason about the effect if you've already seen what the coarser controls do.
cross_attn being weaker than self_attn at the same weight is expected, not a sign something's misconfigured - cross-attention governs prompt-following more than visual style, so it's a subtler lever for this specific job.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | scattersort | 10 options: none, scattersort_dir, scattersort_dir2, scattersort, tiled_scattersort, AdaIN, +4 |
| block_type | COMBO | input | 7 options: input, middle, output, input,middle, input,output, middle,output, +1 |
| block_list | STRING | all | — |
| block_weights | STRING | 1.0 | — |
| norm1 | 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. |
| norm2 | 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. |
| norm3 | 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. |
| self_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. |
| cross_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. |
| 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. |
| self_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. |
| cross_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_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 | — |