Spaces:
Runtime error
Runtime error
artificialguybr
commited on
Commit
•
f39f62b
1
Parent(s):
1f74d50
Update app.py
Browse files
app.py
CHANGED
@@ -71,38 +71,39 @@ with gr.Blocks() as app:
|
|
71 |
refined_result = gr.Image(interactive=False, label="Refined Generated Image")
|
72 |
post_processed_result = gr.Image(interactive=False, label="Post-Processed Image")
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
with gr.
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
with gr.TabItem("Custom color palette"):
|
100 |
-
enable_custom_palette = gr.Checkbox(label="Enable", value=False)
|
101 |
-
palette_image = gr.Image(label="Color palette image", type="pil")
|
102 |
-
palette_size_custom = gr.Slider(label="Palette Size", minimum=1, maximum=256, step=1, value=16)
|
103 |
-
dither_methods_custom = gr.Radio(choices=["None", "Floyd-Steinberg"], label="Colors Dither Method")
|
104 |
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
gallery.select(update_selection, outputs=[prompt, selected_info, selected_state])
|
108 |
prompt.submit(fn=run_lora, inputs=[prompt, selected_state], outputs=[result, refined_result])
|
|
|
71 |
refined_result = gr.Image(interactive=False, label="Refined Generated Image")
|
72 |
post_processed_result = gr.Image(interactive=False, label="Post-Processed Image")
|
73 |
|
74 |
+
with gr.Blocks():
|
75 |
+
with gr.Accordion(label="Pixel art", open=False):
|
76 |
+
enabled = gr.Checkbox(label="Enable", value=False)
|
77 |
+
with gr.Row():
|
78 |
+
downscale = gr.Slider(label="Downscale", minimum=1, maximum=32, step=2, value=8)
|
79 |
+
need_rescale = gr.Checkbox(label="Rescale to original size", value=True)
|
80 |
+
with gr.Tabs():
|
81 |
+
with gr.TabItem("Color"):
|
82 |
+
enable_color_limit = gr.Checkbox(label="Enable", value=False)
|
83 |
+
palette_size_color = gr.Slider(label="Palette Size", minimum=1, maximum=256, step=1, value=16)
|
84 |
+
quantization_methods_color = gr.Radio(choices=["Median Cut", "Maximum Coverage", "Fast Octree"], label="Colors Quantization Method")
|
85 |
+
dither_methods_color = gr.Radio(choices=["None", "Floyd-Steinberg"], label="Colors Dither Method")
|
86 |
+
k_means_color = gr.Checkbox(label="Enable k-means for color quantization", value=True)
|
87 |
+
|
88 |
+
with gr.TabItem("Grayscale"):
|
89 |
+
enable_grayscale = gr.Checkbox(label="Enable", value=False)
|
90 |
+
palette_size_gray = gr.Slider(label="Palette Size", minimum=1, maximum=256, step=1, value=16)
|
91 |
+
quantization_methods_gray = gr.Radio(choices=["Median Cut", "Maximum Coverage", "Fast Octree"], label="Colors Quantization Method")
|
92 |
+
dither_methods_gray = gr.Radio(choices=["None", "Floyd-Steinberg"], label="Colors Dither Method")
|
93 |
+
k_means_gray = gr.Checkbox(label="Enable k-means for color quantization", value=True)
|
94 |
+
|
95 |
+
with gr.TabItem("Black and white"):
|
96 |
+
enable_black_and_white = gr.Checkbox(label="Enable", value=False)
|
97 |
+
inverse_black_and_white = gr.Checkbox(label="Inverse", value=False)
|
98 |
+
threshold_black_and_white = gr.Slider(label="Threshold", minimum=1, maximum=256, step=1, value=128)
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
+
with gr.TabItem("Custom color palette"):
|
101 |
+
enable_custom_palette = gr.Checkbox(label="Enable", value=False)
|
102 |
+
palette_image = gr.Image(label="Color palette image", type="pil")
|
103 |
+
palette_size_custom = gr.Slider(label="Palette Size", minimum=1, maximum=256, step=1, value=16)
|
104 |
+
dither_methods_custom = gr.Radio(choices=["None", "Floyd-Steinberg"], label="Colors Dither Method")
|
105 |
+
|
106 |
+
post_process_button = gr.Button("Apply Post-Processing")
|
107 |
|
108 |
gallery.select(update_selection, outputs=[prompt, selected_info, selected_state])
|
109 |
prompt.submit(fn=run_lora, inputs=[prompt, selected_state], outputs=[result, refined_result])
|