Nodes/ComfyUi-MpiNodes/Mpi Seed Passthrough
ComfyUI Node

Mpi Seed Passthrough

A seed node that refuses to let ComfyUI cache you into a wall

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi Seed Passthrough
  • any
  • any
  • seed
seed0

ComfyUI caches aggressively. Re-run a graph and any node whose inputs haven't changed just... doesn't run - it reuses last time's output. That's usually a feature. It's a bug when you have a workflow with no seed, because then nothing ever counts as changed, and you get the same image forever while ComfyUI insists it's working. MpiSeedPassthrough is the fix: pass any value through, get a seed out, and have the whole chain re-run every time.

Mechanically it's a two-output node: any in, any plus seed out. The seed widget has control_after_generate - set it to randomize and you get a fresh seed each run, the classic pattern. But the load-bearing detail is the IS_CHANGED override, which returns the seed value. ComfyUI compares that return against the last run's; when your seed is randomized, they never match, so the node is always dirty and everything downstream of it re-executes. That's the "forces the workflow to re-run every time" promise in the description made real.

The inputs that matter

  • seed - an INT, default 0. The tooltip's advice is the whole tutorial: set control_after_generate to randomize for a fresh seed each run.
  • any (optional) - the pass-through. Leave it unconnected and the node works fine as a pure seed source; connect it and whatever flows through also reaches the any output.

Outputs: any (the passthrough) and seed (the INT).

Install

Ships in ComfyUi-MpiNodes. ComfyUI Manager (search "MpiNodes" / publisher "mad-pony-interactive"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes

Restart. No dependencies beyond the pack.

The trade-off nobody mentions

Because the node re-runs on every submission when the seed is randomized, it defeats ComfyUI's cache for everything upstream of it - that's the point, but it's also the cost. If you hang a randomize-mode MpiSeedPassthrough off a branch that feeds an expensive sampler, the sampler runs every time, which is exactly what you want for seed-farming and exactly what you don't want when you only tweaked an unrelated widget and expected the heavy stuff to stay cached. The standard seed hygiene from the KB applies double here: with the seed set to fixed (not randomize), IS_CHANGED returns the same value and the node stays clean - so you only pay the rerun cost when you actually want it. If your workflow has no seed at all and you're stuck on cached outputs, this is the cheapest fix going; the alternative is dragging a Primitive node in and converting a widget to input, which is more moving parts for the same result.

CategoryMpiNodes/Logic

Inputs (2)

NameTypeDefaultDescription
seedINT00–18446744073709550000Set control_after_generate to 'randomize' for a fresh seed each run.
anyopt*

Outputs (2)

NameTypeDescription
any*
seedINT