Cache Unit
Stop re-SVDing the same merge — a persistent cache for the expensive methods
- cache
Some merge methods are expensive. Truncate Rank, Rotate, and the Kronecker variants spend most of their time decomposing tensors - full or approximate SVDs on every key of a model. If you're iterating on a workflow, that cost repeats on every run, even when nothing about the heavy part changed. Mecha Merge Method Cache Unit is the pack's answer: a persistent cache that merge methods write their intermediate results into (tensors, SVD components, and so on), keyed by an identifier you choose, so the next run reuses them instead of recomputing.
The cache persists as long as this node stays in your workflow. Run the workflow once, the heavy method stashes its artifacts; run it again with unchanged inputs and the cached artifacts come back. Change the merge and the method is responsible for deciding what needs recomputing. It's the "I'm going to be here a while, let's not burn the GPU on the same SVD twice" node.
Inputs
Just one: identifier - a STRING (default empty). It's a name you pick to key this cache. Give it something meaningful per merge, because the cache is typed: once a cache unit has been used by a given merge method type, it's tied to that method. Sharing one cache between Truncate Rank and Rotate raises an error - recreate the unit or use a fresh one.
Output: cache of type MECHA_MERGE_METHOD_CACHE, wired into the cache input socket that appears on cache-capable recipe nodes (the SVD-family methods). You only get that socket on nodes that support it - most of the pack's recipe nodes don't have one.
Lifecycle rules (from the author's own description)
- The cache persists even if the node is disconnected, as long as it stays in the workflow.
- If you run a workflow that doesn't include this node, the cache is cleared after that execution.
- Recreating the node via "Fix node (recreate)" resets the cache.
- Copy-pasting the node creates a different memory unit - the copy doesn't share the original's cache.
Install & gotchas
ComfyUI Manager → search mecha → Mecha Merge Node Pack, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ljleb/comfy-mecha.git
pip install -r comfy-mecha/requirements.txt
Restart; only dependency is sd-mecha==1.1.7.
Where people get burned: treating this as a general-purpose cache and expecting a speedup on methods that don't support it (no cache socket on the node = no cache for you). And the identifier - two different merge types on the same identifier will hard-error, not silently share. The author's own guidance is also worth repeating: use either this or merge_checkpointing on recipe nodes, not both at once - the memory adds up. Checkpointing is faster on the fast path; the cache unit is for when even that isn't enough.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| identifier | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| cache | MECHA_MERGE_METHOD_CACHE | — |