performance

#4
by multimodalart HF staff - opened
Files changed (2) hide show
  1. app.py +2 -3
  2. requirements.txt +2 -1
app.py CHANGED
@@ -6,12 +6,11 @@ from diffusers import StableDiffusionPipeline
6
  model_id = "hakurei/waifu-diffusion"
7
  pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision='fp16')
8
  pipe = pipe.to("cuda")
 
9
  num_samples = 2
10
 
11
  def infer(prompt):
12
- with autocast("cuda"):
13
- images = pipe([prompt] * num_samples, guidance_scale=7.5)["sample"]
14
-
15
  return images
16
 
17
  css = """
 
6
  model_id = "hakurei/waifu-diffusion"
7
  pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision='fp16')
8
  pipe = pipe.to("cuda")
9
+ torch.backends.cudnn.benchmark = True
10
  num_samples = 2
11
 
12
  def infer(prompt):
13
+ images = pipe([prompt] * num_samples, guidance_scale=7.5)["sample"]
 
 
14
  return images
15
 
16
  css = """
requirements.txt CHANGED
@@ -1,5 +1,6 @@
1
  --extra-index-url https://download.pytorch.org/whl/cu113
2
  torch
3
- diffusers
 
4
  transformers
5
  ftfy
 
1
  --extra-index-url https://download.pytorch.org/whl/cu113
2
  torch
3
+ -e git+https://github.com/Narsil/diffusers.git@5ad7ed8d3eb2216b8f8c45d3d1fca929882441be#egg=diffusers
4
+ nvidia-ml-py3
5
  transformers
6
  ftfy