face2facetestkr
Available Endpoints
Swap faces between two images. Args: source_img: Source image containing the face(s) to swap from target_img: Target image containing the face(s) to swap to enhance_face_model: Face enhancement model to use. Defaults to 'gpen_bfr_512' Returns: ImageFile: The resulting image with swapped faces
Add one or multiple reference face(s) to the face swapper. Args: face_name: Name(s) for the reference face(s). - If a single string, creates one face embedding - If a list of strings, creates embeddings for each face from left to right in the image image: The image from which to extract the face(s). - ImageFile: Standard image file save: Whether to save the face embeddings to disk. Note: This is controlled by ALLOW_EMBEDDING_SAVE_ON_SERVER setting Returns: Union[MediaFile, MediaDict]: - For single face: MediaFile containing the face embedding - For multiple faces: MediaDict mapping face names to their embeddings Raises: ValueError: If no face name is provided or no faces are detected in the image
Swap faces in an image or video. Args: faces: The face(s) to swap to. Can be: - str: Name of a reference face - dict: Swap pairs with structure {source_face_name: target_face_name} - list: List of face names or Face embeddings - ImageFile: Use face detection to create a face embedding from the image. - MediaFile: Single face embedding file - MediaList: Multiple face embeddings media: The image(s) or video(s) to swap faces in enhance_face_model: Face enhancement model to use. Defaults to 'gpen_bfr_512' Returns: Union[ImageFile, VideoFile]: The resulting media with swapped faces Raises: ValueError: If no faces are provided or media type is unsupported
Swap faces in a video file. Args: face_name: The face(s) to swap to. Can be: - str: Name of a reference face - list: List of face names or Face objects - MediaFile: Single face embedding file - MediaList: Multiple face embedding files target_video: The video to swap faces in include_audio: Whether to include audio in the output video enhance_face_model: Face enhancement model to use. Defaults to 'gpen_bfr_512' Returns: VideoFile: The resulting video with swapped faces Raises: ValueError: If no faces are provided or video cannot be processed
Enhance a face image.
Similar Services
Related models you might also like