路径组装丨拼接
Stop hand-typing file paths into a dozen string widgets
- path
Every workflow has that one folder path you've typed into four different nodes. PathAssembler is the QING pack's fix: you build a path once - a base plus up to five segments - and wire the result to every node that needs it. Change the folder once, and every consumer follows. It's the "one source, many consumers" pattern from the node-plumbing playbook, applied to filesystem paths.
What it does
Inputs: base_path, then level_1 through level_5 (each a string), plus two behavior toggles. absolute_mode is keep (default) or make_absolute - the latter turns a relative result into an absolute path. normalize (default true) cleans up the result: it aligns path separators to your OS and runs os.path.normpath, so foo//bar/../baz becomes foo/baz. It also expands ~ and environment variables like $HOME / %USERPROFILE%.
There's an optional path_list input for batch mode: the node accepts a list of paths (via a connected string-list) and assembles every combination, useful for generating multiple output paths in one shot.
The single output is path (STRING).
How you'd actually use it
Wire it into QING_SaveImage's custom_save_path, a LoadPathText, RandomDirectoryItem, or the input-dir fields on the pack's model/merge nodes. The real win is keeping one consistent root: base_path = your scratch folder, and each level a subdirectory you can feed from a variable or a shared text node. Need to redirect a whole experiment to a new drive? Change base_path once.
The path handling is legitimately careful: it joins with os.path.join (so you never get missing or doubled slashes), strips empty segments, and only applies make_absolute when the path isn't already absolute. This is the node you reach for when "typing a string" has become a recurring maintenance chore across a graph.
Installing it
It ships in ComfyUI-QING:
cd ComfyUI/custom_nodes
git clone https://github.com/GAO-SHIQING/ComfyUI-QING
cd ComfyUI-QING
python install_dependencies.py
Restart ComfyUI after. The pack is one install that covers 79 nodes - AI API wrappers, image, mask, SVG, data tools - and this one is pure standard-library Python, so it has zero extra requirements beyond what the install script already sets up. (That script pulls Pillow, opencv-python, scipy, scikit-image, cairosvg, openai.) Ignore the README's GAOSHI-QING clone-URL typo; the repo is GAO-SHIQING/ComfyUI-QING.
Things to know
path_list mode is the one to be careful with - it's a forceInput string input, so when nothing's connected the node falls back to the plain five-level assembly, and when connected it iterates. For a single path, the base+levels are all you need. One behavior worth remembering: empty levels are silently skipped, so leaving level_3 blank just means the path is shallower - it's not an error and won't insert an empty segment. And because normalize is on by default, don't expect a Windows-style path to survive on a Linux box intact; that's the point.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| base_path | STRING | — | |
| level_1 | STRING | — | |
| level_2 | STRING | — | |
| level_3 | STRING | — | |
| level_4 | STRING | — | |
| level_5 | STRING | — | |
| absolute_mode | COMBO | keep | 2 options: keep, make_absolute |
| normalize | BOOLEAN | true | — |
| path_listopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| path | STRING | — |