Nodes/Comfyui_LG_Tools/🎈LG_PreviewBridge
ComfyUI Node

🎈LG_PreviewBridge

The preview bridge that doesn't reset your mask every refresh

By LAOGOU-666·Created 2 years ago·Updated 7 months ago· 369
🎈LG_PreviewBridge
  • images
  • IMAGE
  • MASK
image

CachePreviewBridge (🎈LG_PreviewBridge) is the original preview bridge from LAOGOU-666's Comfyui_LG_Tools pack, and its whole reason for existing is a specific workflow pain: you load an image, start painting a mask on it, and then something - a refresh, a re-queue, a changed upstream node - wipes your work. This node fixes that with a Cache button.

The README lays out the behavior precisely: you feed the node an image, click Cache, and from that moment the cached image and mask are frozen. Refreshing the graph, disconnecting inputs, or re-running upstream won't reset what you've painted. You keep editing the mask in peace, and when you're done the node outputs the cached image and your mask. It's built for the "repeat this crop-and-mask step many times in a big workflow" pattern, where a reset between runs is not an inconvenience but a productivity killer.

How it works

It's a hybrid: the primary image input is a STRING that carries file info (in the filename [type] format, e.g. myimage.png [input]), and the optional images input takes a raw IMAGE tensor instead. It hashes the incoming image, so on re-execution it can tell whether the input actually changed. If it hasn't, your cached mask sticks. The frontend Cache button is what pins the state; the README explicitly notes the node now also behaves like a load-image-plus-preview combination, saving you from copy-paste in repeated workflows.

The inputs that matter

  • image (STRING) - the file reference. It parses path/filename [type], where type is input, output, or temp, and pulls the file from the matching ComfyUI directory. You usually get this string from a loader node's file-info output rather than typing it.
  • images (IMAGE, optional) - the tensor route. Plug a real image in here if you're not working from a file path.

Outputs: IMAGE and MASK - the cached image and your edited mask, ready for an inpainting or compositing step.

The catch to know about

This is the V1, path-based node, and the pack's newer BridgePreviewNode (V2) takes image tensors directly and adds a skip input for automation. If you're starting fresh, V2 is generally the better on-ramp; CachePreviewBridge is the one to reach for when you're already working with file-path workflows and want that sticky cache behavior specifically.

Installing it

Part of Comfyui_LG_Tools:

cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui_LG_Tools.git
pip install -r requirements.txt

Or via ComfyUI Manager → "Comfyui_LG_Tools" → restart. It's under Add Node → 🎈LAOGOU → Utils.

Common issues

  • "It won't cache my image." Make sure you clicked Cache after loading - the freeze is explicit, not automatic.
  • "My mask resets anyway." If the input hash changed (different image), the cache legitimately invalidates. That's the node doing its job; feed it a stable input.
  • "It doesn't load anything." The image string format matters - wrong [type] or a filename it can't resolve in the given directory and it falls back to an empty default mask. Check the console for the resolution error.
  • Chinese-first UI. The pack's labels are in Chinese, so the Cache button may not read "Cache" at a glance - it's the one that freezes the preview.

For mask-heavy interactive workflows, the "freeze it and forget it" behavior is genuinely useful. Just know which version you're running and why you're on it.

Category🎈LAOGOU/Utils

Inputs (2)

NameTypeDefaultDescription
imageSTRING
imagesoptIMAGE

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK