fix and clean json handling, commonX considered, headers not 0,1 anymore
parent
90a5aab9dd
commit
38355dfab8
|
|
@ -4,7 +4,8 @@ from jsonschema import validate
|
|||
from .static_variables import (
|
||||
empty_prompt,
|
||||
invalid_prompt,
|
||||
jsonprompt_schemafile
|
||||
jsonprompt_schemafile,
|
||||
promptTableHeaders
|
||||
)
|
||||
|
||||
def completeOptionals(j):
|
||||
|
|
@ -13,15 +14,22 @@ def completeOptionals(j):
|
|||
if "prompts" in j:
|
||||
if "headers" in j["prompts"]:
|
||||
del j["prompts"]["headers"]
|
||||
|
||||
j["prompts"]["headers"]=promptTableHeaders
|
||||
|
||||
if "negPrompt" not in j:
|
||||
j["negPrompt"]=""
|
||||
|
||||
if "prePrompt" not in j:
|
||||
j["prePrompt"]=""
|
||||
if "commonPromptPrefix" in j:
|
||||
j["prePrompt"]=j["commonPromptPrefix"]
|
||||
else:
|
||||
j["prePrompt"]=""
|
||||
|
||||
if "postPrompt" not in j:
|
||||
j["postPrompt"]=""
|
||||
if "commonPromptSuffix" in j:
|
||||
j["postPrompt"]=j["commonPromptSuffix"]
|
||||
else:
|
||||
j["postPrompt"]=""
|
||||
|
||||
return j
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import os
|
|||
from modules import scripts
|
||||
import modules.sd_samplers
|
||||
|
||||
promptTableHeaders=["Start at second [0,1,...]","Prompt"]
|
||||
|
||||
default_prompt = """
|
||||
{
|
||||
"prePrompt": "Huge spectacular Waterfall in ",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from .static_variables import (
|
|||
)
|
||||
from .helpers import putPrompts, clearPrompts
|
||||
from .prompt_util import readJsonPrompt
|
||||
from .static_variables import promptTableHeaders
|
||||
|
||||
|
||||
def on_ui_tabs():
|
||||
|
|
@ -55,7 +56,7 @@ def on_ui_tabs():
|
|||
|
||||
main_prompts = gr.Dataframe(
|
||||
type="array",
|
||||
headers=["Start at second [0,1,...]", "Prompt"],
|
||||
headers= promptTableHeaders,
|
||||
datatype=["number", "str"],
|
||||
row_count=1,
|
||||
col_count=(2, "fixed"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue