Spaces:
Runtime error
Runtime error
Commit
·
b43fcf5
1
Parent(s):
21db931
Update app.py
Browse files
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
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|