DetGC commited on
Commit
e7ccd4f
·
verified ·
1 Parent(s): d6592c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
app.py CHANGED
@@ -117,7 +117,7 @@ def add_gallery(image, model_str, gallery):
117
  CSS="""
118
  .gradio-container { max-width: 1200px; margin: 0 auto; !important; }
119
  .output { width=112px; height=112px; max_width=112px; max_height=112px; !important; }
120
- .gallery { min_width=512px; min_height=512px; max_height=1024px; !important; }
121
  .guide { text-align: center; !important; }
122
  """
123
 
@@ -220,20 +220,19 @@ with gr.Blocks(theme='JohnSmith9982/small_and_pretty', fill_width=True, css=CSS)
220
  o.change(add_gallery, [o, model_choice2, gallery2], [gallery2])
221
  #stop_button2.click(lambda: gr.update(interactive=False), None, stop_button2, cancels=[gen_event2])
222
 
223
- gr.Markdown("")
224
-
225
- js_func = """
226
- function refresh() {
227
- const url = new URL(window.location);
228
-
229
- if (url.searchParams.get('__theme') !== 'dark') {
230
- url.searchParams.set('__theme', 'dark');
231
- window.location.href = url.href;
232
- }
233
- }
234
- """
235
-
236
- with gr.Blocks(js=js_func) as demo:
237
-
238
- #demo.queue(default_concurrency_limit=200, max_size=200)
239
- demo.launch(show_api=False, max_threads=400)
 
117
  CSS="""
118
  .gradio-container { max-width: 1200px; margin: 0 auto; !important; }
119
  .output { width=112px; height=112px; max_width=112px; max_height=112px; !important; }
120
+ .gallery { min_width=512px; min_height=512px; max_height=800px; !important; }
121
  .guide { text-align: center; !important; }
122
  """
123
 
 
220
  o.change(add_gallery, [o, model_choice2, gallery2], [gallery2])
221
  #stop_button2.click(lambda: gr.update(interactive=False), None, stop_button2, cancels=[gen_event2])
222
 
223
+ makeItDark = """
224
+ function refresh() {
225
+ const url = new URL(window.location);
226
+
227
+ if (url.searchParams.get('__theme') !== 'dark') {
228
+ url.searchParams.set('__theme', 'dark');
229
+ window.location.href = url.href;
230
+ }
231
+ }
232
+ """
233
+
234
+
235
+ gr.Markdown("<script>" + makeItDark + "</script>")
236
+
237
+ #demo.queue(default_concurrency_limit=200, max_size=200)
238
+ demo.launch(show_api=False, max_threads=400)