Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,22 +61,8 @@ with gr.Blocks(title="Face To Pixel Art", theme=gr.themes.Soft()) as demo:
|
|
| 61 |
placeholder="Leave empty for auto-captioning...",
|
| 62 |
info="The trigger words 'p1x3l4rt, pixel art' are added automatically."
|
| 63 |
)
|
| 64 |
-
run_btn = gr.Button("Generate Pixel Art", variant="primary")
|
| 65 |
-
|
| 66 |
-
gr.Examples(
|
| 67 |
-
examples=[
|
| 68 |
-
# Add default values for new sliders
|
| 69 |
-
["./examples/monalisa.jpg", "mona lisa portrait", 1.5, 6, 0.3, 0.3, 0.3],
|
| 70 |
-
["./examples/man.jpg", "photo of a man", 1.5, 6, 0.3, 0.3, 0.3],
|
| 71 |
-
["./examples/landscape.jpg", "a beautiful landscape", 1.5, 6, 0.3, 0.3, 0.3]
|
| 72 |
-
],
|
| 73 |
-
# Update inputs to match the new sliders
|
| 74 |
-
inputs=[input_img, prompt, "cfg_scale", "steps", "img_strength", "depth_strength", "edge_strength"]
|
| 75 |
-
)
|
| 76 |
-
|
| 77 |
-
with gr.Column(scale=1):
|
| 78 |
-
output_img = gr.Image(label="Pixel Art Result")
|
| 79 |
|
|
|
|
| 80 |
with gr.Accordion("Advanced Settings", open=False):
|
| 81 |
cfg_scale = gr.Slider(
|
| 82 |
elem_id="cfg_scale",
|
|
@@ -118,6 +104,34 @@ with gr.Blocks(title="Face To Pixel Art", theme=gr.themes.Soft()) as demo:
|
|
| 118 |
value=0.3,
|
| 119 |
label="EdgeMap Strength (LineArt)"
|
| 120 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
# Event Handler
|
| 123 |
# Update inputs list for the click event
|
|
|
|
| 61 |
placeholder="Leave empty for auto-captioning...",
|
| 62 |
info="The trigger words 'p1x3l4rt, pixel art' are added automatically."
|
| 63 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
# --- MOVED ACCORDION HERE ---
|
| 66 |
with gr.Accordion("Advanced Settings", open=False):
|
| 67 |
cfg_scale = gr.Slider(
|
| 68 |
elem_id="cfg_scale",
|
|
|
|
| 104 |
value=0.3,
|
| 105 |
label="EdgeMap Strength (LineArt)"
|
| 106 |
)
|
| 107 |
+
# --- END OF MOVED BLOCK ---
|
| 108 |
+
|
| 109 |
+
run_btn = gr.Button("Generate Pixel Art", variant="primary")
|
| 110 |
+
|
| 111 |
+
# --- FIX: Pass component OBJECTS, not strings ---
|
| 112 |
+
gr.Examples(
|
| 113 |
+
examples=[
|
| 114 |
+
# Add default values for new sliders
|
| 115 |
+
["./examples/monalisa.jpg", "mona lisa portrait", 1.5, 6, 0.3, 0.3, 0.3],
|
| 116 |
+
["./examples/man.jpg", "photo of a man", 1.5, 6, 0.3, 0.3, 0.3],
|
| 117 |
+
["./examples/landscape.jpg", "a beautiful landscape", 1.5, 6, 0.3, 0.3, 0.3]
|
| 118 |
+
],
|
| 119 |
+
# Pass the actual component variables
|
| 120 |
+
inputs=[
|
| 121 |
+
input_img,
|
| 122 |
+
prompt,
|
| 123 |
+
cfg_scale,
|
| 124 |
+
steps,
|
| 125 |
+
img_strength,
|
| 126 |
+
depth_strength,
|
| 127 |
+
edge_strength
|
| 128 |
+
]
|
| 129 |
+
)
|
| 130 |
+
|
| 131 |
+
with gr.Column(scale=1):
|
| 132 |
+
output_img = gr.Image(label="Pixel Art Result")
|
| 133 |
+
|
| 134 |
+
# The accordion was here, but has been moved to the left column
|
| 135 |
|
| 136 |
# Event Handler
|
| 137 |
# Update inputs list for the click event
|