Spaces:
Runtime error
Runtime error
Commit
·
d97164c
1
Parent(s):
c72bdea
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,12 @@ import huggingface_hub as hf
|
|
5 |
import os
|
6 |
hf.login(token=os.environ['model_token'])
|
7 |
#remember to login with token before loading model
|
8 |
-
def text_to_hair(prompt, num_inference_steps=
|
9 |
|
10 |
pipe = StableDiffusionPipeline.from_pretrained(os.environ['bmd'], torch_dtype=torch.float16)
|
11 |
pipe.unet.load_attn_procs(model_path)
|
12 |
pipe.to("cuda")
|
13 |
-
image = pipe(prompt, num_inference_steps=num_inference_steps, guidance_scale=
|
14 |
#image.save(save_name) #comment if don't want to save image
|
15 |
return image #PIL format
|
16 |
|
|
|
5 |
import os
|
6 |
hf.login(token=os.environ['model_token'])
|
7 |
#remember to login with token before loading model
|
8 |
+
def text_to_hair(prompt, num_inference_steps=200, guidance_scale=6, model_path ="CVH-vn1210/hair-model"):
|
9 |
|
10 |
pipe = StableDiffusionPipeline.from_pretrained(os.environ['bmd'], torch_dtype=torch.float16)
|
11 |
pipe.unet.load_attn_procs(model_path)
|
12 |
pipe.to("cuda")
|
13 |
+
image = pipe(prompt, num_inference_steps=num_inference_steps, guidance_scale=guidance_scale).images[0]
|
14 |
#image.save(save_name) #comment if don't want to save image
|
15 |
return image #PIL format
|
16 |
|