diff --git a/modules/images.py b/modules/images.py index 848ede756..9a8fe3ed4 100644 --- a/modules/images.py +++ b/modules/images.py @@ -344,7 +344,10 @@ class FilenameGenerator: time_datetime = datetime.datetime.now() time_format = args[0] if len(args) > 0 else self.default_time_format - time_zone = pytz.timezone(args[1]) if len(args) > 1 else None + try: + time_zone = pytz.timezone(args[1]) if len(args) > 1 else None + except pytz.exceptions.UnknownTimeZoneError as _: + time_zone = None time_zone_time = time_datetime.astimezone(time_zone) try: