🐾MiaoshouAI Load TransNet Model
The one-click TransNetV2 loader that hides the one real gotcha
- TransNet_model
The loader node in MiaoshouAI's video segmentation pack, and it's refreshingly boring: it grabs TransNetV2's pre-converted PyTorch weights on first run and hands you a TRANSNET_MODEL to feed into "🐾MiaoshouAI Segment Video". If you've ever loaded a Qwen2.5-VL checkpoint in ComfyUI, the shape will feel familiar - the code is even modeled on that structure.
What it does
Two inputs, and both have sensible defaults. model has exactly one choice - transnetv2-pytorch-weights - so don't go hunting for more options in the dropdown; there aren't any. device (auto/cpu/cuda) does what you'd expect. auto picks cuda if a GPU is around and falls back to CPU otherwise. And here's the nice part: TransNetV2's input is a tiny 48×27, so CPU is genuinely fine for this. You're not choosing between two hours and twenty minutes.
The interesting bit is the download. On first run, if the weights aren't on disk, the node pulls transnetv2-pytorch-weights.pth from the author's HuggingFace repo (MiaoshouAI/transnetv2-pytorch-weights) into ComfyUI/models/VLM/transnetv2-pytorch-weights/. No API key, no cloud service, no license gates - just a one-time file download from HuggingFace, same as any checkpoint you've ever grabbed. It needs huggingface_hub and a working internet connection once; after that it loads from disk every time.
The one real trap
The README has a genuinely bad instruction. It tells you to download the original TransNetV2 weights directory from soCzech's repo and drop it into the node folder. Those are the TensorFlow weights, and this node cannot load them - it specifically looks for a pre-converted .pth file and errors out if it finds anything else. If you followed the manual path and hit a "PyTorch weights not found" error, that's why. Delete what you manually downloaded and just let the node fetch its own file.
There's a matching package trap. The code imports transnetv2_pytorch, which is a separate pip package from the original transnetv2 - the README says pip install transnetv2, and that's wrong for this code. The pack's own requirements.txt installs the correct transnetv2-pytorch, which is why you should let the pack's requirements do their job instead of hand-typing the README's commands.
Install
Same as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/miaoshouai/ComfyUI-Video-Segmentation
cd ComfyUI-Video-Segmentation
pip install -r requirements.txt
…then restart ComfyUI. Or ComfyUI Manager → Custom Nodes → search "MiaoshouAI" → Install. One heads-up before you hit install: requirements.txt also pulls in TensorFlow 2.x even though the shipped code never imports it - you'll absorb that big install whether you use it or not.
Output
A single TransNet_model wire, which connects to the Segment Video node. One wire, nothing to tune afterward. If you were hoping the model dropdown would let you swap between variants, prepare to be disappointed - the pack ships exactly one model and this node exists to load it. Set it, forget it, and let Segment Video do the actual work.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | transnetv2-weights | 1 options: transnetv2-pytorch-weights |
| device | COMBO | auto | 3 options: auto, cpu, cuda |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TransNet_model | TRANSNET_MODEL | — |