Video Faceswap Pro

Action ID: video_faceswap_pro

Description

Advanced face swapping for videos with support for multiple faces and highest quality output

Connection

Name
Description
Required
Category

PixelML Connection

The PixelML connection to call PixelML API.

True

pixelml

Input Parameters

Name
Type
Required
Default
Description

source_image_urls

array

-

Array of source image URLs containing faces to swap into the video

video_input_url

string

-

URL of the input video where faces will be swapped

face_detect_info

object

-

Face detection information containing crop_arr, crop_landmarks, and face_index data for precise face mapping

View JSON Schema

Input Schema

{
  "description": "Video faceswap pro node input.",
  "properties": {
    "source_image_urls": {
      "description": "Source image URLs",
      "items": {
        "type": "string"
      },
      "title": "Source image URLs",
      "type": "array"
    },
    "video_input_url": {
      "description": "Video input URL",
      "title": "Video input URL",
      "type": "string"
    },
    "face_detect_info": {
      "additionalProperties": true,
      "description": "Face detection information containing crop_arr, crop_landmarks, and face_index data",
      "title": "Face detect info",
      "type": "object"
    }
  },
  "required": [
    "source_image_urls",
    "video_input_url",
    "face_detect_info"
  ],
  "title": "VideoFaceswapProNodeInput",
  "type": "object"
}

Output Parameters

Name
Type
Description

video_url

string

URL of the processed video with swapped faces

View JSON Schema

Output Schema

{
  "description": "Video faceswap pro node output.",
  "properties": {
    "video_url": {
      "description": "Video URL",
      "title": "Video URL",
      "type": "string"
    }
  },
  "required": [
    "video_url"
  ],
  "title": "VideoFaceswapProNodeOutput",
  "type": "object"
}

How It Works

This advanced node uses state-of-the-art AI face swapping technology to replace faces in videos with the highest quality output. It requires face detection information (crop_arr, crop_landmarks, face_index) to precisely map and swap faces. The node supports multiple face swapping in a single video, maintaining natural lighting, expressions, and movements while ensuring the swapped faces blend seamlessly with the original video.

Usage Examples

Example 1: Single Face Swap

Input:

source_image_urls: ["https://example.com/person-a.jpg"]
video_input_url: "https://example.com/original-video.mp4"
face_detect_info: {
  "crop_arr": [[100, 200, 300, 400]],
  "crop_landmarks": [[[150, 220], [250, 220], [200, 280], [150, 330], [250, 330]]],
  "face_index": [0]
}

Output:

video_url: "https://storage.pixelml.com/swapped-video.mp4"

Example 2: Multiple Face Swap

Input:

source_image_urls: [
  "https://example.com/person-a.jpg",
  "https://example.com/person-b.jpg"
]
video_input_url: "https://example.com/group-video.mp4"
face_detect_info: {
  "crop_arr": [[100, 200, 300, 400], [500, 200, 700, 400]],
  "crop_landmarks": [
    [[150, 220], [250, 220], [200, 280], [150, 330], [250, 330]],
    [[550, 220], [650, 220], [600, 280], [550, 330], [650, 330]]
  ],
  "face_index": [0, 1]
}

Output:

video_url: "https://storage.pixelml.com/multi-swap-video.mp4"

Example 3: High-Quality Production

Input:

source_image_urls: ["https://example.com/actor-headshot.jpg"]
video_input_url: "https://example.com/scene-footage.mp4"
face_detect_info: {
  "crop_arr": [[150, 180, 450, 520]],
  "crop_landmarks": [[[200, 250], [400, 250], [300, 350], [200, 430], [400, 430]]],
  "face_index": [0]
}

Output:

video_url: "https://storage.pixelml.com/production-video.mp4"

Common Use Cases

  • Content Creation: Create videos featuring different people without reshooting

  • Film Production: Replace actors in scenes for visual effects or reshoots

  • Marketing Videos: Personalize video content by swapping faces for different audiences

  • Educational Content: Create training videos with different instructors without multiple recordings

  • Entertainment: Create fun face swap videos for social media or personal use

  • Video Dubbing: Combine with lip sync for complete character replacement in localized content

  • Privacy Protection: Replace faces in videos while maintaining video quality and natural appearance

Error Handling

Error Type
Cause
Solution

Invalid Face Detection Data

face_detect_info is malformed or incomplete

Ensure face_detect_info contains valid crop_arr, crop_landmarks, and face_index data

Face Count Mismatch

Number of source images doesn't match detected faces

Provide the same number of source images as faces to swap

No Faces Detected

Video doesn't contain detectable faces

Use videos with clearly visible faces

Invalid Video Format

Video format is not supported

Use common video formats like MP4, MOV, or AVI

Image Quality Too Low

Source images are too low resolution

Use high-quality source images for best results

Video Too Long

Video exceeds maximum duration limit

Split video into shorter segments

Connection Failed

Unable to access PixelML API

Check PixelML connection credentials and API availability

Notes

  • Face Detection Required: This node requires face detection information. Use a face detection node first to generate the required face_detect_info data.

  • Image Quality: Use high-resolution source images for best face swap quality. Clear, well-lit photos work best.

  • Video Quality: The output quality depends on both the source images and input video quality.

  • Multiple Faces: The Pro version supports swapping multiple faces simultaneously in a single video.

  • Processing Time: Processing time varies based on video length and number of faces. Expect 1-5 minutes for typical videos.

  • Natural Results: The node maintains facial expressions, head movements, and lighting conditions for realistic results.

Last updated

Was this helpful?