MCPcopy
hub / github.com/cubiq/ComfyUI_InstantID / preprocess_image

Method preprocess_image

InstantID.py:235–243  ·  view source on GitHub ↗
(self, faceanalysis, image)

Source from the content-addressed store, hash-verified

233 CATEGORY = "InstantID"
234
235 def preprocess_image(self, faceanalysis, image):
236 face_kps = extractFeatures(faceanalysis, image, extract_kps=True)
237
238 if face_kps is None:
239 face_kps = torch.zeros_like(image)
240 print(f"\033[33mWARNING: no face detected, unable to extract the keypoints!\033[0m")
241 #raise Exception('Face Keypoints Image: No face detected.')
242
243 return (face_kps,)
244
245def add_noise(image, factor):
246 seed = int(torch.sum(image).item()) % 1000000007

Callers

nothing calls this directly

Calls 1

extractFeaturesFunction · 0.85

Tested by

no test coverage detected