Spaces:
Runtime error
Runtime error
gbarbadillo
commited on
Commit
•
3010a51
1
Parent(s):
fa0e676
updated app to use huggingface to download the data
Browse files
app.py
CHANGED
@@ -6,11 +6,11 @@ import cv2
|
|
6 |
from insightface.app import FaceAnalysis
|
7 |
from insightface.utils import face_align
|
8 |
import gradio as gr
|
|
|
9 |
|
10 |
base_model_path = "SG161222/Realistic_Vision_V4.0_noVAE"
|
11 |
vae_model_path = "stabilityai/sd-vae-ft-mse"
|
12 |
-
|
13 |
-
image_encoder_path = "image_encoder"
|
14 |
ip_ckpt = "IP-Adapter-FaceID/ip-adapter-faceid-plus_sd15.bin"
|
15 |
|
16 |
|
@@ -41,6 +41,19 @@ pipe = StableDiffusionPipeline.from_pretrained(
|
|
41 |
safety_checker=None
|
42 |
)
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
ip_model = IPAdapterFaceIDPlus(pipe, image_encoder_path, ip_ckpt, device, num_tokens=4, torch_dtype=torch_dtype)
|
46 |
|
|
|
6 |
from insightface.app import FaceAnalysis
|
7 |
from insightface.utils import face_align
|
8 |
import gradio as gr
|
9 |
+
from huggingface_hub import hf_hub_download
|
10 |
|
11 |
base_model_path = "SG161222/Realistic_Vision_V4.0_noVAE"
|
12 |
vae_model_path = "stabilityai/sd-vae-ft-mse"
|
13 |
+
image_encoder_path = "h94/IP-Adapter/models/image_encoder"
|
|
|
14 |
ip_ckpt = "IP-Adapter-FaceID/ip-adapter-faceid-plus_sd15.bin"
|
15 |
|
16 |
|
|
|
41 |
safety_checker=None
|
42 |
)
|
43 |
|
44 |
+
hf_hub_download(
|
45 |
+
repo_id='h94/IP-Adapter-FaceID',
|
46 |
+
filename='ip-adapter-faceid-plus_sd15.bin',
|
47 |
+
local_dir='IP-Adapter-FaceID')
|
48 |
+
hf_hub_download(
|
49 |
+
repo_id='h94/IP-Adapter',
|
50 |
+
filename='models/image_encoder/config.json',
|
51 |
+
local_dir='IP-Adapter')
|
52 |
+
hf_hub_download(
|
53 |
+
repo_id='h94/IP-Adapter',
|
54 |
+
filename='models/image_encoder/pytorch_model.bin',
|
55 |
+
local_dir='IP-Adapter');
|
56 |
+
|
57 |
|
58 |
ip_model = IPAdapterFaceIDPlus(pipe, image_encoder_path, ip_ckpt, device, num_tokens=4, torch_dtype=torch_dtype)
|
59 |
|