Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,7 +69,7 @@ def generate_image(
|
|
| 69 |
else:
|
| 70 |
# Use the provided JSON prompt
|
| 71 |
json_prompt = (
|
| 72 |
-
json.dumps(prompt_in_json)
|
| 73 |
if isinstance(prompt_in_json, (dict, list))
|
| 74 |
else str(prompt_in_json)
|
| 75 |
)
|
|
@@ -116,7 +116,7 @@ def refine_prompt(
|
|
| 116 |
refine_json = {}
|
| 117 |
|
| 118 |
json_prompt_str = (
|
| 119 |
-
json.dumps(refine_json)
|
| 120 |
if isinstance(refine_json, (dict, list))
|
| 121 |
else str(refine_json)
|
| 122 |
)
|
|
@@ -139,7 +139,7 @@ def refine_prompt(
|
|
| 139 |
).images[0]
|
| 140 |
|
| 141 |
print(neg_json_prompt)
|
| 142 |
-
return image, seed, json_prompt, json.dumps(neg_json_prompt), image, json_prompt, seed
|
| 143 |
|
| 144 |
|
| 145 |
css = """
|
|
@@ -186,7 +186,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(primary_hue="violet")) as demo:
|
|
| 186 |
prompt_in_json = gr.Code(
|
| 187 |
label="Structured JSON Prompt (editable)",
|
| 188 |
language="json",
|
| 189 |
-
|
| 190 |
lines=10
|
| 191 |
)
|
| 192 |
|
|
@@ -207,8 +207,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(primary_hue="violet")) as demo:
|
|
| 207 |
refine_json = gr.Code(
|
| 208 |
label="Structured JSON Prompt (editable)",
|
| 209 |
language="json",
|
| 210 |
-
|
| 211 |
-
lines=10
|
| 212 |
)
|
| 213 |
|
| 214 |
with gr.Row():
|
|
|
|
| 69 |
else:
|
| 70 |
# Use the provided JSON prompt
|
| 71 |
json_prompt = (
|
| 72 |
+
json.dumps(prompt_in_json, indent=4)
|
| 73 |
if isinstance(prompt_in_json, (dict, list))
|
| 74 |
else str(prompt_in_json)
|
| 75 |
)
|
|
|
|
| 116 |
refine_json = {}
|
| 117 |
|
| 118 |
json_prompt_str = (
|
| 119 |
+
json.dumps(refine_json, indent=4)
|
| 120 |
if isinstance(refine_json, (dict, list))
|
| 121 |
else str(refine_json)
|
| 122 |
)
|
|
|
|
| 139 |
).images[0]
|
| 140 |
|
| 141 |
print(neg_json_prompt)
|
| 142 |
+
return image, seed, json_prompt, json.dumps(neg_json_prompt, indent=4), image, json_prompt, seed
|
| 143 |
|
| 144 |
|
| 145 |
css = """
|
|
|
|
| 186 |
prompt_in_json = gr.Code(
|
| 187 |
label="Structured JSON Prompt (editable)",
|
| 188 |
language="json",
|
| 189 |
+
wrap_lines=True,
|
| 190 |
lines=10
|
| 191 |
)
|
| 192 |
|
|
|
|
| 207 |
refine_json = gr.Code(
|
| 208 |
label="Structured JSON Prompt (editable)",
|
| 209 |
language="json",
|
| 210 |
+
wrap_lines=True,
|
|
|
|
| 211 |
)
|
| 212 |
|
| 213 |
with gr.Row():
|