
ddvinh1/tool-faceswap-video
Run ddvinh1/tool-faceswap-video 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 |
---|---|---|---|
source_image |
string
|
Source image (person whose face will be swapped)
|
|
target_video |
string
|
Target video (video where faces will be replaced)
|
|
mode |
None
|
single
|
Swap mode: 'single' for one face, 'multi' for all detected faces
|
cropped_size |
integer
|
224
Min: 224 Max: 1024 |
Crop size for face detection
|
is_use_mask |
boolean
|
False
|
Use face parsing mask for better results (slower)
|
det_thresh |
number
|
0.6
Min: 0.1 Max: 1 |
Face detection threshold
|
processing_mode |
None
|
multi_worker
|
Processing mode for faster execution
|
num_workers |
integer
|
4
Min: 1 Max: 8 |
Number of worker threads (for multi_worker mode)
|
batch_size |
integer
|
4
Min: 1 Max: 16 |
Batch size for processing
|
{
"type": "object",
"title": "Input",
"required": [
"source_image",
"target_video"
],
"properties": {
"mode": {
"enum": [
"single",
"multi"
],
"type": "string",
"title": "mode",
"description": "Swap mode: 'single' for one face, 'multi' for all detected faces",
"default": "single",
"x-order": 2
},
"batch_size": {
"type": "integer",
"title": "Batch Size",
"default": 4,
"maximum": 16,
"minimum": 1,
"x-order": 8,
"description": "Batch size for processing"
},
"det_thresh": {
"type": "number",
"title": "Det Thresh",
"default": 0.6,
"maximum": 1,
"minimum": 0.1,
"x-order": 5,
"description": "Face detection threshold"
},
"is_use_mask": {
"type": "boolean",
"title": "Is Use Mask",
"default": false,
"x-order": 4,
"description": "Use face parsing mask for better results (slower)"
},
"num_workers": {
"type": "integer",
"title": "Num Workers",
"default": 4,
"maximum": 8,
"minimum": 1,
"x-order": 7,
"description": "Number of worker threads (for multi_worker mode)"
},
"cropped_size": {
"type": "integer",
"title": "Cropped Size",
"default": 224,
"maximum": 1024,
"minimum": 224,
"x-order": 3,
"description": "Crop size for face detection"
},
"source_image": {
"type": "string",
"title": "Source Image",
"format": "uri",
"x-order": 0,
"description": "Source image (person whose face will be swapped)"
},
"target_video": {
"type": "string",
"title": "Target Video",
"format": "uri",
"x-order": 1,
"description": "Target video (video where faces will be replaced)"
},
"processing_mode": {
"enum": [
"standard",
"multi_worker",
"gpu_batch"
],
"type": "string",
"title": "processing_mode",
"description": "Processing mode for faster execution",
"default": "multi_worker",
"x-order": 6
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "string",
"title": "Output",
"format": "uri"
}