Nodes/SP-Nodes/GodnessMerger_Apply
ComfyUI Node

GodnessMerger_Apply

Merge two checkpoints block by block, with controlled randomness

By bananasss00·Created 2 years ago·Updated 5 days ago· 20
GodnessMerger_Apply
  • model1
  • model2
  • time_embed
  • label_emb
  • input_blocks
  • middle_block
  • output_blocks
  • out
  • MODEL
  • RATIO_VALUES
strength1.000

The pack's README calls this "model merging based on controlled randomization," and the node's own optional inputs give away exactly what that means: time_embed, label_emb, input_blocks, middle_block, output_blocks, out are literally the named parameter groups inside a standard SD 1.5/SDXL UNet's weights. This isn't a Flux tool (Flux uses a different block layout entirely - see this pack's FluxInspireLbw nodes for that architecture instead) - it's a block-wise merger for the classic UNet structure, where instead of one flat blend ratio across the whole model, you can set, or randomize, the ratio independently for each block group.

How it works

At minimum, model1, model2, and strength (0–1, default 1) behave like a normal weighted merge - strength is the global ratio applied wherever you haven't overridden anything more specific. The interesting part is the six optional inputs, each accepting a custom type from a dedicated companion config node (GodnessMerger_InputBlocks is one of them) that decides that specific block group's own merge ratio, overriding the global strength for just that piece of the network. Leave all six disconnected and this is a plain global-ratio merge; wire some or all of them in and you get independent, potentially randomized control over how much of each part of the network comes from model1 versus model2.

The inputs and outputs that matter

  • model1, model2 - the two checkpoints being blended. They need matching UNet architecture - mixing an SD 1.5 checkpoint with an SDXL one won't produce a coherent result, since the block shapes don't line up.
  • strength - the fallback global ratio, in steps of 0.001 for fine control.
  • time_embed, label_emb, input_blocks, middle_block, output_blocks, out (all optional) - per-block ratio overrides, each fed from its own companion config node elsewhere in the pack.
  • Outputs: MODEL (the merged result, straight to your sampler) and RATIO_VALUES (a string recording exactly what ratio was used per block). That second output matters more than it looks - if any of your per-block config nodes are set to randomize, this is your only record of what you actually got, and the only way to reproduce a merge you liked.

How to install it

Through ComfyUI Manager: search "SP-Nodes," install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/bananasss00/ComfyUI-SP-Nodes

Restart ComfyUI afterward.

Common issues

The architecture-mismatch trap is the big one - this is a structural UNet merge, not a generic weight blend, so both models need to actually be the same family. Beyond that: always capture RATIO_VALUES somewhere durable (a saved text file, a note next to your output) the moment you land on a blend you want to keep. Randomized per-block merging is genuinely fun to experiment with, but without that output saved, re-rolling with the same seed later is the only way back to an identical result, and it's easy to lose track of which run produced which merge once you've done a handful of them.

CategorySP-Nodes/model_merging

Inputs (9)

NameTypeDefaultDescription
model1MODEL
model2MODEL
strengthFLOAT1.0000–1
time_embedoptGM_TIME_EMBED
label_emboptGM_LABEL_EMB
input_blocksoptGM_INPUT_BLOCKS
middle_blockoptGM_MIDDLE_BLOCK
output_blocksoptGM_OUTPUT_BLOCKS
outoptGM_OUT

Outputs (2)

NameTypeDescription
MODELMODEL
RATIO_VALUESSTRING