Nodes/lf-nodes/Register output file
ComfyUI Node

Register output file

The rescue node that makes orphaned output files show up in ComfyUI

By lucafoscili·Created 2 years ago·Updated a day ago· 35
Register output file
  • ui_widget
  • relative_path
relative_path

ComfyUI's output gallery works because every generated file gets registered in its history. But not every node plays along. Plenty of third-party custom nodes write files straight to disk and never tell ComfyUI they exist - so you queue the workflow, the file lands in output/, and the output panel shows… nothing. LF_RegisterOutputFile is the fix: it takes a file path relative to ComfyUI's output directory and registers that existing file in the durable history, making it show up in the gallery like a normal output.

The author's own description nails the use case: "Use this after a third-party node writes a file without publishing it to history." It's a compatibility shim between sloppy nodes and ComfyUI's expectations, and for pipeline automation it's genuinely useful - the kind of thing you add to a workflow once, run headless, and never think about again until the day you'd be lost without it.

How it works

The input is one string, relative_path - a path relative to ComfyUI/output/, for example subfolder/my_result.png. The node does the boring but security-relevant work of normalizing it: it rejects absolute paths, drive letters, Windows-style backslashes in the wrong places, control characters, and any .. parent-traversal, resolves the result against the output root, verifies the file actually exists, and emits a normalized output-relative path. So it's not just registering a file - it's also a polite validator that stops you (or a malicious workflow) from pointing at arbitrary filesystem locations.

The output is a single relative_path string, the normalized path relative to the output directory. That makes it chainable: you can register a file and immediately feed the returned path into another node. There's also an optional ui_widget (an LF_TREE) that shows a save/verification summary in the UI - cosmetic, safe to ignore.

When you need it

  • A custom saver node wrote a file but it's missing from your output history.
  • You're building a Workflow Runner or headless pipeline and want an output-relative path back out of the graph for downstream tooling.
  • You want a clean, validated output-relative path string without hand-typing it.

The main gotcha is in the name: "register" ≠ "write." The file must already exist on disk - point it at a path that isn't there and it raises "does not identify an existing output file." It also will not move or copy anything; it's metadata plumbing, not a file manager. And keep the path relative; it refuses absolute paths on purpose.

Installing

It's part of the LF Nodes pack, so it installs like everything else in it:

cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/lf-nodes.git

restart, done (ComfyUI Manager: search "LF Nodes"). Manager handles the pack's requirements.txt; this specific node is stdlib-plus-folder_paths, so it's light. Two pack-level notes: Pillow is pinned at 12.2.0, and the repo was rewritten with the old one archived in late 2025 - install lucafoscili/lf-nodes, not a stale clone URL.

Honestly, this is a node you might never need - until a workflow drops a file into your output folder and ComfyUI pretends it doesn't exist. Then it's the difference between digging around in a file browser and just clicking the output. Keep it in your back pocket.

Category✨ LF Nodes/IO Operations

Inputs (2)

NameTypeDefaultDescription
relative_pathSTRINGExisting file path relative to ComfyUI's output directory. Use this after a third-party node writes a file without publishing it to history.
ui_widgetoptLF_TREE[object Object]

Outputs (1)

NameTypeDescription
relative_pathSTRINGNormalized path relative to the ComfyUI output directory.