MCPcopy Create free account
hub / github.com/PowerHouseMan/ComfyUI-AdvancedLivePortrait / crop_face

Method crop_face

nodes.py:353–358  ·  view source on GitHub ↗
(self, img_rgb, crop_factor)

Source from the content-addressed store, hash-verified

351 return self.mask_img
352
353 def crop_face(self, img_rgb, crop_factor):
354 crop_region = self.detect_face(img_rgb, crop_factor)
355 face_region, is_changed = self.calc_face_region(crop_region, get_rgb_size(img_rgb))
356 face_img = rgb_crop(img_rgb, face_region)
357 if is_changed: face_img = self.expand_img(face_img, crop_region)
358 return face_img
359
360 def prepare_source(self, source_image, crop_factor, is_video = False, tracking = False):
361 print("Prepare source...")

Callers 1

runMethod · 0.80

Calls 5

detect_faceMethod · 0.95
calc_face_regionMethod · 0.95
expand_imgMethod · 0.95
get_rgb_sizeFunction · 0.85
rgb_cropFunction · 0.85

Tested by

no test coverage detected