Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ def prepare_src_image(self, img):
def GetMaskImg(self):
if self.mask_img is None:
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "./LivePortrait/utils/resources/mask_template.png")
self.mask_img = cv2.imread(path, cv2.IMREAD_COLOR)
try:
pil_img = Image.open(path).convert("RGB")
self.mask_img = np.array(pil_img)
except Exception as e:
print(f"[ERROR] Cannot open MASK image with Pillow: {e}")
return self.mask_img

def crop_face(self, img_rgb, crop_factor):
Expand Down Expand Up @@ -977,4 +981,4 @@ def run(self, rotate_pitch, rotate_yaw, rotate_roll, blink, eyebrow, wink, pupil
"ExpressionEditor": "Expression Editor (PHM)",
"LoadExpData": "Load Exp Data (PHM)",
"SaveExpData": "Save Exp Data (PHM)"
}
}