ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Add YAML-based input/output directory configuration to avoid reliance on 8.3 short names on Windows

Open hansolocambo opened this issue 3 weeks ago • 4 comments

Feature Idea

Hello,

I would like to make a feature request regarding how ComfyUI handles custom input and output directories on Windows.

At the moment, input/output paths must be set inside the .bat launcher, like this if the folder is for example in F:\common Comfy\output

Image
  • On Windows, if a path contains spaces, Unicode characters, or special symbols, ComfyUI fails to start unless the user manually provides 8.3 short names.
  • However, NTFS short names are not guaranteed to exist. On some Windows installations they are disabled per-drive (disk policy), so users need to: CMD Windows > enable 8dot3 name creation manually using the command: fsutil 8dot3name set C: 0 to enable the 8.3 names that ComfyUI cannot otherwise find. (Which explains the vast majority of people struggling to customize their input / output folders path.

This leads to confusing errors where users believe the input/output custom path system “doesn’t work”, because the underlying problem (short names disabled) is not generally known.

Add optional configuration entries in the YAML file (where other custom folder paths already exist), for example:

comfyui: base_path: E:/path to/models output_path: E:/whatever path/to/output input_path: E:/whatever path/to/input or any naming scheme you prefer.

This would bring several benefits:

  • No need for 8.3 short names Paths could be stored in a normalized, quoted, Unicode-safe format.
  • Much cleaner setup Users wouldn’t need to edit .bat files or rely on legacy filesystem behavior.
  • Consistency with existing ComfyUI config system where YAML file already defines custom locations for: checkpoints, loras, embeddings, etc.
  • Better portability: Users could move ComfyUI between machines, drives, and OSes without modifying launcher scripts.

Thank you for considering this request.

Existing Solutions

  • activate 8dot3 on a drive if it's not already done: fsutil 8dot3name set C: 0

  • checking the path name in 8dot3 using dir/x in a CMD window.

  • add in the .bat files the --input and --output-directory entries, using old 8.3 path names.

Other

Why I believe this matters On modern Windows, 8.3 short names seem to be disabled for non-system drives. I have 9 drives from C: to K: and for some reason only K: drive had 8.3 disabled. But that's in F: that I decided today to move my input/ouput folders, and how I realized I needed to enable the 8dot3 on F: to make the .bat custom input/ouput entries work.

If paths for input and output are not written in 8.3 format, ComfyUI fails to start or to save ouput/input where we'd want it to. If paths for input and ouput are written in 8.3 format but 8dot3 is not activated in the drive, ComfyUI will start, but first image created will create a new folder structure in the drive with short 8.3 names visible in windows instead of full names (aka it doesn't find the path).

ComfyUI fails or behaves inconsistently unless the user manually fixes the drive configuration, something most users don't even know how to check (fsutil 8dot3name query d:)

Allowing these two paths to be configured inside YAML would remove the dependency on legacy DOS naming entirely.

hansolocambo avatar Nov 09 '25 23:11 hansolocambo

How about using double quotes (or what they are called, I'm not native English speaker) around the paths that contain spaces? Using one of your examples "E:/whatever path/to/output" instead of plain E:/whatever path/to/output. I have ComfyUI set to look for models on multiple drives in folders that probably contain spaces in their path, I never encountered the need to use anything else but double quotes.

Edit: also NTFS 8.3 names creation is disabled probably on my system, various "optimization" programs propose this option for "speed optimization" purposes and probably I checked that at some point.

Edit 2: I don't know what to say, I was unsure and had to verify. python main.py --output-directory "D:\Animation files\space containing path" correctly outputs rendered files in exactly that folder that I created for this test.

jovan2009 avatar Nov 10 '25 00:11 jovan2009

Thanks for testing and even double checking that. That's very nice. Gemini/ChatGPT also advised me that. Even wrote the file for me (to be sure I didn't do it wrong on my end).

** But I can also confirm that this (added to the .bat file) works: python main.py --use-sage-attention --port 8186 --output-directory F:\FMEGAS~1\No\ComfyUI\Common~1\output --input-directory F:\FMegaS~1\No\ComfyUI\Common~1\input

Image

This doesn't work: python main.py --use-sage-attention --port 8186 --output-directory "F:\F MEGA Sync\No\ComfyUI\Common Files\output" --input-directory "F:\F MEGA Sync\No\ComfyUI\Common Files\input"

Image

ComfyUI Terminal: main.py: error: unrecognized arguments: MEGA Sync\No\ComfyUI\Common Files\output Press any key to continue . . .

I'm glad to read it works on your end. Which means I'm doing something wrong. Can't understand what :/ ?

P.S: sorry for strikethrough lines. Can't write a tilde symbol in here without the line being crossed out with a line :/

All this doesn't change the fact that it'd more logical to be able to customize those two folders in the yaml. Like all the others.

hansolocambo avatar Nov 10 '25 01:11 hansolocambo

I am in no way an expert, as a matter of fact I don't fully understand virtual environment and how to use it correctly, so I never use such thing, I always run python system wide, that might be a reason I don't see such errors as yours. From what I can tell looking at your .bat you are using virtual environment.

Another idea (I'm throwing spaghetti at the wall): don't ask me why, but at some point I put in my environment variables this setting: PYTHONCASEOK=1. From what I can understand it has to do with case insensitive file system in windows, see if makes any difference for you. It shouldn't, case and path length are probably totally different things, but you never know.

Edit: funny little coincidence, looking at your .bat files in notepad++ is like looking at my own .bat files in notepad++, I probably use the same color theme :D

Edit 2: to be more clear, my hypothesis is that your problem has more to do with how the underlying Python deals with the windows file system than with what ComfyUI does on top of Python. My regular user, non developer person intuition.

Edit 3: from what I understand the extra model paths yaml tells ComfyUI to look for models in "extra" places beside its default folder. You can have presumably an unlimited amount of folders from where to load models. But you can have only one output folder (if don't want to generate randomly in multiple folders). I could see users misusing that yaml file, setting multiple output folders by mistake, if what you are asking for is implemented.

Edit 4: BTW, I got around to check my situation on my system about 8.3 NTFS file names creation. It looks like is disabled, as I presumed before:

C:\Windows\System32>fsutil 8dot3name query d:
The volume state is: 0 (8dot3 name creation is ENABLED)
The registry state is: 1 (8dot3 name creation is DISABLED on all volumes)

Based on the above settings, 8dot3 name creation is DISABLED on "d:"

jovan2009 avatar Nov 10 '25 07:11 jovan2009

Edit 2: to be more clear, my hypothesis is that your problem has more to do with how the underlying Python deals with the windows file system than with what ComfyUI does on top of Python. My regular user, non developer person intuition.

About the above idea: my current Python installation is not a "standard" one, is a build from this repository: https://github.com/astral-sh/python-build-standalone.git They are the same people that develop uv and ruff .

Essentially is an archive that I downloaded and unzipped "as is" in a folder and I set the path to python.exe in the system environment. One thing to try is to use a similar Python build with what you are using right now, I think you can find a lot of versions there, if not all possible versions. Maybe their builds behave differently in edge cases like yours.

jovan2009 avatar Nov 10 '25 12:11 jovan2009