aboutsummaryrefslogtreecommitdiffstats
path: root/modules/images.py
diff options
context:
space:
mode:
authorAlex "mcmonkey" Goodwin <git_commits@alexgoodwin.dev>2023-03-11 15:22:22 +0000
committerAlex "mcmonkey" Goodwin <git_commits@alexgoodwin.dev>2023-03-11 15:22:22 +0000
commit7fd19fa4e7039746dc98990883acfa500b90b6c7 (patch)
treef50a780f3b213fa99f3ddf2e8aa4333aa855deeb /modules/images.py
parent5cea278d3ad3a1c1a9b454387241a29bec11699b (diff)
downloadstable-diffusion-webui-gfx803-7fd19fa4e7039746dc98990883acfa500b90b6c7.tar.gz
stable-diffusion-webui-gfx803-7fd19fa4e7039746dc98990883acfa500b90b6c7.tar.bz2
stable-diffusion-webui-gfx803-7fd19fa4e7039746dc98990883acfa500b90b6c7.zip
initial fix for filename length limits on *nix systems
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/images.py b/modules/images.py
index 7df2b08c..4c204fca 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -512,6 +512,9 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
file_decoration = "-" + file_decoration
file_decoration = namegen.apply(file_decoration) + suffix
+ if hasattr(os, 'statvfs'):
+ max_name_len = os.statvfs(path).f_namemax
+ file_decoration = file_decoration[:max_name_len - 5]
if add_number:
basecount = get_next_sequence_number(path, basename)