# 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 |

<details>

<summary>View JSON Schema</summary>

**Input Schema**

```json
{
  "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"
}
```

</details>

## Output Parameters

| Name       | Type   | Description                                   |
| ---------- | ------ | --------------------------------------------- |
| video\_url | string | URL of the processed video with swapped faces |

<details>

<summary>View JSON Schema</summary>

**Output Schema**

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

</details>

## 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/video_faceswap_pro.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
