Spaces:
Runtime error
Runtime error
Commit
·
302bf59
1
Parent(s):
676b3c0
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
import torch
|
4 |
-
|
|
|
5 |
#remember to login with token before loading model
|
6 |
-
def text_to_hair(prompt, num_inference_steps=200, guidance_scale=9, model_path ="
|
7 |
pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2", torch_dtype=torch.float16)
|
8 |
pipe.unet.load_attn_procs(model_path)
|
9 |
pipe.to("cuda")
|
|
|
1 |
import gradio as gr
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
import torch
|
4 |
+
import huggingface_hub as hf
|
5 |
+
hf.login(token=os.environ['model_token'])
|
6 |
#remember to login with token before loading model
|
7 |
+
def text_to_hair(prompt, num_inference_steps=200, guidance_scale=9, model_path ="CVH-vn1210/hair-model"):
|
8 |
pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2", torch_dtype=torch.float16)
|
9 |
pipe.unet.load_attn_procs(model_path)
|
10 |
pipe.to("cuda")
|