diff --git a/liveportrait/live_portrait_pipeline.py b/liveportrait/live_portrait_pipeline.py index 71885c8..60b4db3 100644 --- a/liveportrait/live_portrait_pipeline.py +++ b/liveportrait/live_portrait_pipeline.py @@ -20,7 +20,7 @@ from .utils.crop import _transform_img # from .utils.retargeting_utils import calc_lip_close_ratio # from .utils.io import load_image_rgb, load_driving_info # from .utils.helper import mkdir, basename, dct2cuda, is_video, is_template, resize_to_limit -from .utils.helper import resize_to_limit +# from .utils.helper import resize_to_limit # from .utils.rprint import rlog as log from .live_portrait_wrapper import LivePortraitWrapper @@ -81,14 +81,11 @@ class LivePortraitPipeline(object): pbar = comfy.utils.ProgressBar(total_frames) for i in range(total_frames): - source_frame = self._get_source_frame( + source_frame_rgb = self._get_source_frame( source_np, i, total_frames, mismatch_method ) driving_frame = driving_images_np[i] - source_frame_rgb = resize_to_limit( - source_frame, inference_cfg.ref_max_shape, inference_cfg.ref_shape_n - ) crop_info = self.cropper.crop_single_image(source_frame_rgb) source_lmk = crop_info["lmk_crop"] img_crop, img_crop_256x256 = ( diff --git a/nodes.py b/nodes.py index aa56394..794c98b 100644 --- a/nodes.py +++ b/nodes.py @@ -315,7 +315,7 @@ class LivePortraitProcess: lip_retargeting_multiplier: float, mismatch_method: str = "repeat", ): - source_image_np = (source_image * 255).byte().numpy() + source_np = (source_image * 255).byte().numpy() driving_images_np = (driving_images * 255).byte().numpy() crop_cfg = CropConfig( @@ -342,8 +342,6 @@ class LivePortraitProcess: cropped_out_list = [] full_out_list = [] - source_np = (source_image * 255).byte().numpy() - cropped_out_list, full_out_list = pipeline.execute( source_np, driving_images_np, mismatch_method )