Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
35002e5
1
Parent(s):
b157e21
Update app.py
Browse files
app.py
CHANGED
@@ -133,7 +133,7 @@ def save_preferences(lora_1_id, lora_1_scale, lora_2_id, lora_2_scale, prompt, g
|
|
133 |
json.dump({"prompt": prompt, "file_name":image_path.name, "lora_1_id": lora_2_id, "lora_1_scale": lora_1_scale, "lora_2_id": lora_2_id, "lora_2_scale": lora_2_scale, "thumbs_direction": thumbs_direction, "seed": seed}, f)
|
134 |
f.write("\n")
|
135 |
|
136 |
-
return gr.update(visible=True), gr.update(
|
137 |
|
138 |
with gr.Blocks(css=css) as demo:
|
139 |
shuffled_items = gr.State()
|
@@ -167,8 +167,10 @@ with gr.Blocks(css=css) as demo:
|
|
167 |
with gr.Row(visible=False, elem_id="post_gen_info") as post_gen_info:
|
168 |
with gr.Column(min_width=10):
|
169 |
thumbs_up = gr.Button("👍", elem_id="thumbs_up_unclicked")
|
|
|
170 |
with gr.Column(min_width=10):
|
171 |
thumbs_down = gr.Button("👎", elem_id="thumbs_down_unclicked")
|
|
|
172 |
with gr.Column(min_width=10):
|
173 |
with gr.Group(elem_id="share-btn-container") as share_group:
|
174 |
community_icon = gr.HTML(community_icon_html)
|
@@ -190,8 +192,8 @@ with gr.Blocks(css=css) as demo:
|
|
190 |
run_btn.click(merge_and_run, inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale], outputs=[output_image, post_gen_info, last_used_seed])
|
191 |
prompt.submit(merge_and_run, inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale], outputs=[output_image, post_gen_info, last_used_seed])
|
192 |
|
193 |
-
thumbs_up.click(save_preferences, inputs=[lora_1_id, lora_1_scale, lora_2_id, lora_2_scale, prompt, output_image, gr.State("up"), seed], outputs=[post_eval, thumbs_up, thumbs_down])
|
194 |
-
thumbs_down.click(save_preferences, inputs=[lora_1_id, lora_1_scale, lora_2_id, lora_2_scale, prompt, output_image, gr.State("down"), seed], outputs=[post_eval, thumbs_down, thumbs_up])
|
195 |
share_button.click(None, [], [], _js=share_js)
|
196 |
demo.queue()
|
197 |
demo.launch()
|
|
|
133 |
json.dump({"prompt": prompt, "file_name":image_path.name, "lora_1_id": lora_2_id, "lora_1_scale": lora_1_scale, "lora_2_id": lora_2_id, "lora_2_scale": lora_2_scale, "thumbs_direction": thumbs_direction, "seed": seed}, f)
|
134 |
f.write("\n")
|
135 |
|
136 |
+
return gr.update(visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(interactive=False)
|
137 |
|
138 |
with gr.Blocks(css=css) as demo:
|
139 |
shuffled_items = gr.State()
|
|
|
167 |
with gr.Row(visible=False, elem_id="post_gen_info") as post_gen_info:
|
168 |
with gr.Column(min_width=10):
|
169 |
thumbs_up = gr.Button("👍", elem_id="thumbs_up_unclicked")
|
170 |
+
thumbs_up_clicked = gr.Button("👍", elem_id="thumbs_up_clicked", interactive=False, visible=False)
|
171 |
with gr.Column(min_width=10):
|
172 |
thumbs_down = gr.Button("👎", elem_id="thumbs_down_unclicked")
|
173 |
+
thumbs_down_clicked = gr.Button("👎", elem_id="thumbs_down_clicked", interactive=False, visible=False)
|
174 |
with gr.Column(min_width=10):
|
175 |
with gr.Group(elem_id="share-btn-container") as share_group:
|
176 |
community_icon = gr.HTML(community_icon_html)
|
|
|
192 |
run_btn.click(merge_and_run, inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale], outputs=[output_image, post_gen_info, last_used_seed])
|
193 |
prompt.submit(merge_and_run, inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale], outputs=[output_image, post_gen_info, last_used_seed])
|
194 |
|
195 |
+
thumbs_up.click(save_preferences, inputs=[lora_1_id, lora_1_scale, lora_2_id, lora_2_scale, prompt, output_image, gr.State("up"), seed], outputs=[post_eval, thumbs_up, thumbs_up_clicked, thumbs_down])
|
196 |
+
thumbs_down.click(save_preferences, inputs=[lora_1_id, lora_1_scale, lora_2_id, lora_2_scale, prompt, output_image, gr.State("down"), seed], outputs=[post_eval, thumbs_down, thumbs_down_clicked, thumbs_up])
|
197 |
share_button.click(None, [], [], _js=share_js)
|
198 |
demo.queue()
|
199 |
demo.launch()
|