Nodes/RES4LYF/ClownStyle_Block_UNet
ComfyUI Node Runs on cloud

ClownStyle_Block_UNet

Style transfer control at the ResBlock level for classic U-Net models

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
ClownStyle_Block_UNet
  • mask
  • blocks
  • blocks
modescattersort
block_typeinput
block_listall
block_weights1.0
resample0.00
res0.00
spatial0.00
tile_h128
tile_w128
invert_maskfalse

The whole-block counterpart to ClownStyle_Attn_UNet, for the same classic U-Net models (SD1.5, SDXL, Stable Cascade) - but instead of only reaching into the attention math, this one gives you the whole block a U-Net stage is built from. It chains into ClownStyle_UNet's blocks input the same way the rest of the ClownStyle_* family does.

How it works

A classic U-Net stage is simpler than an MMDiT transformer block - it's a residual block plus (usually) a spatial transformer bolted on, not two symmetric attention/feedforward sublayers. That's why this node only exposes three taps instead of the MMDiT version's nine: resample is the down/upsampling convolution step within a stage, res is the ResBlock itself (the residual convolution path that also mixes in the timestep/conditioning embedding), and spatial is the SpatialTransformer submodule - the attention block bolted onto the ResBlock. That spatial tap is the coarse version of what ClownStyle_SpatialBlock_UNet and ClownStyle_TransformerBlock_UNet let you dig into with much more precision if you need it.

The inputs and outputs that matter

  • mode - the style-matching algorithm (scattersort, AdaIN, WCT, and the rest - same list as ClownStyle_UNet).
  • block_type (input / middle / output, or combinations) - which U-Net stage(s) to target. Unlike the attention-level node, there's no apply_to here - this operates on the block as a whole, not on self- versus cross-attention specifically.
  • block_list (default "all") / block_weights (default "1.0") - target and weight specific block indices.
  • resample, res, spatial - three floats, all default 0. spatial is the one most relevant if what you actually want is attention-driven style matching without going all the way down to ClownStyle_Attn_UNet; res and resample affect the more purely convolutional parts of the stage.
  • mask + invert_mask restrict spatially; tile_h/tile_w apply only to tiled_ modes.
  • blocks (optional in/out) chains with the rest of the family, feeding into ClownStyle_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

If you want attention-specific control, this isn't granular enough - go to ClownStyle_Attn_UNet or ClownStyle_TransformerBlock_UNet. spatial here turns the whole spatial-transformer submodule up or down as one unit; it doesn't distinguish self- from cross-attention or isolate the feedforward layer the way the more targeted nodes do.

Three floats at zero means nothing's happening - that's the default state, not a bug. Turn on spatial first if your goal is style bleed through attention; try res if you're chasing something closer to color/texture statistics on the convolutional path.

This is a smaller, simpler node than its MMDiT counterpart on purpose. Classic U-Net stages just don't have as many distinct internal sublayers as a DiT block does - three taps is the real structure, not a stripped-down version of something bigger.

CategoryRES4LYF/sampler_extensions

Inputs (12)

NameTypeDefaultDescription
modeCOMBOscattersort10 options: none, scattersort_dir, scattersort_dir2, scattersort, tiled_scattersort, AdaIN, +4
block_typeCOMBOinput7 options: input, middle, output, input,middle, input,output, middle,output, +1
block_listSTRINGall
block_weightsSTRING1.0
resampleFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
resFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
spatialFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
tile_hINT12816–10000Tile size for tiled modes. Lower values will transfer composition more effectively. Dimensions of image must be divisible by this value.
tile_wINT12816–10000Tile size for tiled modes. Lower values will transfer composition more effectively. Dimensions of image must be divisible by this value.
invert_maskBOOLEANfalse
maskoptMASK
blocksoptBLOCKS

Outputs (1)

NameTypeDescription
blocksBLOCKS