new line means break

This commit is contained in:
Vladimir Mandic
2023-11-13 18:08:07 -05:00
parent 69c5cff112
commit 3f6c0d843c
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -23,7 +23,8 @@
- Fix **DPM SDE** scheduler
- Better support for SD 1.5 **inpainting** models
- Add support for **OpenAI Consistency decoder VAE**
- Enhance prompt parsing with long prompts and support for *BREAK* keyword
- Enhance prompt parsing with long prompts and support for *BREAK* keyword
Change-in-behavior: new line in prompt now means *BREAK*
- Update to `diffusers==0.23.0`
- **Extra networks**
- Use multi-threading for 5x load speedup
+5 -2
View File
@@ -14,7 +14,7 @@ from typing import List
import lark
import torch
from compel import Compel
from modules.shared import opts, log
from modules.shared import opts, log, backend, Backend
# a prompt like this: "fantasy landscape with a [mountain:lake:0.25] and [an oak:a christmas tree:0.75][ in foreground::0.6][ in background:0.25] [shoddy:masterful:0.5]"
# will be represented with prompt_schedule like this (assuming steps=100):
@@ -320,7 +320,10 @@ def parse_prompt_attention(text):
whitespace = ''
else:
re_attention = re_attention_v1
text = text.replace('\\n', ' ')
if backend == Backend.DIFFUSERS:
text = text.replace('\n', ' BREAK ')
else:
text = text.replace('\n', ' ')
whitespace = ' '
def multiply_range(start_position, multiplier):