DetGC commited on
Commit
b4bc419
1 Parent(s): 30405c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -111,8 +111,9 @@ CSS="""
111
 
112
 
113
  with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', fill_width=True, css=CSS) as demo:
114
- gr.HTML()
115
- with gr.Tab('Huggingface Diffusion'):
 
116
  with gr.Column(scale=2):
117
  with gr.Group():
118
  txt_input = gr.Textbox(label='Your prompt:', lines=4)
@@ -132,7 +133,7 @@ with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', fill_width=True, css=CSS) as demo:
132
  random_button = gr.Button(f'Random {int(num_models)} 🎲', variant='secondary', scale=1)
133
  #stop_button = gr.Button('Stop', variant='stop', interactive=False, scale=1)
134
  #gen_button.click(lambda: gr.update(interactive=True), None, stop_button)
135
- gr.Markdown("Scroll down to see more images and select models.", elem_classes="guide")
136
 
137
  with gr.Column(scale=1):
138
  with gr.Group():
@@ -188,17 +189,13 @@ with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', fill_width=True, css=CSS) as demo:
188
  with gr.Row():
189
  output2 = [gr.Image(label='', show_download_button=True, elem_classes="output",
190
  interactive=False, width=112, height=112, visible=True, format="png",
191
- show_share_button=False, show_label=True) for _ in range(max_images)]
192
 
193
- """
194
  with gr.Column(scale=2):
195
  gallery2 = gr.Gallery(label="Output", show_download_button=True, elem_classes="gallery",
196
  interactive=False, show_share_button=True, container=True, format="png",
197
  preview=True, object_fit="cover", columns=2, rows=2)
198
- """
199
 
200
-
201
- """
202
  for i, o in enumerate(output2):
203
  img_i = gr.Number(i, visible=False)
204
  num_images.change(lambda i, n: gr.update(visible = (i < n)), [img_i, num_images], o, queue=False)
@@ -207,10 +204,10 @@ with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', fill_width=True, css=CSS) as demo:
207
  inputs=[img_i, num_images, model_choice2, txt_input2, neg_input2,
208
  height2, width2, steps2, cfg2, seed2], outputs=[o],
209
  concurrency_limit=None, queue=False) # Be sure to delete ", queue=False" when activating the stop button
210
- #o.change(add_gallery, [o, model_choice2, gallery2], [gallery2])
211
  #stop_button2.click(lambda: gr.update(interactive=False), None, stop_button2, cancels=[gen_event2])
212
- """
 
213
 
214
  #demo.queue(default_concurrency_limit=200, max_size=200)
215
  demo.launch(show_api=False, max_threads=400)
216
- # https://github.com/gradio-app/gradio/issues/6339
 
111
 
112
 
113
  with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', fill_width=True, css=CSS) as demo:
114
+ gr.HTML(
115
+ )
116
+ with gr.Tab('Pr0n Diffusion'):
117
  with gr.Column(scale=2):
118
  with gr.Group():
119
  txt_input = gr.Textbox(label='Your prompt:', lines=4)
 
133
  random_button = gr.Button(f'Random {int(num_models)} 🎲', variant='secondary', scale=1)
134
  #stop_button = gr.Button('Stop', variant='stop', interactive=False, scale=1)
135
  #gen_button.click(lambda: gr.update(interactive=True), None, stop_button)
136
+ gr.Markdown("")
137
 
138
  with gr.Column(scale=1):
139
  with gr.Group():
 
189
  with gr.Row():
190
  output2 = [gr.Image(label='', show_download_button=True, elem_classes="output",
191
  interactive=False, width=112, height=112, visible=True, format="png",
192
+ show_share_button=False, show_label=False) for _ in range(max_images)]
193
 
 
194
  with gr.Column(scale=2):
195
  gallery2 = gr.Gallery(label="Output", show_download_button=True, elem_classes="gallery",
196
  interactive=False, show_share_button=True, container=True, format="png",
197
  preview=True, object_fit="cover", columns=2, rows=2)
 
198
 
 
 
199
  for i, o in enumerate(output2):
200
  img_i = gr.Number(i, visible=False)
201
  num_images.change(lambda i, n: gr.update(visible = (i < n)), [img_i, num_images], o, queue=False)
 
204
  inputs=[img_i, num_images, model_choice2, txt_input2, neg_input2,
205
  height2, width2, steps2, cfg2, seed2], outputs=[o],
206
  concurrency_limit=None, queue=False) # Be sure to delete ", queue=False" when activating the stop button
207
+ o.change(add_gallery, [o, model_choice2, gallery2], [gallery2])
208
  #stop_button2.click(lambda: gr.update(interactive=False), None, stop_button2, cancels=[gen_event2])
209
+
210
+ gr.Markdown("")
211
 
212
  #demo.queue(default_concurrency_limit=200, max_size=200)
213
  demo.launch(show_api=False, max_threads=400)