diff options
author | missionfloyd <missionfloyd@users.noreply.github.com> | 2023-03-25 20:51:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-25 20:51:25 +0000 |
commit | 6f18c9b13f06112d6afe9be062fe5308767ea38a (patch) | |
tree | d82ea08976ca2b5793f449094308aca3c9629099 /modules/images.py | |
parent | 575c17a8f9bc6471a7a0891b665ec42073a18049 (diff) | |
parent | a0d07fb5807ad55c8ccfdfc9a6d9ae3c62b9d211 (diff) | |
download | stable-diffusion-webui-gfx803-6f18c9b13f06112d6afe9be062fe5308767ea38a.tar.gz stable-diffusion-webui-gfx803-6f18c9b13f06112d6afe9be062fe5308767ea38a.tar.bz2 stable-diffusion-webui-gfx803-6f18c9b13f06112d6afe9be062fe5308767ea38a.zip |
Merge branch 'master' into extra-networks-toggle
Diffstat (limited to 'modules/images.py')
-rw-r--r-- | modules/images.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/images.py b/modules/images.py index 7df2b08c..7030aaaa 100644 --- a/modules/images.py +++ b/modules/images.py @@ -573,6 +573,11 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i os.replace(temp_file_path, filename_without_extension + extension)
fullfn_without_extension, extension = os.path.splitext(params.filename)
+ if hasattr(os, 'statvfs'):
+ max_name_len = os.statvfs(path).f_namemax
+ fullfn_without_extension = fullfn_without_extension[:max_name_len - max(4, len(extension))]
+ params.filename = fullfn_without_extension + extension
+ fullfn = params.filename
_atomically_save_image(image, fullfn_without_extension, extension)
image.already_saved_as = fullfn
@@ -640,6 +645,8 @@ Steps: {json_info["steps"]}, Sampler: {sampler}, CFG scale: {json_info["scale"]} def image_data(data):
+ import gradio as gr
+
try:
image = Image.open(io.BytesIO(data))
textinfo, _ = read_info_from_image(image)
@@ -655,7 +662,7 @@ def image_data(data): except Exception:
pass
- return '', None
+ return gr.update(), None
def flatten(img, bgcolor):
|