Fooocus
Fooocus copied to clipboard
Image save filename consistency
Is your feature request related to a problem? Please describe. When you save an image sometime the filename used by the browser is just "image.png" which leads to issue when you save multiple images Sometimes its a more usable "image - timestamp" (ex: "image - 2023-12-15T093912.142")
Describe the idea you'd like Could it be consistently the name with the timestamp? it's easier to save when you organize multiple generation in different folders
Fooocus should always use generate_temp_filename from https://github.com/lllyasviel/Fooocus/blob/main/modules/util.py#L141 (tested locally and in Colab). Please provide some examples and steps to reproduce when the filename is image.png.
(On Windows) Using this button the photo will be saved in the downloads folder with the name "image".
@mJastrzebski6 just to make sure, are you certain you're using the latest version of Fooocus (2.1.857)?
Fooocus should always use generate_temp_filename from https://github.com/lllyasviel/Fooocus/blob/main/modules/util.py#L141 (tested locally and in Colab). Please provide some examples and steps to reproduce when the filename is image.png.
I opened the webpage clicked generate then clicked on one of the image and then on the icon to download.
@mJastrzebski6 just to make sure, are you certain you're using the latest version of Fooocus (2.1.857)?
@flashthepublic can you please also check?
@mJastrzebski6 just to make sure, are you certain you're using the latest version of Fooocus (2.1.857)?
@flashthepublic can you please also check?
Tried on 857
and 859
For information in the History log filename seems correct C:/Tools/Fooocus/Fooocus/outputs/2024-01-01/2024-01-01_11-32-00_3667.png but when saving it points to temp file: C:\Users\ftp\AppData\Local\Temp\gradio\21248590d5ee99f983ee2d975c82f03fc87a1472\image.png
so this might be the issue
Can't reproduce, maybe somebody else is able to help. It also works on Colab for me 😐
One more thing: are you maybe using Firefox? (i tested it in Chrome, but there seem to be a few things not working in FF such as https://github.com/lllyasviel/Fooocus/issues/1425)
@flashthepublic @mJastrzebski6 bump
One more thing: are you maybe using Firefox? (i tested it in Chrome, but there seem to be a few things not working in FF such as #1425)
No, Tested in Brave and Chrome
That's really weird. Can you please provide your console output and check maybe also in Colab, so we can rule out the environment and confirm it independently?
I'm experiencing the same with the latest version of Fooocus. When I right click on an image from the gallery in both Chrome and Firefox, it always wants to save it as "image.png".
I'm experiencing the same with the latest version of Fooocus. When I right click on an image from the gallery in both Chrome and Firefox, it always wants to save it as "image.png".
same here, both on firefox and chrome, both right click and download button - image.png weird but in the outputs folder the photos are saved correctly with the timestamp name
Still not able to reproduce this behavior... Also see https://github.com/lllyasviel/Fooocus/discussions/1798. Any help would be appreciated!
Ok, i was able to reproduce the situation.
Quick background analysis:
- Fooocus creates the image in async_worker.py
- Fooocus yields the result in async_worker.py
- Fooocus updates the gallery component in webui.py
In general, the output of the files has nothing to do with saving the images in the outputs folder. Somehow Chrome adds timestamps etc. to the filename, but i can't tell why this happens as this logic is not implemented in Fooocus.
Fooocus can not influence the filename in the gallery component without adjustments as the images are temporarily created and stored by Gradio in the gradio temp folder after providing the image in a numpy array. Before you ask: the caption does not influence the filename, already tried to make it work with that.
Above reasons show that this issue should not be classified as a bug, but an enhancement.
A potential implementation would be to save each image from numpy to disk to gradio temp file directory, rename the file to the corresponding timestamp when it's been created and then return the filepath string to Gradio.
I hope the analysis has shed some light on the situation at hand.
Definitely an issue with Firefox, both local and in colab.
Probably tangentially related, but my Fooocus install, even when using latest from main
, doesn't save anything to the outputs folder. They only end up in the default gradio directory in the user's appdata temp folder.
I hope the analysis has shed some light on the situation at hand.
To me it seems like gradio is working as designed. How are images ending up in output though?
@machineminded https://github.com/lllyasviel/Fooocus/blob/main/modules/private_logger.py#L27
I'm working on the implementation.
Probably tangentially related, but my Fooocus install, even when using latest from
main
, doesn't save anything to the outputs folder. They only end up in the default gradio directory in the user's appdata temp folder.
Something else may be going on with that, saving to the outputs folder has been rock solid since day 1 on all my installs, local and colab without fail.
If you open a new issue and add your logs and details on your install we can look into it.
You can find the implementation in https://github.com/lllyasviel/Fooocus/pull/1932#issue-2080864810. ~~It's not yet perfect and might be optimized (if even possible), see PR description.~~