Nodes/RES4LYF/ClownStyle_ResBlock_UNet
ComfyUI Node Runs on cloud

ClownStyle_ResBlock_UNet

Inject style at specific UNet blocks

By ClownsharkBatwing·Created 2 years ago·Updated 21 days ago· 1,222
ClownStyle_ResBlock_UNet
  • mask
  • blocks
  • blocks
modescattersort
block_typeinput
block_listall
block_weights1.0
in_norm0.00
in_silu0.00
in_conv0.00
emb_silu0.00
emb_linear0.00
emb_res0.00
out_norm0.00
out_silu0.00
out_conv0.00
residual0.00
tile_h128
tile_w128
invert_maskfalse

This is the surgeon's version of RES4LYF style transfer. Instead of applying a reference style to the whole image, ClownStyle ResBlock UNet lets you inject it at specific residual blocks inside a UNet - input blocks, middle, output, or any combination - and weight each one. The idea: different blocks of a UNet handle different scales of information, so targeting where the style lands gives you control that a global transfer can't.

Let's be honest about who this is for. It's the deepest, most experimental node in a pack that is already under-documented, and it only applies to UNet-based models (SD1.5, SDXL, Stable Cascade) - not the DiT/transformer architectures like Flux or SD3.5 that don't have this input/middle/output resblock structure. If you're new to RES4LYF, start with ClownGuide Style; come here only when you specifically want to steer style by network depth, e.g. keeping structure from the low blocks while borrowing texture from the high ones. There's real power in it, but there's no shortcut around trial and error.

How it works

It outputs a BLOCKS object - a per-block style instruction - that plugs into the pack's style pipeline. You pick which UNet blocks to touch, the transfer mode, and then a set of fine weights for the individual layers inside each residual block (the norm, the conv, the embedding path). The sampler applies your reference style only at the blocks and strengths you specified.

The inputs and outputs that matter

  • blocks (BLOCKS) out - feeds the pack's style machinery. Optional blocks in lets you stack instructions.
  • mode (default scattersort) - the style operation, same family as elsewhere in the pack (scattersort, WCT, AdaIN, injection, …). scattersort is the author's own, gentlest on your colors.
  • block_type (default input) - which stage of the UNet to hit: input, middle, output, or combinations like input,output. This is the core choice - it's where the style goes.
  • block_list (default all) / block_weights (default 1.0) - narrow to specific block indices and give each its own strength, as text lists. Leave at all / 1.0 until you know which blocks you want.
  • The per-layer floats (in_norm, in_conv, emb_res, out_conv, residual, …) are surgical weights on the sub-parts of each resblock. They all default to 0; touch them only when you're deliberately probing which layer carries the effect.
  • Optional mask - confine the injection spatially.

How to install it

ComfyUI Manager: search RES4LYF, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF
cd RES4LYF
pip install -r requirements.txt

then restart and hard-refresh (F5). No downloads.

Common issues & troubleshooting

It errors or does nothing on Flux/SD3.5/HiDream. Expected - those are transformer (DiT) models without the input/middle/output resblock layout this node addresses. Use it on UNet models (SD1.5, SDXL, Cascade). For DiT-family style transfer, use ClownGuide Style instead.

You changed the per-layer weights and the image fell apart. Those sub-block floats are powerful and unforgiving. Reset them all to 0, get the effect you want from block_type and mode alone, then reintroduce individual layer weights one at a time.

No idea which blocks do what. Nobody handed you a map, and there isn't a definitive one - the pack's whole style layer is explore-and-observe. Start with a single block_type (try output for texture, input for structure), one weight, and change one thing per run.

CategoryRES4LYF/sampler_extensions

Inputs (19)

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
in_normFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
in_siluFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
in_convFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
emb_siluFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
emb_linearFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
emb_resFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
out_normFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
out_siluFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
out_convFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
residualFLOAT0.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