Nodes/CUI-Lumina2-TeaCache/Store Baseline Image
ComfyUI Node

Store Baseline Image

The one-shot node that pins down your 'quality unchanged' reference

By spawner1145·Created about a year ago·Updated 7 months ago· 20
Store Baseline Image
  • image
  • BASELINE_IMG

TeaCache promises "nearly the same image, but faster." Nearly is the word that needs checking, and Store_Baseline_Image is how you set up that check: it takes one image, holds it in memory as your reference, and hands back a handle the pack's quality scorer can compare against. You render once with TeaCache switched off, store that output here, and suddenly every cached run has a "ground truth" to be judged against.

Mechanically it's almost nothing. You feed it an image (an IMAGE tensor - in practice the output of a VAE Decode, or a Load Image node), it reorders the tensor from the channel-last layout ComfyUI uses into the channel-first layout the LPIPS model expects, stashes the result in a global state manager, and returns it as BASELINE_IMG. That custom output type only connects to the pack's TeaCache_LPIPS_Evaluator, which is the entire point - you can't accidentally feed a raw image where the baseline belongs, because the types won't match.

The trap that will waste your first hour

The stored baseline is a single global slot, and every execution of this node overwrites it. That includes the shipped example workflow, which - as wired - feeds this node the exact same decoded image the evaluator receives as the test image. Run it once and the LPIPS distance comes back near zero, which tells you nothing except that a picture matches itself.

For a real sweep you want the baseline to stay fixed while the test image changes. The reliable pattern: render your reference (rel_l1_thresh = 0), store it, then for subsequent candidate runs don't let this node execute again - feed it from a Load Image of the saved reference, or mute/bypass it so it keeps whatever's already stored. The moment it runs with a new render as input, your baseline quietly becomes that render and every comparison after it is garbage. The pack's docs don't warn you about this; the code is just honest about it.

Installing it

Same as the rest of the pack. ComfyUI Manager, search CUI-Lumina2-TeaCache, install, restart - or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/spawner1145/CUI-Lumina2-TeaCache.git

It's a pure state helper, so it pulls no extra dependencies of its own - the lpips package only becomes relevant when the evaluator runs.

Where it fits in the bigger picture: this node, the LPIPS_Model_Loader, and the TeaCache_LPIPS_Evaluator together form the pack's quality-measurement loop, feeding numbers into the TeaCache_Patcher's auto-tuning and the TeaCache_Result_Collector's log. If that sounds like more plumbing than you need, it is - you can skip the whole analysis side of this pack and just use TeaCache_Lumina2. But if you do use it, remember the golden rule: store your reference once, and keep this node from re-running.

Categoryutils/analysis

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
BASELINE_IMGBASELINE_IMG