LZ Pipe Merge
Stitch two pipes together without the spaghetti
- lz_pipe_main
- lz_pipe_sub
- lz_pipe
Once you've drunk the LZ_PIPE kool-aid - one wire carrying your model, clip, VAE, conditioning, and generation settings instead of a dozen crossing the canvas - you hit a new problem: what happens when two things want to feed the same pipe? A checkpoint loaded in one branch, a LoRA-stacked model in another, and you want the best of both. That's exactly what LZ Pipe Merge is for.
The name is accurate and the mechanism is almost insultingly simple. It takes two lz_pipe inputs - lz_pipe_main and lz_pipe_sub - and returns a single merged lz_pipe. Every field that the main pipe carries wins; the sub pipe only fills in the gaps. If main doesn't have a model but sub does, the result has sub's model. If both have one, main's model wins and sub's is silently ignored. It's a first-non-null merge over every key in the bundle, nothing cleverer than that.
That directionality is the whole trick, and it's where people get burned. There's no notion of "the newer one wins" or "sub overrides main." To make the sub pipe's values win, you wire the thing you actually want in the lz_pipe_main slot. In practice that means: put your freshly-loaded or LoRA-applied pipe in main, your base/fallback pipe in sub, and you get "current, with a sensible default underneath."
The useful pattern: keep a plain LZPipePack on a fallback model, then merge in the output of a LZLoRAStacker or a second loader whose model you prefer for a particular run. Since the merge is shallow - a flat dictionary copy - any field either pipe has (including the underscore-prefixed plot settings that LZPipePackXL and the XY nodes stuff in) rides along intact.
Inputs and outputs
lz_pipe_main(required,LZ_PIPE) - the pipe that wins every conflict.lz_pipe_sub(required,LZ_PIPE) - the pipe that fills in anything main is missing.- Output: one
lz_pipe.
That's it. No widgets, no options, nothing to configure. If you don't have two pipes, you don't need this node.
Installing it
It ships in the ComfyUI-LZNodes pack, so you install the whole pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/liz-ils/ComfyUI-LZNodes
Restart ComfyUI. Or, easier, ComfyUI Manager → Install Custom Nodes → search "ComfyUI-LZNodes". No requirements.txt, no model downloads - the whole pack runs on stock ComfyUI's torch/PIL stack.
The gotcha worth internalizing
The pipe system's failure mode is stale context, and LZ Pipe Merge gives you one more way to trip over it. Because the bundle hides what's inside, it's easy to merge a pipe that was assembled before a LoRA or a later latent swap, then unpack a silently wrong model downstream. When you're iterating on a value that changes mid-graph, keep it on explicit wires until you trust the layout - then collapse to pipes. Merge where the direction is obvious, and if the output ever surprises you, check which pipe is sitting in the main slot before you blame the sampler.
For the record: this pack's pipe type (LZ_PIPE) doesn't interoperate with rgthree's Context or Efficiency Nodes' pipe - every pack invented its own bus. That's a lock-in cost, but inside the LZNodes world it works fine, and that world is what most of these nodes assume.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| lz_pipe_main | LZ_PIPE | — | |
| lz_pipe_sub | LZ_PIPE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| lz_pipe | LZ_PIPE | — |