| 652 | crop_factor_max = 2.5 |
| 653 | |
| 654 | class AdvancedLivePortrait: |
| 655 | def __init__(self): |
| 656 | self.src_images = None |
| 657 | self.driving_images = None |
| 658 | self.pbar = comfy.utils.ProgressBar(1) |
| 659 | self.crop_factor = None |
| 660 | |
| 661 | @classmethod |
| 662 | def INPUT_TYPES(s): |
| 663 | |
| 664 | return { |
| 665 | "required": { |
| 666 | "retargeting_eyes": ("FLOAT", {"default": 0, "min": 0, "max": 1, "step": 0.01}), |
| 667 | "retargeting_mouth": ("FLOAT", {"default": 0, "min": 0, "max": 1, "step": 0.01}), |
| 668 | "crop_factor": ("FLOAT", {"default": crop_factor_default, |
| 669 | "min": crop_factor_min, "max": crop_factor_max, "step": 0.1}), |
| 670 | "turn_on": ("BOOLEAN", {"default": True}), |
| 671 | "tracking_src_vid": ("BOOLEAN", {"default": False}), |
| 672 | "animate_without_vid": ("BOOLEAN", {"default": False}), |
| 673 | "command": ("STRING", {"multiline": True, "default": ""}), |
| 674 | }, |
| 675 | "optional": { |
| 676 | "src_images": ("IMAGE",), |
| 677 | "motion_link": ("EDITOR_LINK",), |
| 678 | "driving_images": ("IMAGE",), |
| 679 | }, |
| 680 | } |
| 681 | |
| 682 | RETURN_TYPES = ("IMAGE",) |
| 683 | RETURN_NAMES = ("images",) |
| 684 | FUNCTION = "run" |
| 685 | OUTPUT_NODE = True |
| 686 | CATEGORY = "AdvancedLivePortrait" |
| 687 | |
| 688 | # INPUT_IS_LIST = False |
| 689 | # OUTPUT_IS_LIST = (False,) |
| 690 | |
| 691 | def parsing_command(self, command, motoin_link): |
| 692 | command.replace(' ', '') |
| 693 | # if command == '': return |
| 694 | lines = command.split('\n') |
| 695 | |
| 696 | cmd_list = [] |
| 697 | |
| 698 | total_length = 0 |
| 699 | |
| 700 | i = 0 |
| 701 | #old_es = None |
| 702 | for line in lines: |
| 703 | i += 1 |
| 704 | if line == '': continue |
| 705 | try: |
| 706 | cmds = line.split('=') |
| 707 | idx = int(cmds[0]) |
| 708 | if idx == 0: es = ExpressionSet() |
| 709 | else: es = ExpressionSet(es = motoin_link[idx]) |
| 710 | cmds = cmds[1].split(':') |
| 711 | change = int(cmds[0]) |
nothing calls this directly
no outgoing calls
no test coverage detected