Spaces:
Running
Running
Side-by-side layout: controls 2/5, playable output 3/5
Browse files
app.py
CHANGED
|
@@ -233,25 +233,22 @@ with gr.Blocks(title="Sprite Forge") as demo:
|
|
| 233 |
"""
|
| 234 |
)
|
| 235 |
|
| 236 |
-
with gr.Row():
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
run = gr.Button("Generate", variant="primary", scale=1)
|
| 245 |
-
|
| 246 |
-
with gr.Accordion("Advanced", open=False):
|
| 247 |
-
with gr.Row():
|
| 248 |
-
uploaded = gr.Image(
|
| 249 |
-
label="Or start from your own character",
|
| 250 |
-
type="filepath",
|
| 251 |
-
height=220,
|
| 252 |
-
scale=1,
|
| 253 |
)
|
| 254 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
selected_moves = gr.CheckboxGroup(
|
| 256 |
move_defs.LABELS, value=move_defs.DEFAULT_MOVES, label="Moves"
|
| 257 |
)
|
|
@@ -267,28 +264,29 @@ with gr.Blocks(title="Sprite Forge") as demo:
|
|
| 267 |
list(backends.CANVASES), value=backends.DEFAULT_CANVAS, label="Canvas"
|
| 268 |
)
|
| 269 |
seed = gr.Number(value=1234, label="Seed", precision=0)
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
status = gr.Markdown()
|
| 290 |
|
| 291 |
-
|
|
|
|
|
|
|
| 292 |
|
| 293 |
with gr.Accordion("Sprite sheet, clips and downloads", open=False):
|
| 294 |
with gr.Row():
|
|
|
|
| 233 |
"""
|
| 234 |
)
|
| 235 |
|
| 236 |
+
with gr.Row(equal_height=False):
|
| 237 |
+
# Controls left, the thing you actually came for on the right.
|
| 238 |
+
with gr.Column(scale=2):
|
| 239 |
+
subject = gr.Textbox(
|
| 240 |
+
label="Character",
|
| 241 |
+
value=DEFAULT_SUBJECT,
|
| 242 |
+
placeholder="a scrappy alley cat in a bomber jacket",
|
| 243 |
+
lines=2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
)
|
| 245 |
+
run = gr.Button("Generate", variant="primary", size="lg")
|
| 246 |
+
gr.Examples(EXAMPLES, inputs=subject, label="Try a character")
|
| 247 |
+
|
| 248 |
+
with gr.Accordion("Advanced", open=False):
|
| 249 |
+
uploaded = gr.Image(
|
| 250 |
+
label="Or start from your own character", type="filepath", height=200
|
| 251 |
+
)
|
| 252 |
selected_moves = gr.CheckboxGroup(
|
| 253 |
move_defs.LABELS, value=move_defs.DEFAULT_MOVES, label="Moves"
|
| 254 |
)
|
|
|
|
| 264 |
list(backends.CANVASES), value=backends.DEFAULT_CANVAS, label="Canvas"
|
| 265 |
)
|
| 266 |
seed = gr.Number(value=1234, label="Seed", precision=0)
|
| 267 |
+
with gr.Row():
|
| 268 |
+
duration = gr.Slider(
|
| 269 |
+
2, 5, value=3, step=0.5, label="Clip seconds",
|
| 270 |
+
info="H3 does 5s per move; 3s keeps each move punchy.",
|
| 271 |
+
)
|
| 272 |
+
steps = gr.Slider(4, 8, value=6, step=1, label="H3 steps")
|
| 273 |
+
with gr.Row():
|
| 274 |
+
playback_fps = gr.Slider(4, 24, value=12, step=1, label="Playback fps")
|
| 275 |
+
sprite_height = gr.Slider(64, 512, value=256, step=32, label="Max sprite height")
|
| 276 |
+
with gr.Row():
|
| 277 |
+
tolerance = gr.Slider(0.02, 0.30, value=0.10, step=0.01, label="Key tolerance")
|
| 278 |
+
softness = gr.Slider(0.01, 0.25, value=0.09, step=0.01, label="Edge softness")
|
| 279 |
+
with gr.Row():
|
| 280 |
+
despill = gr.Slider(0, 1, value=1.0, step=0.05, label="Despill")
|
| 281 |
+
despeckle = gr.Slider(0, 4, value=2, step=1, label="Despeckle")
|
| 282 |
+
shrink = gr.Slider(
|
| 283 |
+
0, 0.5, value=0.2, step=0.05, label="Matte shrink",
|
| 284 |
+
info="Chokes the matte inward against 4:2:0 chroma bleed.",
|
| 285 |
+
)
|
|
|
|
| 286 |
|
| 287 |
+
with gr.Column(scale=3):
|
| 288 |
+
demo_frame = gr.HTML(IDLE_PANEL, label="Playable")
|
| 289 |
+
status = gr.Markdown()
|
| 290 |
|
| 291 |
with gr.Accordion("Sprite sheet, clips and downloads", open=False):
|
| 292 |
with gr.Row():
|