lvkaokao commited on
Commit
121192a
1 Parent(s): c8b475a

update app

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -6,6 +6,7 @@ import random
6
  import torch
7
  import subprocess
8
  from diffusers import StableDiffusionPipeline
 
9
 
10
  model_id = "dicoo_model"
11
 
@@ -14,7 +15,9 @@ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float
14
  def predict(prompt, steps=30, seed=42, guidance_scale=7.5):
15
  print("prompt: ", prompt)
16
  print("steps: ", steps)
 
17
  image = pipe(prompt, num_inference_steps=steps, guidance_scale=7.5).images[0]
 
18
  return image
19
 
20
  md = """
 
6
  import torch
7
  import subprocess
8
  from diffusers import StableDiffusionPipeline
9
+ import time
10
 
11
  model_id = "dicoo_model"
12
 
 
15
  def predict(prompt, steps=30, seed=42, guidance_scale=7.5):
16
  print("prompt: ", prompt)
17
  print("steps: ", steps)
18
+ start_time = time.time()
19
  image = pipe(prompt, num_inference_steps=steps, guidance_scale=7.5).images[0]
20
+ print("cost: ", time.time() - start_time)
21
  return image
22
 
23
  md = """