Nodes/ymc-node-as-x-type/set it as model type
ComfyUI Node

set it as model type

Re-labeling an any-wire as a MODEL — the checkpoint-routing helper

By YMC-GitHub·Created 2 years ago·Updated about a year ago· 0
set it as model type
  • a
  • model

A MODEL socket in ComfyUI carries the actual diffusion weights, and it's the one thing you never want to guess about. So "set it as model type" is a node with a built-in warning: it's a type label, not a converter, and getting it wrong is how you feed a VAE to a KSampler and watch the console light up.

The scenario it's for: you're building a workflow that routes models dynamically - a switch that picks between two checkpoints, a Use Everywhere-style graph that fans one model to several samplers without drawing every link, or an API-driven graph where the model arrives as an any-typed value. Once a model has passed through that any-typed junction, the editor has forgotten its type. A downstream node with a strict MODEL input may refuse the wire, or accept it and blow up later. This node takes whatever is on a, returns it untouched, and declares the output as MODEL - a "trust me, these are weights" stamp.

Under the hood it's the same two-liner as every sibling in the pack: exec(self, a=None): return (a,) with RETURN_TYPES = ("MODEL",). The output wires straight into the model input of a KSampler, an Advanced Sampler, or anything else waiting for weights.

When you'd reach for it

  • Model switching: a switch node routes between two checkpoints, and the sampler's model socket won't take the any-wire directly.
  • LoRA or model-stacking graphs where the model passes through several routing nodes and you want type-safety back before the sampler.
  • Any UE-style graph where the author's README explicitly points - this pack exists to "enhance use cg-use-everywhere to link nodes."

And the caution that matters: only stamp it MODEL when you're sure. If the wire is actually carrying a CLIP or a VAE, the sampler won't get a model - it'll get an error, and it'll be the kind that's annoying to trace because the failure happens a few nodes downstream of this innocent-looking sticker.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/YMC-GitHub/ymc-node-as-x-type

or via ComfyUI Manager (search ymc-node-as-x-type), then restart. No model files to download; the four yors_* pip deps in requirements.txt install automatically on startup. Find it by double-clicking and typing set it as, or right-click → YMC → LINK.

Gotchas

  • Type label, not conversion. Confirm the other end of a really holds a MODEL.
  • One-maintainer, one-commit pack (v0.1.2, 2025) - a utility, not a maintained platform piece.
CategoryYMC/LINK

Inputs (1)

NameTypeDefaultDescription
aopt*

Outputs (1)

NameTypeDescription
modelMODEL