Nodes/RES4LYF/ClownStyle_UNet
ComfyUI Node Runs on cloud

ClownStyle_UNet

The node that actually turns a reference image into a style guide

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
ClownStyle_UNet
  • positive
  • negative
  • guide
  • mask
  • blocks
  • guides
  • guides
modescattersort
proj_in0.00
proj_out0.00
tile_h128
tile_w128
invert_maskfalse

This is the entry point for RES4LYF's style-transfer feature - the thing behind the README's "STYLE TRANSFER" section, with the composition-guide/output/style-guide screenshots and the claim that it works across HiDream, Flux, Chroma, AuraFlow, SD1.5, SDXL, SD3.5, Stable Cascade, LTXV and WAN. If you've seen ClownStyle_Attn_MMDiT, ClownStyle_Block_UNet, or any of the other ClownStyle_* nodes in a shared workflow and wondered what actually pulls them together, this is it. It's the node you wire your conditioning and your style reference into; the rest of the family is optional fine-tuning that chains in through its blocks input.

How it works

You give it a style reference latent and your prompt conditioning, pick a mode - one of ten style-matching algorithms - and it packages the result into a GUIDES object that plugs into ClownsharKSampler's guide input to steer sampling toward matching that style. A couple of those modes are worth knowing what they actually are: AdaIN and tiled_AdaIN are Adaptive Instance Normalization, the classic fast style-transfer trick of matching the mean and variance of feature statistics between your generation and the reference. WCT/WCT2 (Whitening and Coloring Transform) do a heavier, more thorough version of the same idea. scattersort, scattersort_dir, and scattersort_dir2 are the pack author's own method - he built it specifically to stop a style or faceswap pass from dragging the wrong hair color or lighting off the source image, a problem he described directly when he shipped it: earlier style-matching approaches were leaving "incongruously colored hair or uncanny lighting" behind. Setting mode to none switches this node's own contribution off, which is handy for isolating whether an effect is coming from here or from a chained blocks node.

The inputs and outputs that matter

  • mode - the one real creative decision. Start with scattersort or AdaIN and compare.
  • guide (LATENT) - your style reference, VAE-encoded first.
  • positive / negative (CONDITIONING) - your normal prompt conditioning, wired here so the node can weigh style against content jointly.
  • proj_in / proj_out (floats, default 0) - how strongly the style signal gets injected right at the model's input and output projections. Zero means that tap is off; this is the shallowest control point, versus the deeper per-block control the rest of the ClownStyle_* family gives you through blocks.
  • mask + invert_mask - restrict the style transfer to part of the frame instead of the whole image.
  • tile_h / tile_w (default 128) - only relevant if you picked a tiled_ mode; sets the patch size statistics get computed over, keeping the effect local instead of smearing across the whole image.
  • blocks (optional in) - chain other ClownStyle_* nodes here for finer per-layer control.
  • guides (optional in) - chain in an existing GUIDES object if you're layering more than one style source.

Output: guides (GUIDES), wired straight into ClownsharKSampler.

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

Flux Dev alone doesn't have much style knowledge. The README says it plainly - best current results are on HiDream or Chroma, or Flux with a style LoRA stacked on. If your Flux output isn't picking up the reference at all, that's the model, not your settings.

Confirm your prompt isn't already doing the work. The README's own tip: test with mode set to none to make sure the style you're seeing is actually coming from the guide and not just from your text prompt.

Style bleed (wrong hair color, mismatched lighting) is exactly the failure scattersort was built to fix. If you're seeing that with AdaIN or WCT, switch modes before assuming your reference image is the problem.

CategoryRES4LYF/sampler_extensions

Inputs (12)

NameTypeDefaultDescription
modeCOMBOscattersort10 options: none, scattersort_dir, scattersort_dir2, scattersort, tiled_scattersort, AdaIN, +4
proj_inFLOAT0.00-100–100Strength of effect on layer; skips extra calculation if set to 0.0. Skips interpolation if set to 1.0.
proj_outFLOAT0.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
positiveoptCONDITIONING
negativeoptCONDITIONING
guideoptLATENT
maskoptMASK
blocksoptBLOCKS
guidesoptGUIDES

Outputs (1)

NameTypeDescription
guidesGUIDES