CustomNet_LoadModel
The loader that's really a CustomNet model switcher
- model
- info
The name makes CustomNet_LoadModel sound like ComfyUI's standard checkpoint loader, and that's exactly the trap. This is the first half of smthemex's two-node ComfyUI_CustomNet pack, and its job is narrower and weirder: load the weights for Tencent's CustomNet - a research model from late 2023 that can drop an object into a new scene, reposition it, and change its viewing angle with zero training - and tell the pack's sampler which flavor of the model you picked. It never samples anything itself. Think of it as the ignition, not the engine.
How it works is where it stops resembling a normal loader. The single input, ckpt_name, is a dropdown listing every file in your models/checkpoints folder plus a "none" entry - so far, indistinguishable from CheckpointLoaderSimple. But the node doesn't parse the checkpoint the way ComfyUI parses an SD1.5 file. It reads the filename and uses it as a switch: if the name contains "inpaint", it loads the inpainting config and flags the model accordingly; otherwise it loads the base config. Then it instantiates CustomNet - a LatentDiffusion model built on an SD1.5-style UNet with extra input channels and a small projection layer that fuses your object's image encoding with a viewpoint vector - loads the weights with strict=False, and parks everything on CUDA.
So there's really one thing you set. Pick customnet_v1.pth from the dropdown for the normal model, or customnet_inpaint_v1.pt for the inpainting variant, and leave it there. The two outputs are both for the sampler: model (a MODEL) and info (a DICT). info looks like nothing, but it carries a single important flag - whether the loaded weights are the inpainting model - and the sampler reads it to decide whether to accept a background image. Keep the pair together; wire both into the same CustomNet_Sampler.
Install is standard custom-node fare. ComfyUI Manager (search ComfyUI_CustomNet) or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_CustomNet.git
then restart and let the requirements install. Worth knowing before you click: requirements.txt pins carvekit-colab==4.1.0 (a chunky background-matting package), torch-fidelity, and pulls taming-transformers straight from a CompVis GitHub checkout - the kind of "it installs a research repo from git" dependency that bites later. Then grab the weights from huggingface.co/TencentARC/CustomNet and drop them in with your other checkpoints:
ComfyUI/models/checkpoints/customnet_v1.pth # normal model
ComfyUI/models/checkpoints/customnet_inpaint_v1.pt # inpainting model
Note the file types. This loader uses torch.load, not safetensors, so it needs those .pth/.pt files as-is.
Where people get burned: picking a regular SD checkpoint from the dropdown. strict=False means it won't necessarily crash, but the architecture won't match and you'll get an error or garbage - only CustomNet's own weights belong here. Leaving it on "none" gives you nothing to load. And device = torch.device("cuda") is hardcoded in the source, so CPU-only installs are out. One more thing to expect on the pack's first real run (from the sampler, not this node): it downloads a CLIP ViT-L-14 encoder and carvekit's matting weights into your user cache, and the README's tip about needing a working internet connection is aimed squarely at that.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| ckpt_name | COMBO | 1 options: none |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| info | DICT | — |