Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Save Image default value #6387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andreszs
Copy link

@andreszs andreszs commented Jan 7, 2025

Set a more useful default filename for the Save Image node. Sample output path would be: output/2025-01-07/190401_00001_.png

Sorting the folders and files by name will also sort them chronologically.

Note that "00001" is a suffix added by ComfyUI itself.

Set a more useful default filename for the **Save Image** node. Sample output path would be: **output/2025-01-07/190401_00001_.png**

Note thate "00001_" is a suffix added by ComfyUI itself.
@catboxanon
Copy link
Contributor

catboxanon commented Jan 7, 2025

The date syntax in the filename is substituted in the frontend, not the backend. I'm not sure this is a safe change to make, especially since this behavior technically comes from a frontend extension that can be disabled by the user (Comfy.SaveImageExtraOutput).
https://github.com/Comfy-Org/ComfyUI_frontend/blob/daee073045e895821536d873083abf071602b3d8/src/scripts/utils.ts#L48

@andreszs
Copy link
Author

andreszs commented Jan 8, 2025

The date syntax in the filename is substituted in the frontend, not the backend. I'm not sure this is a safe change to make, especially since this behavior technically comes from a frontend extension that can be disabled by the user (Comfy.SaveImageExtraOutput). https://github.com/Comfy-Org/ComfyUI_frontend/blob/daee073045e895821536d873083abf071602b3d8/src/scripts/utils.ts#L48

And that remains unchanged, this PR simply updates the default value of newly created Save Image node from ComfyUI to %date:yyyy-MM-dd%/%date:hhmmss%.

I don't think the filename formatting depends on any extension, it's more likely a core feature.

@catboxanon
Copy link
Contributor

catboxanon commented Jan 8, 2025

It's problematic in that you are relying on the frontend in use to implement that functionality. The string is processed in the frontend before being sent to the backend. Raw backend requests will do nothing with that special syntax.

It's also not a core feature, it's still an extension. Extensions have been moved to core in the past, which prevents them from being disabled, but this is not one of those. Changing the default of this node would warrant proposing this to be a core feature imo -- but this still doesn't fully address the aforementioned point.

Fundamentally I have nothing against your PR in it's desire to improve the default file output structure but these things should be considered.

@andreszs
Copy link
Author

It's problematic in that you are relying on the frontend in use to implement that functionality. The string is processed in the frontend before being sent to the backend. Raw backend requests will do nothing with that special syntax.

But there’s no way to set this default value in the ComfyUI Frontend repository.

By the way, what other frontends exist beyond the default one? And why should we concern ourselves with the implementations of third-party frontends rather than focusing on the official one? In the worst-case scenario, it’s the responsibility of the third-party frontend developer to ensure compliance with the standard frontend behavior—not the other way around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants