How to Change ComfyUI Output Folder Location

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

  1. Create a batch file (e.g., start_comfy.bat)
  2. Enter the command: python main.py --output-directory D:\your\custom\path
  3. Replace D:\your\custom\path with your desired output path

For Linux/Mac Users

  1. Create a shell script (e.g., start_comfy.sh)
  2. Enter the command: python main.py --output-directory /your/custom/path
  3. Replace /your/custom/path with your desired output path
  4. Make the script executable

For ComfyUI Portable Users

  1. Edit run_nvidia_gpu.bat (or your corresponding launch file)
  2. Add to the end of the command: --output-directory E:\your\custom\path
  3. Replace E:\your\custom\path with your desired output path

Method 2: Using WAS Node (Workflow Solution)

For more flexible control within workflows:

  1. Install the WAS Node Suite
  2. Use its Image Save node instead of the default save node
  3. Configure save path and filename format directly in the node

WAS Node Suite: https://github.com/WASasquatch/was-node-suite-comfyui (opens in a new tab)

Method 3: Using Symbolic Links (Advanced Users)

To redirect output to another drive:

  1. Delete or rename the original output folder
  2. Open Command Prompt as administrator
  3. Enter the command: mklink /D "C:\ComfyUI\output" "D:\your\custom\path"
  4. Replace the paths with your actual paths

Important Notes

  1. Using launch parameters is the safest method and won't affect ComfyUI updates
  2. Avoid directly modifying folder_paths.py as it may affect future updates
  3. Ensure the new output path has proper write permissions
  4. When using symbolic links, make sure the target path exists

Advanced Usage

Automatic Date Folders

To automatically organize outputs by date:

  1. Convert filename_prefix to input in the Save Image node
  2. Connect a Primitive node to filename_prefix
  3. Use the format: %date:yyyy-MM-dd%/ComfyUI

This will create a file structure like 2024-03-21/ComfyUI_xxxxx.png

Related Links