fix json complete. do not accept headers

pull/75/head^2
GeorgLegato 2023-05-01 01:07:57 +02:00
parent b7a0cb318a
commit 443b3256f5
1 changed files with 7 additions and 7 deletions

View File

@ -9,18 +9,19 @@ from .static_variables import (
def completeOptionals(j): def completeOptionals(j):
if isinstance(j, dict): if isinstance(j, dict):
# Remove header information, user dont pimp our ui
if "prompts" in j: if "prompts" in j:
if "headers" not in j["prompts"]: if "headers" in j["prompts"]:
j["prompts"]["headers"] = ["outpaint steps","prompt"] del j["prompts"]["headers"]
if "negPrompt" not in j: if "negPrompt" not in j:
j["prompts"]["negPrompt"]="" j["negPrompt"]=""
if "prePrompt" not in j: if "prePrompt" not in j:
j["prompts"]["prePrompt"]="" j["prePrompt"]=""
if "postPrompt" not in j: if "postPrompt" not in j:
j["prompts"]["postPrompt"]="" j["postPrompt"]=""
return j return j
@ -32,8 +33,7 @@ def validatePromptJson_throws(data):
validate(instance=data, schema=schema) validate(instance=data, schema=schema)
except Exception: except Exception:
raise "Your prompts are not schema valid." raise Exception("Your prompts are not schema valid.")
#fixJson(data)
return completeOptionals(data) return completeOptionals(data)