1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Added ability to save images to temp dir

This commit is contained in:
pythongosssss
2023-03-13 19:34:05 +00:00
parent a50e111815
commit 6db777b348
3 changed files with 28 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import os
import sys
import shutil
import threading
import asyncio
@@ -53,7 +54,14 @@ def hijack_progress(server):
return v
setattr(tqdm, "update", wrapped_func)
def cleanup_temp():
temp_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "temp")
if os.path.exists(temp_dir):
shutil.rmtree(temp_dir)
if __name__ == "__main__":
cleanup_temp()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
server = server.PromptServer(loop)
@@ -93,3 +101,4 @@ if __name__ == "__main__":
else:
loop.run_until_complete(run(server, address=address, port=port, verbose=not dont_print, call_on_start=call_on_start))
cleanup_temp()