weifeng-chen commited on
Commit
2b8b583
โ€ข
1 Parent(s): da639ee
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -3,7 +3,7 @@ from diffusers import StableDiffusionPipeline
3
  # from PIL import Image
4
 
5
 
6
- device="cuda"
7
  model_id = "IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1"
8
 
9
  # pipe_img2img = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, tokenizer=tokenizer, text_encoder=text_encoder, vae=vae, unet=unet).to(device)
@@ -30,4 +30,4 @@ gr.Interface(fn=infer, inputs=
30
  gr.Slider(10, 30, value = 20, step = 1, label = '่ฟญไปฃๆฌกๆ•ฐ'),
31
  gr.Slider(256, 768, value = 512, step = 64, label = 'ๅฎฝๅบฆ'),
32
  gr.Slider(256, 768, value = 512, step = 64, label = '้ซ˜ๅบฆ'),
33
- ],outputs='image').queue(max_size=10).launch(enable_queue=True)
 
3
  # from PIL import Image
4
 
5
 
6
+ device="cpu"
7
  model_id = "IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1"
8
 
9
  # pipe_img2img = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, tokenizer=tokenizer, text_encoder=text_encoder, vae=vae, unet=unet).to(device)
 
30
  gr.Slider(10, 30, value = 20, step = 1, label = '่ฟญไปฃๆฌกๆ•ฐ'),
31
  gr.Slider(256, 768, value = 512, step = 64, label = 'ๅฎฝๅบฆ'),
32
  gr.Slider(256, 768, value = 512, step = 64, label = '้ซ˜ๅบฆ'),
33
+ ],outputs='image').queue(concurrency_count=10).launch()
requirements.txt CHANGED
@@ -3,3 +3,4 @@ torch
3
  torchvision
4
  git+https://github.com/huggingface/diffusers.git
5
  transformers
 
 
3
  torchvision
4
  git+https://github.com/huggingface/diffusers.git
5
  transformers
6
+ accelerate