Spaces:
Running
on
Zero
Running
on
Zero
Move token index entry to advanced options (#1)
Browse files- Move token index entry to advanced options (e3cc4a6fb5d470a1bd70ff99d80416c7e3bba834)
- Upgrade to latest gradio (e6bba4b48e1919667e99bf3df3195698516081ee)
- Update app.py (5dce82f201cd97ccfe85b3dd8819177b9415ce09)
Co-authored-by: Apolinário from multimodal AI art <multimodalart@users.noreply.huggingface.co>
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 😺
|
|
4 |
colorFrom: pink
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: cc-by-nc-sa-4.0
|
|
|
4 |
colorFrom: pink
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.27.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: cc-by-nc-sa-4.0
|
app.py
CHANGED
@@ -352,35 +352,34 @@ def main():
|
|
352 |
label="Text prompt",
|
353 |
placeholder=PROMPT1,
|
354 |
)
|
355 |
-
|
356 |
subject_sub_prompts = gr.Textbox(
|
357 |
-
|
358 |
-
|
359 |
-
)
|
360 |
-
|
361 |
-
subject_token_indices = gr.Textbox(
|
362 |
-
label="Optional: The token indices of each subject (separate indices for the same subject with commas, and for different subjects with semicolons)",
|
363 |
-
placeholder=SUBJECT_TOKEN_INDICES1,
|
364 |
-
)
|
365 |
-
|
366 |
-
filter_token_indices = gr.Textbox(
|
367 |
-
label="Optional: The token indices to filter, i.e. conjunctions, numbers, postional relations, etc. (if left empty, this will be automatically inferred)",
|
368 |
-
placeholder=FILTER_TOKEN_INDICES1,
|
369 |
-
)
|
370 |
-
|
371 |
-
num_tokens = gr.Textbox(
|
372 |
-
label="Optional: The number of tokens in the prompt (We use this to verify your input, as sometimes rare words are split into more than one token)",
|
373 |
-
placeholder=NUM_TOKENS1,
|
374 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
|
376 |
with gr.Row():
|
377 |
sketchpad = gr.Sketchpad(label="Sketch Pad (draw each bounding box in a different layer)")
|
378 |
layout_image = gr.Image(type="pil", label="Bounding Boxes", interactive=False)
|
379 |
|
380 |
with gr.Row():
|
381 |
-
clear_button = gr.Button(value="Clear")
|
382 |
generate_layout_button = gr.Button(value="Generate layout")
|
383 |
generate_image_button = gr.Button(value="Generate image")
|
|
|
384 |
|
385 |
with gr.Row():
|
386 |
out_images = gr.Gallery(type="pil", label="Generated Images", interactive=False)
|
|
|
352 |
label="Text prompt",
|
353 |
placeholder=PROMPT1,
|
354 |
)
|
|
|
355 |
subject_sub_prompts = gr.Textbox(
|
356 |
+
label="Sub-prompts for each subject (separate with semicolons)",
|
357 |
+
placeholder=SUBJECT_SUB_PROMPTS1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
)
|
359 |
+
with gr.Accordion("Advanced options", open=False):
|
360 |
+
subject_token_indices = gr.Textbox(
|
361 |
+
label="Optional: The token indices of each subject (separate indices for the same subject with commas, and for different subjects with semicolons)",
|
362 |
+
placeholder=SUBJECT_TOKEN_INDICES1,
|
363 |
+
)
|
364 |
+
|
365 |
+
filter_token_indices = gr.Textbox(
|
366 |
+
label="Optional: The token indices to filter, i.e. conjunctions, numbers, postional relations, etc. (if left empty, this will be automatically inferred)",
|
367 |
+
placeholder=FILTER_TOKEN_INDICES1,
|
368 |
+
)
|
369 |
+
|
370 |
+
num_tokens = gr.Textbox(
|
371 |
+
label="Optional: The number of tokens in the prompt (We use this to verify your input, as sometimes rare words are split into more than one token)",
|
372 |
+
placeholder=NUM_TOKENS1,
|
373 |
+
)
|
374 |
|
375 |
with gr.Row():
|
376 |
sketchpad = gr.Sketchpad(label="Sketch Pad (draw each bounding box in a different layer)")
|
377 |
layout_image = gr.Image(type="pil", label="Bounding Boxes", interactive=False)
|
378 |
|
379 |
with gr.Row():
|
|
|
380 |
generate_layout_button = gr.Button(value="Generate layout")
|
381 |
generate_image_button = gr.Button(value="Generate image")
|
382 |
+
clear_button = gr.Button(value="Clear")
|
383 |
|
384 |
with gr.Row():
|
385 |
out_images = gr.Gallery(type="pil", label="Generated Images", interactive=False)
|