mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-03-03 04:01:01 +00:00
gradio4
This commit is contained in:
@@ -31,7 +31,7 @@ def check_tmp_file(gradio, filename):
|
||||
return False
|
||||
|
||||
|
||||
def save_pil_to_file(self, pil_image, dir=None, format="png"):
|
||||
def save_pil_to_file(pil_image, dir=None, format="png", cache_dir=None):
|
||||
already_saved_as = getattr(pil_image, 'already_saved_as', None)
|
||||
if already_saved_as and os.path.isfile(already_saved_as):
|
||||
register_tmp_file(shared.demo, already_saved_as)
|
||||
@@ -61,7 +61,7 @@ def save_pil_to_file(self, pil_image, dir=None, format="png"):
|
||||
|
||||
def install_ui_tempdir_override():
|
||||
"""override save to file function so that it also writes PNG info"""
|
||||
gradio.components.IOComponent.pil_to_temp_file = save_pil_to_file
|
||||
gradio.processing_utils.save_pil_to_cache = save_pil_to_file
|
||||
|
||||
|
||||
def on_tmpdir_changed():
|
||||
|
||||
Reference in New Issue
Block a user