Nodes/SD Slicer/SD Slicer — Merge (any)
ComfyUI Node

SD Slicer — Merge (any)

LoRAs, ControlNets, upscalers — blend any state_dict

By kuschanow·Created about a month ago·Updated about a month ago· 0
SD Slicer — Merge (any)
  • src_1
  • src_2
  • state_dict
config{}

Stock ComfyUI can merge checkpoints, but try merging two LoRAs and you'll notice the toolbox goes quiet. LoRA merging is a genuinely wanted thing - the community's been asking since 2023 - it's just that the built-in nodes are all typed to MODEL. SD Slicer - Merge (any) is the pack's answer to that: a wildcard merge node that takes the state_dict of N arbitrary objects and blends them block by block, no matter what they are. LoRAs, ControlNets, upscale models, plugin types. If it has weights, this node will mix it.

The name tells you the tradeoff. Its inputs are wildcards (*), it outputs a raw state_dict, and the README is blunt about it: loadability of the result is the user's responsibility. The node will happily merge a LoRA against a ControlNet that shares zero keys - the compatibility check only fires on key/shape mismatches within the same architecture family. So this is a tool for people who know what they're feeding it. That's not a bug; it's what makes the node generic.

How it works

Under the hood it's the same engine as the pack's Layer Merge. It extracts a state_dict from each input (it handles plain dicts, ModelPatcher, VAE, CLIP, and anything exposing get_sd()/state_dict()), slices the keys into blocks by the same prefix rule, checks that all inputs share keys and tensor shapes, and blends each block with the usual formula:

W_out = k · ( w₁·W₁ + w₂·W₂ + … + w_N·W_N )

You get the same per-block weight grid, the same k multiplier, the same formula presets (interpolate, weighted subtraction, add-difference, custom expressions with lerp, clamp, min, max…). Because the inputs are wildcards, the block list shows whatever keys the object actually has - lora_unet_… for a LoRA, the standard UNet blocks for a diffusion model.

Inputs and outputs

  • src_1, src_2, … - dynamic wildcard inputs. Connect to the last free port and the next appears.
  • config - hidden JSON, written by the UI.
  • Output: state_dict (wildcard) - meant to be written with the pack's SD Slicer - Save (any) node.

The natural chain, straight from the README:

Load LoRA (raw) ┐
                ├─► Merge (any) ─► Save (any)   (destination: models/loras)
Load LoRA (raw) ┘

What it's actually good for

LoRA blending is the headline. It's a fast, disk-cheap way to fold two LoRAs you already have into one file - especially useful when a sampler slot is scarce and you want to merge, say, a style LoRA and a subject LoRA once instead of stacking them live. It also works for ControlNet and upscale-model experiments where you want a middle ground between two checkpoints of the same base.

The traps

Two, honestly. First: merging only makes sense between objects of the same base with matching shapes - a rank-64 SDXL LoRA and a rank-128 one won't line up, and the error message will show you the offending shape. Second: the node is not a validator. It will blend what you give it, and whether the result loads is on you. Test with Save (any) into models/loras and a stock LoraLoader before you trust it. Same install as the rest of the pack: ComfyUI Manager (search "SD Slicer") or git clone https://github.com/kuschanow/ComfyUI-SD-Slicer into custom_nodes, then restart.

CategorySD-Slicer

Inputs (3)

NameTypeDefaultDescription
src_1*
src_2*
configSTRING{}

Outputs (1)

NameTypeDescription
state_dict*