MrDrmm commited on
Commit
77d5047
·
verified ·
1 Parent(s): afdff65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -23,6 +23,18 @@ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", fill_width=True, css=css) as demo:
23
  prompt = gr.Text(label="Prompt", lines=2, max_lines=8, placeholder="1girl, solo, ...", show_copy_button=True)
24
  with gr.Accordion("Advanced options", open=False):
25
  neg_prompt = gr.Text(label="Negative Prompt", lines=1, max_lines=8, placeholder="")
 
 
 
 
 
 
 
 
 
 
 
 
26
  with gr.Row():
27
  width = gr.Slider(label="Width", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
28
  height = gr.Slider(label="Height", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
@@ -119,9 +131,9 @@ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", fill_width=True, css=css) as demo:
119
  fn=lambda i, n, m, t1, t2, n1, n2, n3, n4, n5, l1, l2, l3, l4: infer_rand_fn(m, t1, t2, n1, n2, n3, n4, n5, l1, l2, l3, l4) if (i < n) else None,
120
  inputs=[img_i, image_num, model_name, prompt, neg_prompt, height, width, steps, cfg, seed,
121
  positive_prefix, positive_suffix, negative_prefix, negative_suffix],
122
- outputs=[o], queue=True, show_api=True) # Be sure to delete ", queue=False" when activating the stop button
123
  o.change(save_gallery, [o, results], [results, image_files], show_api=False)
124
- #stop_button.click(lambda: gr.update(interactive=False), None, stop_button, cancels=[gen_event, gen_event2], show_api=False)
125
 
126
  clear_prompt.click(lambda: (None, None), None, [prompt, neg_prompt], queue=True, show_api=True)
127
  clear_results.click(lambda: (None, None), None, [results, image_files], queue=True, show_api=True)
 
23
  prompt = gr.Text(label="Prompt", lines=2, max_lines=8, placeholder="1girl, solo, ...", show_copy_button=True)
24
  with gr.Accordion("Advanced options", open=False):
25
  neg_prompt = gr.Text(label="Negative Prompt", lines=1, max_lines=8, placeholder="")
26
+ models = 'votepurchase/NSFW-gen-v2': {
27
+ "model_type": [
28
+ "SDXL"
29
+ ],
30
+ "tags": [
31
+ "UnfilteredAI",
32
+ "3d",
33
+ "not-for-all-audiences"
34
+ ],
35
+ "prompt": "highly detailed, masterpiece, best quality, very aesthetic, absurdres",
36
+ "negative_prompt": "lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract], drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly"
37
+ }
38
  with gr.Row():
39
  width = gr.Slider(label="Width", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
40
  height = gr.Slider(label="Height", info="If 0, the default value is used.", maximum=1216, step=32, value=0)
 
131
  fn=lambda i, n, m, t1, t2, n1, n2, n3, n4, n5, l1, l2, l3, l4: infer_rand_fn(m, t1, t2, n1, n2, n3, n4, n5, l1, l2, l3, l4) if (i < n) else None,
132
  inputs=[img_i, image_num, model_name, prompt, neg_prompt, height, width, steps, cfg, seed,
133
  positive_prefix, positive_suffix, negative_prefix, negative_suffix],
134
+ outputs=[o], queue=True, show_api=False) # Be sure to delete ", queue=False" when activating the stop button
135
  o.change(save_gallery, [o, results], [results, image_files], show_api=False)
136
+ stop_button.click(lambda: gr.update(interactive=False), None, stop_button, cancels=[gen_event, gen_event2], show_api=False)
137
 
138
  clear_prompt.click(lambda: (None, None), None, [prompt, neg_prompt], queue=True, show_api=True)
139
  clear_results.click(lambda: (None, None), None, [results, image_files], queue=True, show_api=True)