enhance-replicate/faceswap_new
Public
38
runs
Run enhance-replicate/faceswap_new with an API
Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.
Input schema
The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.
| Field | Type | Default value | Description |
|---|---|---|---|
| mode |
None
|
all
|
Swap mode
|
| tracking_mode |
None
|
simple
|
Face tracking mode for specific mode
|
| resolution |
None
|
480
|
Target resolution for output video
|
| seed |
integer
|
42
|
Seed for the random number generator
|
| boxes |
string
|
|
Specific face boxes for first frame: x,y,w,h;...
|
| enhance |
boolean
|
False
|
Whether to enhance the swapped faces using GFPGAN
|
| target_fps |
number
|
12
Min: 1 Max: 60 |
Target FPS for output video (None to keep original FPS)
|
| num_threads |
integer
|
8
Min: 1 Max: 16 |
Number of threads for processing
|
| source_image |
string
|
Source image containing the face to swap (file path)
|
|
| target_video |
string
|
Target video where faces will be swapped (file path)
|
|
| target_face_ids |
string
|
|
Comma-separated face IDs to swap in specific mode (left-to-right order, new faces get incremental IDs)
|
| source_image_base64 |
string
|
Source image as base64 string (alternative to source_image)
|
|
| target_video_base64 |
string
|
Target video as base64 string (alternative to target_video)
|
{
"type": "object",
"title": "Input",
"properties": {
"mode": {
"enum": [
"single",
"all",
"specific"
],
"type": "string",
"title": "mode",
"description": "Swap mode",
"default": "all",
"x-order": 7
},
"seed": {
"type": "integer",
"title": "Seed",
"default": 42,
"description": "Seed for the random number generator"
},
"boxes": {
"type": "string",
"title": "Boxes",
"default": "",
"description": "Specific face boxes for first frame: x,y,w,h;..."
},
"enhance": {
"type": "boolean",
"title": "Enhance",
"default": false,
"description": "Whether to enhance the swapped faces using GFPGAN"
},
"resolution": {
"enum": [
720,
480,
360
],
"type": "integer",
"title": "resolution",
"description": "Target resolution for output video",
"default": 480,
"x-order": 12
},
"target_fps": {
"type": "number",
"title": "Target Fps",
"default": 12,
"maximum": 60,
"minimum": 1,
"description": "Target FPS for output video (None to keep original FPS)"
},
"num_threads": {
"type": "integer",
"title": "Num Threads",
"default": 8,
"maximum": 16,
"minimum": 1,
"description": "Number of threads for processing"
},
"source_image": {
"type": "string",
"title": "Source Image",
"format": "uri",
"nullable": true,
"description": "Source image containing the face to swap (file path)"
},
"target_video": {
"type": "string",
"title": "Target Video",
"format": "uri",
"nullable": true,
"description": "Target video where faces will be swapped (file path)"
},
"tracking_mode": {
"enum": [
"simple",
"advanced"
],
"type": "string",
"title": "tracking_mode",
"description": "Face tracking mode for specific mode",
"default": "simple",
"x-order": 8
},
"target_face_ids": {
"type": "string",
"title": "Target Face Ids",
"default": "",
"description": "Comma-separated face IDs to swap in specific mode (left-to-right order, new faces get incremental IDs)"
},
"source_image_base64": {
"type": "string",
"title": "Source Image Base64",
"nullable": true,
"description": "Source image as base64 string (alternative to source_image)"
},
"target_video_base64": {
"type": "string",
"title": "Target Video Base64",
"nullable": true,
"description": "Target video as base64 string (alternative to target_video)"
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
Schema
{
"type": "string",
"title": "Output",
"format": "uri"
}