You hit Queue, the image appears on the canvas, and then you go looking for the file. Where did ComfyUI save it? Why is it called ComfyUI_00042_.png? And how do you get your images sorted into dated folders with useful names instead?
This guide answers all of that from ComfyUI’s own source: where the output folder is for the portable build, a manual install and the new Comfy Desktop, how filename_prefix works (subfolders, dates, sizes and values from other nodes), how to move the output folder to another drive, and why some images never show up in it at all.
- Portable / manual install:
ComfyUI\output\. Comfy Desktop (Windows):%LOCALAPPDATA%\Comfy-Desktop\ComfyUI-Shared\outputby default (~/ComfyUI-Shared/outputon macOS/Linux). - Preview Image doesn’t save to output. It writes to the temp folder, which is wiped when ComfyUI starts. Use Save Image.
- Subfolders: put a slash in
filename_prefix, e.g.portraits/ComfyUI. - Dates:
%date:yyyy-MM-dd%/ComfyUImakes a folder per day. Also%width%,%height%and%KSampler.seed%-style node values. - Move it: launch with
--output-directory "D:\AI\outputs", or change the Output folder in Comfy Desktop’s settings.
New to ComfyUI? Start with my ComfyUI guide for the basics of nodes and workflows.
Where ComfyUI Saves Images
In the code, the output folder is os.path.join(base_path, "output"), so it’s the output folder next to main.py unless you change it.
| Install type | Default output folder |
|---|---|
| Windows portable | ComfyUI_windows_portable\ComfyUI\output\ |
| Manual install (git clone) | ComfyUI/output/ |
| Comfy Desktop, Windows | %LOCALAPPDATA%\Comfy-Desktop\ComfyUI-Shared\output (shared by all builds) |
| Comfy Desktop, macOS / Linux | ~/ComfyUI-Shared/output |
| Docker / cloud GPU | The output folder inside the container’s ComfyUI folder (or whatever volume the template mounts there) |
Comfy Desktop notes from its docs:
- If your Windows user folder already had a
ComfyUI-Sharedfolder, Desktop keeps using it. - If you installed Desktop on a drive other than C:, the folders are under
<drive>:\Comfy-Desktop. - Each build can use the shared output folder (default) or its own. Check the build’s Folders tab.
- The Assets page in the sidebar lists your outputs and has a button to open the folder in Explorer or Finder.
Quickest trick for any install: click the image on the Save Image node or in the sidebar’s queue/assets panel to open it full size, then download it from there.
Save Image vs Preview Image
This catches a lot of people:
| Save Image | Preview Image | |
|---|---|---|
| Folder | output | temp |
| Kept? | Yes | No, the temp folder is wiped each time ComfyUI starts |
| PNG compression level | 4 | 1 (faster, bigger files) |
| File name | Your prefix + counter | Prefix + _temp_ + 5 random letters + counter |
ComfyUI’s own description of Preview Image says it previews images “without saving them to the ComfyUI output directory”. If a template ends in Preview Image, swap it for Save Image (or right-click the preview and choose Save Image to download it).
How File Names Are Built
Save Image writes files named like this:
{filename_prefix}_{counter:05}_.png
So the default prefix ComfyUI gives ComfyUI_00001_.png, ComfyUI_00002_.png and so on. Details from the source:
- The counter is per prefix and per folder. ComfyUI scans the target folder, finds the highest number used with that exact prefix, and adds 1. Change the prefix and the counter starts at 1 again.
- The trailing underscore is part of the format. It helps ComfyUI tell
ComfyUI_00010_.pngapart from a different prefix that starts the same way. - Batches get consecutive numbers, one file per image.
%batch_num%in the prefix is replaced with the image’s index inside the batch (0, 1, 2…).- Missing folders are created automatically.
filename_prefix Tricks: Subfolders, Dates and Node Values
The Save Image tooltip says the prefix “may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.” There are two layers of replacements: the browser front end replaces some before sending the job, and the server replaces others.
Subfolders
Any slash makes a subfolder inside output:
portraits/ComfyUI → output/portraits/ComfyUI_00001_.png
projects/client-a/final → output/projects/client-a/final_00001_.png
You can’t escape the output folder. A prefix like ../../Desktop/img is blocked with “Saving image outside the output folder is not allowed.”
Dates (front end)
Use %date:FORMAT% with these letters:
| Code | Meaning | Example |
|---|---|---|
yyyy / yy |
Year | 2026 / 26 |
MM / M |
Month (padded / not) | 11 / 11 |
dd / d |
Day | 29 / 29 |
hh |
Hour (24h) | 14 |
mm |
Minute | 05 |
ss |
Second | 09 |
Watch the case: capital MM is month, small mm is minutes. Examples:
%date:yyyy-MM-dd%/ComfyUI → output/2026-11-29/ComfyUI_00001_.png
%date:yyyy-MM-dd%/%date:hhmmss% → output/2026-11-29/140509_00001_.png
Server-side variables
The server also replaces these (using the server PC’s clock and the actual image size):
%width%, %height%, %year%, %month%, %day%, %hour%, %minute%, %second%
sdxl/%width%x%height%/img → output/sdxl/1024x1024/img_00001_.png
These are handy for API or headless runs where no browser fills in the date.
Values from other nodes (front end)
%NodeName.widget% pulls a widget value from another node. The front end first looks for a node whose “Node name for S&R” property matches, then falls back to the node’s title. Examples:
%KSampler.seed% → 830172645
%Load Checkpoint.ckpt_name%_%KSampler.seed%
%Empty Latent Image.width%x%Empty Latent Image.height%
- If several nodes share the name, the first match is used. Give nodes unique titles (double-click the title to rename).
- Characters that aren’t allowed in file names (
/ ? < > \ : * | ") in the value are replaced with_. A checkpoint inside a subfolder likesdxl/juggernaut.safetensorsbecomessdxl_juggernaut.safetensors. - Seeds are especially useful: the file name then tells you the seed without opening the image. See my ComfyUI seed guide.
Where Videos, Audio, Latents and Models Go
Other save nodes use a default prefix that already includes a subfolder:
| Node | Default prefix | Ends up in |
|---|---|---|
| Save Image | ComfyUI |
output/ |
| Save Video | video/ComfyUI |
output/video/ |
| Save Audio (all formats) | audio/ComfyUI |
output/audio/ |
| Save Latent | latents/ComfyUI |
output/latents/ |
| Checkpoint Save (model merging) | checkpoints/ComfyUI |
output/checkpoints/ |
| Extract and Save LoRA | loras/ComfyUI_extracted_lora |
output/loras/ |
Note that saved checkpoints and LoRAs land in output, not in models. Move them to models/checkpoints or models/loras to load them. My ComfyUI save video guide covers video formats.
How to Change the Output Folder
Portable or manual install: launch flag
Add --output-directory to your launch command. For portable, edit run_nvidia_gpu.bat:
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --output-directory "D:\AI\ComfyUI-output"
Related flags from cli_args.py:
| Flag | What it sets |
|---|---|
--output-directory |
Output folder (overrides --base-directory) |
--input-directory |
Input folder (where Load Image uploads go) |
--temp-directory |
Temp folder for previews |
--base-directory |
Base for models, custom_nodes, input, output, temp and user all at once |
--user-directory |
User folder (settings, saved workflows); absolute path |
Full list in ComfyUI command line arguments. To share models (not outputs) with another install, use extra_model_paths.yaml.
Comfy Desktop: settings
- All builds: Desktop settings → Folders tab → Shared folders → Output row → change folder.
- One build: open the build → Folders tab → turn off Use shared output to use the build’s own output folder.
Symlink (advanced)
You can also replace the output folder with a directory junction to another drive (mklink /J on Windows). The flag is simpler and survives updates better.
Workflow Metadata in Your Images
Save Image embeds the prompt and the full workflow as PNG text chunks. That’s why you can drag any ComfyUI PNG back onto the canvas to reload the exact workflow, seed included.
- To strip it (for example before sharing images publicly), launch with
--disable-metadata. - Converting to JPG or uploading to many websites removes the metadata, so keep the original PNGs if you want to reload workflows later.
- Preview Image also embeds metadata, but the file is temporary.
Common Problems
| Problem | Cause | Fix |
|---|---|---|
| Output folder is empty | Workflow ends in Preview Image | Use Save Image |
| Can’t find images in Comfy Desktop | Looking in the install folder, not the shared folder | Check ComfyUI-Shared\output or the Assets page |
%date:...% appears literally in file names |
Job sent via API, not the browser front end | Use server variables %year%-%month%-%day% |
| Wrong minute/month in names | MM vs mm mix-up | MM = month, mm = minutes |
| “Saving image outside the output folder is not allowed” | .. or an absolute path in the prefix |
Use --output-directory instead |
| Node value not replaced | Node title doesn’t match, or widget name is wrong | Rename the node to something unique; check the widget’s exact name |
| Dragging a PNG doesn’t load the workflow | Metadata stripped (JPG, website, --disable-metadata) |
Use the original PNG |
FAQ
Where does ComfyUI save images?
In the output folder inside your ComfyUI folder for portable and manual installs. Comfy Desktop uses a shared folder: %LOCALAPPDATA%\Comfy-Desktop\ComfyUI-Shared\output on Windows and ~/ComfyUI-Shared/output on macOS and Linux.
Why are my images not saved?
Your workflow probably uses Preview Image, which writes to the temp folder that ComfyUI wipes on every start. Replace it with Save Image.
How do I save images into a folder per day?
Set filename_prefix to %date:yyyy-MM-dd%/ComfyUI. ComfyUI creates the dated subfolder automatically.
Can I put the seed in the file name?
Yes. Use %KSampler.seed% in filename_prefix (match the node’s title or its “Node name for S&R” property).
How do I change the ComfyUI output folder?
Add --output-directory "D:\your\folder" to the launch command, or in Comfy Desktop change the Output folder in Desktop settings → Folders.
Why do file names end with an underscore?
The format is prefix, underscore, a five-digit counter, then a final underscore. ComfyUI uses it to find the next free number for that prefix.
Where do merged checkpoints go?
To output/checkpoints/ by default. Move them to models/checkpoints to load them.
Sources
- ComfyUI source: folder_paths.py (output folder, get_save_image_path, server variables, counter, outside-folder check)
- ComfyUI source: nodes.py (SaveImage, PreviewImage, file name format, metadata)
- ComfyUI frontend source (applyTextReplacements and formatDate for %date% and %Node.widget%)
- Comfy Desktop docs: settings and build folders
- ComfyUI source: cli_args.py (directory flags,
--disable-metadata)



