-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Feat: Add ability to change the Gradio temp path for saving images. Added ability to clear Gradio temp files and folders on launch #1992
Conversation
I would understand if you don't want to include the delete functionality. I just included it since it's what I have been using on my local to keep the temp files off my drive. |
relates to #1932 where the file of private_logger.py is used as frontend output (but Gradio still somehow creates temp images, even when prividing a filepath) |
@midareashi can you please pull the current main branch into this PR and fix merge conflicts? |
# Conflicts: # launch.py # modules/config.py
also use fallback to system temp dir see https://github.com/gradio-app/gradio/blob/6683ab2589f9d8658e1f51acc1b7526edce988d3/gradio/utils.py#L1151
* Added options to set the Gradio cache path and clear cache on launch. * Renamed cache to temp * clear temp * feat: do not delete temp folder but only clean content also use fallback to system temp dir see https://github.com/gradio-app/gradio/blob/6683ab2589f9d8658e1f51acc1b7526edce988d3/gradio/utils.py#L1151 * refactor: code cleanup * feat: unify arg --temp-path and new temp_path config value * feat: change default temp dir from gradio to fooocus * refactor: move temp path method definition and configs * feat: rename get_temp_path to init_temp_path --------- Co-authored-by: Magee <koshms3@gmail.com> Co-authored-by: steveyourcreativepeople <steve@yourcreativepeople.com> Co-authored-by: Manuel Schmid <manuel.schmid@odt.net>
Changing the temp path is a feature requested by several users. I doubt a lot of users even know Gradio is filling up their appdata folder with temporary images each time they generate. In the future it would be nice to use the image generated in private_logger.py for the completed image and get rid of the duplicate images entirely. Until then...
Delete on launch will only happen when using a custom Gradio Temp path. That will stop this app from removing Gradio Temp images created by other applications.
EDIT @mashb1t: relates to #1924