Liyulingyue commited on
Commit
b43fcf5
1 Parent(s): 21db931

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -10,8 +10,20 @@ repo = git.Repo.clone_from(url='https://huggingface.co/Liyulingyue/Neolle_Face_G
10
  model_path = "dream_outputs"
11
  pipe = StableDiffusionPipeline.from_pretrained(model_path)
12
 
13
- def generate_images(prompt="Neolle", num_inference_steps=50, guidance_scale=7.5):
14
- image = pipe(prompt, num_inference_steps=int(num_inference_steps),guidance_scale=float(guidance_scale)).images[0]
 
 
 
 
 
 
 
 
 
 
 
 
15
  # image = os.getcwd()
16
  return image
17
 
 
10
  model_path = "dream_outputs"
11
  pipe = StableDiffusionPipeline.from_pretrained(model_path)
12
 
13
+ def generate_images(prompt="Neolle", num_inference_steps, guidance_scale):
14
+ # num_inference_steps to number
15
+ try:
16
+ infer_steps = int(num_inference_steps)
17
+ except:
18
+ infer_steps = 50
19
+
20
+ # guidance_scale to number
21
+ try:
22
+ gui_scale = float(guidance_scale)
23
+ except:
24
+ gui_scale = 7.5
25
+
26
+ image = pipe(prompt, num_inference_steps=infer_steps,guidance_scale=gui_scale).images[0]
27
  # image = os.getcwd()
28
  return image
29