weifeng-chen commited on
Commit
078bead
1 Parent(s): a144ec6

add english and cuda

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +5 -5
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: Taiyi Stable Diffusion Chinese
3
- emoji: 🔥
4
  colorFrom: red
5
  colorTo: red
6
  sdk: gradio
 
1
  ---
2
  title: Taiyi Stable Diffusion Chinese
3
+ emoji: 🤯
4
  colorFrom: red
5
  colorTo: red
6
  sdk: gradio
app.py CHANGED
@@ -3,7 +3,7 @@ from diffusers import StableDiffusionPipeline
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)
@@ -26,8 +26,8 @@ gr.Interface(fn=infer, inputs=
26
  [
27
  # gr.Image(source="upload", type="filepath", label="原始图像"),
28
  gr.Textbox(label = '提示词(prompt)'),
29
- gr.Slider(2, 15, value = 7, label = '文本引导强度'),
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()
 
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)
 
26
  [
27
  # gr.Image(source="upload", type="filepath", label="原始图像"),
28
  gr.Textbox(label = '提示词(prompt)'),
29
+ gr.Slider(2, 15, value = 7, label = '文本引导强度(guidance scale)'),
30
+ gr.Slider(10, 30, value = 20, step = 1, label = '迭代次数(inference steps)'),
31
+ gr.Slider(256, 768, value = 512, step = 64, label = '宽度(width)'),
32
+ gr.Slider(256, 768, value = 512, step = 64, label = '高度(height)'),
33
  ],outputs='image').queue(concurrency_count=10).launch()