Recast CLIP
A cast for the text-encoder wire
- clip
- CLIP
Recast CLIP is a no-op with a job title. It takes a CLIP in, hands the exact same CLIP back, and exists purely so the graph knows the type. If you've ever loaded a shared workflow and watched a node's input socket sit there red even though everything looks right, this is the fix.
Quick refresher on why CLIP matters: it's the text encoder, the half of the pipeline that turns your prompt into the conditioning the sampler steers by. It flows out of your checkpoint loader (or a dedicated CLIP loader), into the CLIP text encode node. That's normally a boring, reliable wire. It stops being boring when you're dealing with nodes from other packs that declare dynamic "anything" inputs - routers that pass through a model bundle, switchers, helpers that can emit a handful of different types. When such a node feeds a typed socket, the browser can't always resolve what type is flowing until the first queue run, and the workflow loads with a dead link.
The author's README frames it as a code cast: emptyLatent = (Latent)emptyLatent; - you're declaring the type without changing the value. Recast CLIP is the CLIP-flavored version of that. You drop it between a dynamic output and the text encode node, and suddenly the wire has an explicit, concrete CLIP type that resolves on first load. That's the entire mechanism: onRun returns its input.
The whole interface
One required input, one output, zero parameters. No widget, no settings, no state to forget.
- clip (CLIP) - in.
- CLIP - out, same object.
Installing it
Part of the ComfyKit Custom Nodes pack (bobmagicii/comfykit-custom-nodes). In ComfyUI Manager, search "ComfyKit Custom Nodes" and install. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/bobmagicii/comfykit-custom-nodes
Restart ComfyUI after. The pack has no requirements.txt, downloads nothing, and adds no pip dependencies - it's plain Python over ComfyUI's core modules, so this is one of the safest installs you'll do.
The honest caveats
Because it does nothing to the data, it can't rescue a genuinely wrong CLIP - a mismatched encoder for your model, for instance, or a CLIP object from the wrong architecture. Casting fixes type mismatches, not content mismatches. And if the wire is still red after adding it, verify the downstream node really wants CLIP and not something a step removed (some packs accept CLIP only as part of a bigger bundle). Also worth knowing: the six typecasters in this pack - Model, Conditioning, Latent, Image, VAE, and this one - are all the same idea, so the mental model transfers wherever you need it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CLIP | CLIP | — |