aboutsummaryrefslogtreecommitdiffstats
path: root/modules/images.py
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-05-29 05:54:13 +0000
committerAarni Koskela <akx@iki.fi>2023-05-29 06:17:30 +0000
commit00dfe27f59727407c5b408a80ff2a262934df495 (patch)
treeaae9d324a719c7e500f4a0c45821851bc6e41ee0 /modules/images.py
parentb957dcfece29c84ac0cfcd5a69475ff8684c531f (diff)
downloadstable-diffusion-webui-gfx803-00dfe27f59727407c5b408a80ff2a262934df495.tar.gz
stable-diffusion-webui-gfx803-00dfe27f59727407c5b408a80ff2a262934df495.tar.bz2
stable-diffusion-webui-gfx803-00dfe27f59727407c5b408a80ff2a262934df495.zip
Add & use modules.errors.print_error where currently printing exception info by hand
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/images.py b/modules/images.py
index e21e554c..69151bec 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -1,6 +1,4 @@
import datetime
-import sys
-import traceback
import pytz
import io
@@ -18,6 +16,7 @@ import json
import hashlib
from modules import sd_samplers, shared, script_callbacks, errors
+from modules.errors import print_error
from modules.paths_internal import roboto_ttf_file
from modules.shared import opts
@@ -464,8 +463,7 @@ class FilenameGenerator:
replacement = fun(self, *pattern_args)
except Exception:
replacement = None
- print(f"Error adding [{pattern}] to filename", file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
+ print_error(f"Error adding [{pattern}] to filename", exc_info=True)
if replacement == NOTHING_AND_SKIP_PREVIOUS_TEXT:
continue
@@ -697,8 +695,7 @@ def read_info_from_image(image):
Negative prompt: {json_info["uc"]}
Steps: {json_info["steps"]}, Sampler: {sampler}, CFG scale: {json_info["scale"]}, Seed: {json_info["seed"]}, Size: {image.width}x{image.height}, Clip skip: 2, ENSD: 31337"""
except Exception:
- print("Error parsing NovelAI image generation parameters:", file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
+ print_error("Error parsing NovelAI image generation parameters", exc_info=True)
return geninfo, items