From 12d6173b5779a4de8e90e8ec3e886182ca752f30 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 16 Sep 2023 17:19:19 -0400 Subject: [PATCH] fix bad styles names --- modules/styles.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/styles.py b/modules/styles.py index abeeb5e08..c9b8ca85f 100644 --- a/modules/styles.py +++ b/modules/styles.py @@ -1,7 +1,8 @@ # We need this so Python doesn't complain about the unknown StableDiffusionProcessing-typehint at runtime from __future__ import annotations -import csv +import re import os +import csv import json from installer import log from modules import paths @@ -9,7 +10,7 @@ from modules import paths class Style(): def __init__(self, name: str, prompt: str = "", negative_prompt: str = "", extra: str = "", filename: str = "", preview: str = ""): - self.name = name + self.name = re.sub(r'[\t\r\n]', '', name).strip() self.prompt = prompt self.negative_prompt = negative_prompt self.extra = extra