ComfyUI Node

Folder

Point every save node at its own project directory

By wgedeon·Created 11 months ago·Updated 10 months ago· 0
Folder
  • workspace
  • workspace
  • path_full
◄folder►

The fot_Folder node is the part of the comfyui_user_workspaces pack that actually saves you from your own output folder. The fot_Workspace node defines which project you're working on; this node defines where inside it a particular save goes. It's one small job, done well: it turns a WORKSPACE object plus a subfolder name into a real path on disk, and hands that path to you as a plain string you can paste into any save node.

The author's own framing in the README is exactly right - "plug full_path into any save node." That's the entire integration story, and it's why this node is more useful than it looks.

How it works

The mechanism is dead simple, and it's worth knowing because it explains every quirk. The node reads the codename out of the WORKSPACE object you feed it, then builds:

ComfyUI/output/workspaces/<codename>/<folder>/

It makes sure that directory exists (it creates it on the spot - no "create folder first" ritual), and returns the path as a STRING with a trailing slash. That trailing slash matters: it means you can drop the string straight into a Save Image node's filename prefix and get clean project/comfyui_0001_.png-style outputs with no manual path surgery.

The folder widget is also wired to the frontend. The pack's JS talks to a small server endpoint (/comfyui_user_workspaces/get_folders) so the dropdown lists folders that already exist inside the selected workspace, and there's an "add folder" action in the UI that creates new ones on the fly.

The inputs and outputs

Only four fields, and two of them do all the work:

  • workspace (required, WORKSPACE) - the object from fot_Workspace or fot_WorkspaceReadOnly. The node reads the codename from here, so it has to be wired; there's no sensible default.
  • folder (STRING, default "") - the subfolder name inside the workspace. Leave it empty and you get the workspace root itself.

Outputs:

  • workspace (WORKSPACE) - the same object, passed straight through. That's the point: you can chain Folder nodes or keep feeding downstream workspace-aware nodes without losing the context.
  • path_full (STRING) - the created directory path. This is what goes into your save node.

Installing it

Same story as the rest of the pack - Manager search is unreliable here (the README's Manager method is still TODO, and the pack can't be published to the registry because its name starts with an underscore). Clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/wgedeon/comfyui_user_workspaces

Restart ComfyUI. The only dependency is the tiny python_path pip package - no models, no heavy installs.

Where people get burned

Three things catch people. First, the UI's "add folder" endpoint only accepts names matching [a-zA-Z0-9_-] - no spaces, no dots. Typing "v2 final" into the add-folder box gets rejected with a 400. If you type the folder name directly into the node's widget instead, that validation doesn't apply, but then you're on your own for typos and ComfyUI will happily write files into whatever you typed. Second, remember path_full is a prefix for save nodes, not a full filename - you still append a filename. Third, this node is an output node like its sibling, so it runs every queue; trivial here since it's just a mkdir, but it does mean the folder always exists even if you never save to it. Minor. Honestly, for the price of one extra node in your graph, never sorting through a flat PNG dump again is a decent trade.

CategoryFeller of Trees/Workspaces

Inputs (2)

NameTypeDefaultDescription
workspaceWORKSPACE—
folderSTRING—

Outputs (2)

NameTypeDescription
workspaceWORKSPACE—
path_fullSTRING—