mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: use consistent file name in gradio (#1932)
* feat: use consistent file name in gradio returns and uses filepaths instead of numpy image by saving to temp dir uses double the temp dir file storage on disk as it saves to temp dir and gradio temp dir when displaying the image, but reuses logged output image * feat: delete temp images after yielding to gradio * feat: use args temp path if given * chore: code cleanup, remove redundant if statement
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import ldm_patched.modules.args_parser as args_parser
|
||||
import os
|
||||
|
||||
from tempfile import gettempdir
|
||||
|
||||
args_parser.parser.add_argument("--share", action='store_true', help="Set whether to share on Gradio.")
|
||||
args_parser.parser.add_argument("--preset", type=str, default=None, help="Apply specified UI preset.")
|
||||
@@ -40,7 +42,11 @@ args_parser.args.always_offload_from_vram = not args_parser.args.disable_offload
|
||||
if args_parser.args.disable_analytics:
|
||||
import os
|
||||
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
|
||||
|
||||
if args_parser.args.disable_in_browser:
|
||||
args_parser.args.in_browser = False
|
||||
|
||||
if args_parser.args.temp_path is None:
|
||||
args_parser.args.temp_path = os.path.join(gettempdir(), 'Fooocus')
|
||||
|
||||
args = args_parser.args
|
||||
|
||||
Reference in New Issue
Block a user