Image to Path
Save an image and get a usable file path back
- images
- path
ComfyUI's built-in image-saving node gives you a preview thumbnail and nothing else - no way to reference where the file landed from later in the graph. img2path fixes that specifically for agent-style workflows: it saves the image like a normal save node, but hands back the resulting file path as a STRING you can actually wire into something downstream, like an image-hosting node or a tool that expects a file reference instead of raw pixels.
How it works
Give it an image and a filename prefix, and it writes the file to disk the way ComfyUI normally would, then returns the saved path as text instead of just displaying a preview.
The inputs and outputs that matter
filename_prefix(default: "ComfyUI") - the prefix for the saved file's name, same convention as ComfyUI's native save node.images(optional) - the image(s) to save.
Output: path (STRING) - the file's location on disk after saving. This node is also flagged as an output node, meaning ComfyUI will always execute it during a run even if nothing downstream consumes its output - useful if you want the save-to-disk side effect to happen regardless of whether you're using the path elsewhere.
How to install it
Via ComfyUI Manager: search comfyui_LLM_party, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/heshengtao/comfyui_LLM_party.git
Then pip install -r requirements.txt from inside the pack folder using ComfyUI's own Python, and restart. No models or API keys needed - this is local filesystem work.
Common issues & troubleshooting
The path this node returns doesn't point anywhere you can browse. This is the important one on a hosted or cloud executor: the path is local to wherever the node actually ran, and on a serverless/cloud worker that's the container's own ephemeral storage, not a folder you can go open afterward. Don't treat the returned path as something you'll retrieve later - use it immediately downstream, in the same run, by feeding it into whatever needs a file reference (an upload/hosting node, a tool call that reads local paths). If you actually want the image itself out of the run, that's a job for a real output/save step, not for chasing this string after the fact.
images is empty and the node errors. It's an optional input in the schema, but the node presumably has nothing useful to save without one - make sure an actual image is wired in upstream before expecting a valid path back.
Filenames collide or overwrite unexpectedly. filename_prefix behaves like ComfyUI's native save node - if you're running this in a loop and want distinct files per iteration, make sure whatever's feeding the prefix actually varies between iterations rather than staying static.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| filename_prefix | STRING | ComfyUI | — |
| imagesopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| path | STRING | — |