Recast Conditioning
Recast Conditioning
- conditioning
- CONDITIONING
Recast Conditioning does exactly one thing: it takes a CONDITIONING input and hands back the same CONDITIONING, untouched. That sounds like the most pointless node ever written, and honestly, as a piece of computation it is. But it fixes a genuinely annoying class of ComfyUI bug, and it's cheap insurance to have in the graph.
The problem it solves is typing, not data. ComfyUI wires nodes together by declared types - MODEL into MODEL, CONDITIONING into CONDITIONING. Some custom nodes from other packs get lazy and declare their inputs as "anything," meaning they'll accept whatever flows in and figure it out later. That works until the browser loads your workflow: a node that accepts anything can't always tell what kind of anything is arriving until it actually runs, so the connection shows up broken, or the node fails to initialize, until you queue a job once and let it fail. The author of this pack hits the nail on the head in the README - it's the same as casting in code: emptyLatent = (Latent)emptyLatent;.
That's what Recast Conditioning is: a typed cast sitting in the CONDITIONING wire. You put it between a node that emits "anything" (a router, a switch, a helper that can output several types) and a KSampler's CONDITIONING socket. The cast declares the real type, the graph resolves, and the link works on first load.
The whole interface
One input, one output, nothing else. No widgets, no settings, no state.
- conditioning (CONDITIONING) - feed it the anything-output you're struggling with.
- CONDITIONING output - wire into a KSampler, a sampler custom, or a conditioning merge node.
Installing it
It ships in the ComfyKit Custom Nodes pack (bobmagicii/comfykit-custom-nodes). Use ComfyUI Manager - search "ComfyKit Custom Nodes" - or clone manually:
cd ComfyUI/custom_nodes
git clone https://github.com/bobmagicii/comfykit-custom-nodes
Restart ComfyUI. There's no requirements.txt and no model downloads; the pack is pure Python over core ComfyUI modules.
What it won't do
Worth being blunt about: a typecaster cannot fix wrong data, only wrong typing. If your conditioning is genuinely broken (wrong prompt encode, a conditioning that got mangled upstream), passing it through a cast won't heal it - you'll just get broken conditioning with a valid type. And if the red link persists after adding it, double-check you cast to the type the downstream node actually wants. There's a Recast Model, Recast CLIP, Recast Latent, Recast Image, and Recast VAE in the same pack for every other wire. When in doubt, add the cast that matches the socket you're fighting - it's the most harmless node you'll ever install, because it cannot alter the data by construction.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |