Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -61,14 +61,14 @@ with block:
|
|
61 |
model_list = list(map(lambda x: os.path.join("models", x), os.listdir("models")))
|
62 |
assert model_list
|
63 |
model_path = gr.Dropdown(
|
64 |
-
model_list, value = model_list[
|
65 |
label="GGML Models"
|
66 |
)
|
67 |
prompt = gr.Textbox(label="Prompt", value = "Anthropomorphic cat dressed as a fire fighter")
|
68 |
run_button = gr.Button(label="Run")
|
69 |
with gr.Accordion("Advanced options", open=False):
|
70 |
num_samples = gr.Slider(label="Images", minimum=1, maximum=12, value=1, step=1)
|
71 |
-
image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=
|
72 |
#low_threshold = gr.Slider(label="Canny low threshold", minimum=1, maximum=255, value=100, step=1)
|
73 |
#high_threshold = gr.Slider(label="Canny high threshold", minimum=1, maximum=255, value=200, step=1)
|
74 |
sample_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=8, step=1)
|
@@ -84,5 +84,13 @@ with block:
|
|
84 |
ips = [model_path ,prompt, num_samples, image_resolution, sample_steps, seed]
|
85 |
run_button.click(fn=process, inputs=ips, outputs=[result_gallery], show_progress = True)
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
block.launch(server_name='0.0.0.0')
|
|
|
61 |
model_list = list(map(lambda x: os.path.join("models", x), os.listdir("models")))
|
62 |
assert model_list
|
63 |
model_path = gr.Dropdown(
|
64 |
+
model_list, value = model_list[1],
|
65 |
label="GGML Models"
|
66 |
)
|
67 |
prompt = gr.Textbox(label="Prompt", value = "Anthropomorphic cat dressed as a fire fighter")
|
68 |
run_button = gr.Button(label="Run")
|
69 |
with gr.Accordion("Advanced options", open=False):
|
70 |
num_samples = gr.Slider(label="Images", minimum=1, maximum=12, value=1, step=1)
|
71 |
+
image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=256, step=256)
|
72 |
#low_threshold = gr.Slider(label="Canny low threshold", minimum=1, maximum=255, value=100, step=1)
|
73 |
#high_threshold = gr.Slider(label="Canny high threshold", minimum=1, maximum=255, value=200, step=1)
|
74 |
sample_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=8, step=1)
|
|
|
84 |
ips = [model_path ,prompt, num_samples, image_resolution, sample_steps, seed]
|
85 |
run_button.click(fn=process, inputs=ips, outputs=[result_gallery], show_progress = True)
|
86 |
|
87 |
+
gr.Examples(
|
88 |
+
[
|
89 |
+
["models/anime-ggml-model-q4_0.bin", "A lovely cat drinking a cup of tea", 1, 256, 8, 10],
|
90 |
+
["models/deliberate-ggml-model-q4_0.bin", "Anthropomorphic cat dressed as a fire fighter", 1, 256, 8, 20],
|
91 |
+
],
|
92 |
+
inputs = [model_path ,prompt, num_samples, image_resolution, sample_steps, seed],
|
93 |
+
label = "Examples"
|
94 |
+
)
|
95 |
|
96 |
block.launch(server_name='0.0.0.0')
|