AkiKagura commited on
Commit
6b0847f
1 Parent(s): 21bcc9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -10,6 +10,8 @@ MY_SECRET_TOKEN=os.environ.get('HF_TOKEN_SD')
10
  from diffusers import StableDiffusionPipeline
11
  #from diffusers import StableDiffusionImg2ImgPipeline
12
 
 
 
13
  print("start generating")
14
 
15
  YOUR_TOKEN=MY_SECRET_TOKEN
@@ -17,6 +19,7 @@ YOUR_TOKEN=MY_SECRET_TOKEN
17
  device="cpu"
18
 
19
  pipe = StableDiffusionPipeline.from_pretrained("AkiKagura/mkgen-diffusion", use_auth_token=YOUR_TOKEN)
 
20
  pipe.to(device)
21
 
22
  gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
@@ -38,6 +41,6 @@ def infer(prompt):
38
  print("okay")
39
 
40
  title="Marco Generation"
41
- description="Use 'mkmk woman' to get Marco pics. <br />Warning: Slow process... ~5/10 min inference time. <b>NSFW filter enabled.</b>"
42
 
43
  gr.Interface(fn=infer, inputs="text", outputs=gallery,title=title,description=description).queue(max_size=10).launch(enable_queue=True)
 
10
  from diffusers import StableDiffusionPipeline
11
  #from diffusers import StableDiffusionImg2ImgPipeline
12
 
13
+ def empty_checker(images, **kwargs):return images, False
14
+
15
  print("start generating")
16
 
17
  YOUR_TOKEN=MY_SECRET_TOKEN
 
19
  device="cpu"
20
 
21
  pipe = StableDiffusionPipeline.from_pretrained("AkiKagura/mkgen-diffusion", use_auth_token=YOUR_TOKEN)
22
+ pipe.safety_checker = empty_checker
23
  pipe.to(device)
24
 
25
  gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
 
41
  print("okay")
42
 
43
  title="Marco Generation"
44
+ description="Use 'mkmk woman' to get Marco pics. <br />Warning: Slow process... ~5/10 min inference time."
45
 
46
  gr.Interface(fn=infer, inputs="text", outputs=gallery,title=title,description=description).queue(max_size=10).launch(enable_queue=True)