ClownStyle_ResBlock_UNet
Inject style at specific UNet blocks
- mask
- blocks
- blocks
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. Optionalblocksin lets you stack instructions.mode(defaultscattersort) - the style operation, same family as elsewhere in the pack (scattersort,WCT,AdaIN,injection, …).scattersortis the author's own, gentlest on your colors.block_type(defaultinput) - which stage of the UNet to hit:input,middle,output, or combinations likeinput,output. This is the core choice - it's where the style goes.block_list(defaultall) /block_weights(default1.0) - narrow to specific block indices and give each its own strength, as text lists. Leave atall/1.0until 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.
Inputs (19)
| 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 | — |
| in_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. |
| in_silu | 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. |
| in_conv | 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. |
| emb_silu | 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. |
| emb_linear | 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. |
| emb_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. |
| out_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. |
| out_silu | 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. |
| out_conv | 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. |
| residual | 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 | — |