Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
cd8bafc
1
Parent(s):
4d1c772
some more explanations
Browse files
app.py
CHANGED
@@ -330,7 +330,13 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
330 |
with gr.Tabs():
|
331 |
with gr.TabItem("Filament Management"):
|
332 |
gr.Markdown(
|
333 |
-
'Manage your filament list. This list will be
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
)
|
335 |
with gr.Row():
|
336 |
load_csv_button = gr.UploadButton(
|
@@ -526,9 +532,17 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
526 |
)
|
527 |
|
528 |
with gr.TabItem("Run Autoforge"):
|
|
|
529 |
accordion_params_dict = {}
|
530 |
accordion_params_ordered_names = []
|
531 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
532 |
with gr.Row():
|
533 |
with gr.Column(scale=1):
|
534 |
gr.Markdown("### Input Image (Required)")
|
@@ -547,14 +561,9 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
547 |
type="filepath",
|
548 |
interactive=False,
|
549 |
)
|
|
|
550 |
with gr.Row():
|
551 |
-
|
552 |
-
label="Download all results (.zip)",
|
553 |
-
interactive=True,
|
554 |
-
visible=False,
|
555 |
-
)
|
556 |
-
with gr.Row():
|
557 |
-
with gr.Accordion("Adjust Autoforge Parameters", open=False):
|
558 |
args_for_accordion = get_script_args_info(
|
559 |
exclude_args=["--input_image"]
|
560 |
)
|
@@ -615,8 +624,15 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
615 |
show_copy_button=False,
|
616 |
)
|
617 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
618 |
# --- Backend Function for Running the Script ---
|
619 |
-
@spaces.GPU
|
620 |
def execute_autoforge_script(
|
621 |
current_filaments_df_state_val, input_image, *accordion_param_values
|
622 |
):
|
|
|
330 |
with gr.Tabs():
|
331 |
with gr.TabItem("Filament Management"):
|
332 |
gr.Markdown(
|
333 |
+
'Manage your filament list. This list will be used by the Autoforge process.'
|
334 |
+
)
|
335 |
+
gr.Markdown(
|
336 |
+
'You can export your Hueforge filaments under "Filaments -> Export" in the Hueforge software. Please make sure to select "CSV" instead of "JSON" during the export dialog.'
|
337 |
+
)
|
338 |
+
gr.Markdown(
|
339 |
+
'To remove a filament simply right-click on any of the fields and select "Delete Row"'
|
340 |
)
|
341 |
with gr.Row():
|
342 |
load_csv_button = gr.UploadButton(
|
|
|
532 |
)
|
533 |
|
534 |
with gr.TabItem("Run Autoforge"):
|
535 |
+
|
536 |
accordion_params_dict = {}
|
537 |
accordion_params_ordered_names = []
|
538 |
|
539 |
+
gr.Markdown(
|
540 |
+
'Here you can upload an image, adjust the parameters and run the Autoforge process. The filaments from the "Filament Management" are automatically used. After the process completes you can download the results at the bottom of the page.'
|
541 |
+
)
|
542 |
+
gr.Markdown(
|
543 |
+
'If you want to limit the number of colors or color swaps you can find the option under the "Autoforge Parameters" as "pruning_max_colors" and "pruning_max_swaps"'
|
544 |
+
)
|
545 |
+
|
546 |
with gr.Row():
|
547 |
with gr.Column(scale=1):
|
548 |
gr.Markdown("### Input Image (Required)")
|
|
|
561 |
type="filepath",
|
562 |
interactive=False,
|
563 |
)
|
564 |
+
|
565 |
with gr.Row():
|
566 |
+
with gr.Accordion("Autoforge Parameters", open=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
args_for_accordion = get_script_args_info(
|
568 |
exclude_args=["--input_image"]
|
569 |
)
|
|
|
624 |
show_copy_button=False,
|
625 |
)
|
626 |
|
627 |
+
with gr.Row():
|
628 |
+
download_zip = gr.File( # was visible=True
|
629 |
+
label="Download all results (.zip)",
|
630 |
+
interactive=True,
|
631 |
+
visible=False,
|
632 |
+
)
|
633 |
+
|
634 |
# --- Backend Function for Running the Script ---
|
635 |
+
@spaces.GPU(duration=120)
|
636 |
def execute_autoforge_script(
|
637 |
current_filaments_df_state_val, input_image, *accordion_param_values
|
638 |
):
|