Generic .pth Loader
Generic .pth Loader — the escape hatch for custom depth checkpoints
- pth_model
This node exists to answer one specific question: what if you want a depth checkpoint other than the ones this pack's Depth nodes already offer? Both CN Pre+Loaders: Depth (DepthAnything) and CN Pre+Loaders: Depth (MiDaS) have an optional pth_model input of type PTH_MODEL sitting alongside their normal model selectors - and this node is the only thing in the pack that produces that type. If you're happy with the built-in model_id/model_name choices on either depth node, you will genuinely never need this one. If you've got a finetuned or alternate .pth depth checkpoint you specifically want to load instead, this is how it gets into the graph.
The two fields
model_file is a dropdown, and here's the tell for how it works: with nothing placed yet, it shows <no .pth files found> as its only option. That's not an error state - it means the node scanned some folder for .pth files and came up empty, and it'll populate normally once a file exists in whatever location it's looking at. The pack's README doesn't document which folder that is, and the placeholder text alone doesn't tell you either. Your best bet if you need to place a file and aren't sure where: check the pack's source on GitHub for the relevant Python file, or just boot ComfyUI and look at the console log - folder-scanning custom nodes typically print the resolved path they're checking even when it's empty, which is usually faster than reading source.
map_location (auto/cpu/cuda) mirrors PyTorch's own torch.load semantics directly - auto picks the best available device, cpu forces the load onto CPU (useful for low-VRAM situations, or just to inspect a file without committing GPU memory to it), and cuda forces it onto GPU. If you're not sure, auto is the sensible default.
Inputs and outputs
Required: model_file, map_location. No optional inputs. Output: pth_model (type PTH_MODEL) - the one and only thing this node produces, meant to be wired straight into a Depth node's pth_model input.
A genuine security note, not a formality
.pth files are PyTorch's own serialization format, and like the older .ckpt checkpoint format the rest of the ecosystem has mostly moved away from, they're typically built on Python's pickle protocol underneath - which means loading one can execute arbitrary code, not just deserialize tensors. This isn't theoretical caution: fake "leaked" model files carrying malicious payloads are a documented pattern in this ecosystem, which is exactly why .safetensors exists and why most model distribution has shifted toward it. This node has no way to know or warn you whether a .pth file is safe - it will load whatever pickle is in it. Only point this at .pth files from a source you actually trust, the same rule you'd apply to any .ckpt file, and be extra cautious about one handed to you inside someone else's shared workflow rather than sourced yourself.
Installing it
Search ComfyUI-CN-Pre in ComfyUI Manager, or manually: cd ComfyUI/custom_nodes && git clone https://github.com/OKIE5/ComfyUI-CN-Pre, then restart. The usual caveat applies here too - this pack's README is a one-line stub unrelated to what it actually does, so there's no documentation for where model_file looks, what formats are actually supported beyond the .pth extension, or anything else about this node specifically. You're working from the node's own parameters and behavior, not written docs.
Where people get burned
The dropdown showing <no .pth files found> trips people up because it reads like a bug rather than an empty state - it isn't. Nothing is broken; there's simply nothing in the folder yet. Beyond that, remember this node is only useful in combination with the pack's Depth nodes - it produces a PTH_MODEL type that nothing else in this pack, and nothing outside it, is likely to consume. If you landed on this node expecting a general-purpose checkpoint loader for something other than a depth model, it's probably not what you're looking for.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model_file | COMBO | 1 options: <no .pth files found> | |
| map_location | COMBO | 3 options: auto, cpu, cuda |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| pth_model | PTH_MODEL | — |