Spaces:
Runtime error
Runtime error
Add Style
Browse files
app.py
CHANGED
@@ -87,6 +87,8 @@ DEFAULT_STYLE_NAME = "Cinematic"
|
|
87 |
|
88 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
89 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|
|
|
|
|
90 |
return p.replace("{prompt}", positive), n + negative
|
91 |
|
92 |
|
@@ -163,7 +165,7 @@ def generate(
|
|
163 |
prompt_2 = None # type: ignore
|
164 |
if not use_negative_prompt_2:
|
165 |
negative_prompt_2 = None # type: ignore
|
166 |
-
prompt, negative_prompt =
|
167 |
if not apply_refiner:
|
168 |
image = pipe(
|
169 |
prompt=prompt,
|
|
|
87 |
|
88 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
89 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|
90 |
+
if not negative:
|
91 |
+
negative = ""
|
92 |
return p.replace("{prompt}", positive), n + negative
|
93 |
|
94 |
|
|
|
165 |
prompt_2 = None # type: ignore
|
166 |
if not use_negative_prompt_2:
|
167 |
negative_prompt_2 = None # type: ignore
|
168 |
+
prompt, negative_prompt = apply_style(style, prompt, negative_prompt)
|
169 |
if not apply_refiner:
|
170 |
image = pipe(
|
171 |
prompt=prompt,
|