orpatashnik commited on
Commit
38274da
·
1 Parent(s): c3b82c2

update to safetensors

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. requirements.txt +2 -1
app.py CHANGED
@@ -14,7 +14,7 @@ from utils import align_face
14
  base_model_path = "stabilityai/stable-diffusion-xl-base-1.0"
15
  image_encoder_path = snapshot_download("orpatashnik/NestedAttentionEncoder", allow_patterns=["image_encoder/**"])
16
  image_encoder_path = os.path.join(image_encoder_path, "image_encoder")
17
- personalization_ckpt = hf_hub_download("orpatashnik/NestedAttentionEncoder", "personalization_encoder/pytorch_model.bin")
18
  device = "cuda"
19
 
20
  # Special token settings
@@ -46,6 +46,7 @@ guidance_scale = 5.0
46
  # ----------------------
47
  # Inference function with alignment
48
  # ----------------------
 
49
  def generate_images(img1, img2, img3, prompt, w, num_samples, seed):
50
  # Collect non-empty reference images
51
  refs = [img for img in (img1, img2, img3) if img is not None]
 
14
  base_model_path = "stabilityai/stable-diffusion-xl-base-1.0"
15
  image_encoder_path = snapshot_download("orpatashnik/NestedAttentionEncoder", allow_patterns=["image_encoder/**"])
16
  image_encoder_path = os.path.join(image_encoder_path, "image_encoder")
17
+ personalization_ckpt = hf_hub_download("orpatashnik/NestedAttentionEncoder", "personalization_encoder/pytorch_model.safetensors")
18
  device = "cuda"
19
 
20
  # Special token settings
 
46
  # ----------------------
47
  # Inference function with alignment
48
  # ----------------------
49
+ @spaces.GPU
50
  def generate_images(img1, img2, img3, prompt, w, num_samples, seed):
51
  # Collect non-empty reference images
52
  refs = [img for img in (img1, img2, img3) if img is not None]
requirements.txt CHANGED
@@ -8,4 +8,5 @@ einops
8
  scipy
9
  accelerate
10
  insightface
11
- onnxruntime
 
 
8
  scipy
9
  accelerate
10
  insightface
11
+ onnxruntime
12
+ safetensors