fix prompt cropping

This commit is contained in:
Vladimir Mandic
2024-05-12 08:39:11 -04:00
parent b69d7ed7e8
commit 7e6588685f
3 changed files with 10 additions and 4 deletions
+8 -2
View File
@@ -218,8 +218,14 @@ def parse_generation_parameters(infotext, no_prompt=False):
params_idx = sanitized.find(f'{first_param}:') if first_param else -1
negative_idx = infotext.find("Negative prompt:")
prompt = infotext[:params_idx] if negative_idx == -1 else infotext[:negative_idx] # prompt can be with or without negative prompt
negative = infotext[negative_idx:params_idx] if negative_idx >= 0 else ''
if negative_idx == -1: # prompt can be without negative prompt
prompt = infotext[:params_idx] if params_idx > 0 else infotext
else:
prompt = infotext[:negative_idx]
if negative_idx >= 0:
negative = infotext[negative_idx:params_idx] if params_idx > 0 else infotext[negative_idx:]
else:
negative = ''
negative = negative.strip().strip(',')
for k, v in params.copy().items(): # avoid dict-has-changed
+1 -1
Submodule wiki updated: 6b939596ac...7d0d151d44