How to Change ComfyUI Output Folder Location
When using ComfyUI, you might need to change the default output folder location. Here are several methods to achieve this:
Method 1: Using Launch Parameters (Recommended)
This is the simplest and recommended method that doesn’t require any code modification.
For Windows Users
- Create a batch file (e.g., start_comfy.bat)
- Enter the command: python main.py —output-directory D:\your\custom\path
- Replace D:\your\custom\path with your desired output path
For Linux/Mac Users
- Create a shell script (e.g., start_comfy.sh)
- Enter the command: python main.py —output-directory /your/custom/path
- Replace /your/custom/path with your desired output path
- Make the script executable
For ComfyUI Portable Users
- Edit run_nvidia_gpu.bat (or your corresponding launch file)
- Add to the end of the command: —output-directory E:\your\custom\path
- Replace E:\your\custom\path with your desired output path
Method 2: Using WAS Node (Workflow Solution)
For more flexible control within workflows:
- Install the WAS Node Suite
- Use its Image Save node instead of the default save node
- Configure save path and filename format directly in the node
WAS Node Suite: https://github.com/WASasquatch/was-node-suite-comfyui
Method 3: Using Symbolic Links (Advanced Users)
To redirect output to another drive:
- Delete or rename the original output folder
- Open Command Prompt as administrator
- Enter the command: mklink /D “C:\ComfyUI\output” “D:\your\custom\path”
- Replace the paths with your actual paths
Important Notes
- Using launch parameters is the safest method and won’t affect ComfyUI updates
- Avoid directly modifying folder_paths.py as it may affect future updates
- Ensure the new output path has proper write permissions
- When using symbolic links, make sure the target path exists
Advanced Usage
Automatic Date Folders
To automatically organize outputs by date:
- Convert filename_prefix to input in the Save Image node
- Connect a Primitive node to filename_prefix
- Use the format: %date:yyyy-MM-dd%/ComfyUI
This will create a file structure like 2024-03-21/ComfyUI_xxxxx.png