Files
5x00-ComfyUI-PiAPI-Faceswap/swapper.py
T
2025-01-05 02:09:33 +05:30

30 lines
700 B
Python

import numpy as np
from .utils import faceswapper
class tagger_node:
RETURN_TYPES = ("IMAGE",)
RETURN_NAMES = ("Output",)
FUNCTION = "swap_face"
CATEGORY = "5x00/"
@classmethod
def IS_CHANGED(cls, **kwargs):
return float("NaN")
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"Image" : ("IMAGE", {}),
"Face" : ("IMAGE", {}),
"API_Key" : ("STRING", {}),
},
}
def swap_face(Image, Face, API_Key):
swapped_image = faceswapper(Image, Face, API_Key)
return (swapped_image,)
NODE_CLASS_MAPPINGS = {
"Face Swapper" : tagger_node,
}