LPIPS Model Loader
The one-input-free node that brings a perceptual quality meter into your workflow
- LPIPS_MODEL
In the pack's tuning rig, this is the boring but necessary node: LPIPS_Model_Loader has no inputs, does one thing, and hands you a model you'll never see. What it's really doing is giving you an objective answer to "how much quality am I giving up for this speedup?"
LPIPS - Learned Perceptual Image Patch Similarity - is the standard way to answer that. Plain pixel-difference metrics like MSE reward images that match the reference pixel-for-pixel, which is not the same thing as looking the same to a human. LPIPS instead runs both images through a pretrained network (here VGG) and compares their deep feature maps. Two images that differ in ways people don't care about score close; the same face with slightly wrong proportions scores high. That's why the pack's TeaCache_Patcher uses it as the "quality" evaluation metric: a run that's faster but scores a big LPIPS distance to the reference render is a run that visibly changed your image.
How it works
Under the hood it's a thin wrapper around the lpips Python package - lpips.LPIPS(net='vgg'), loaded on CPU and held in a global in-memory cache so you only pay the cost once per ComfyUI session. On first run it needs to pull the VGG weights, so make sure you have internet once during setup. After that it's instant, and its single output, LPIPS_MODEL, feeds straight into the TeaCache_LPIPS_Evaluator.
Because the model lives in that global cache, there's a subtle thing to know: it's not a file you download or manage, and re-running the loader won't reset or reload anything. If you want a genuinely fresh state, restart ComfyUI.
Installing and using it
Standard pack install - ComfyUI Manager, search CUI-Lumina2-TeaCache, install and restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/spawner1145/CUI-Lumina2-TeaCache.git
The one real prerequisite: the lpips package has to be importable. It's in the pack's requirements, so Manager installs it automatically; if you went manual and skipped that, the loader throws an error telling you to pip install lpips. Easy fix.
The full wiring it's meant for: run a baseline render with rel_l1_thresh = 0, store it with Store_Baseline_Image, then for each candidate run feed the decoded output and the baseline into TeaCache_LPIPS_Evaluator along with this node's model and the patcher's run_id. The evaluator does the math and the Result Collector writes it to the log.
It's a tiny node and it won't impress anyone on a wiring diagram, but it's the piece that turns "faster, I guess?" into an actual measurement. If you're just here to make renders faster and never plan to compare settings, you can skip it - TeaCache_Lumina2 doesn't need it.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LPIPS_MODEL | LPIPS_MODEL | — |