vetkastar
/
face_swap_lab
- Public
- 95 runs
Run vetkastar/face_swap_lab 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 |
---|---|---|---|
image |
string
|
Input image [img2img or postprocessing modes only]
|
|
face_1_source_img |
string
|
reference image
|
|
face_1_blend_faces |
boolean
|
True
|
Will blend faces if True
|
face_1_same_gender |
boolean
|
False
|
Use same gender filtering
|
face_1_sort_by_size |
boolean
|
False
|
Sort Faces by size
|
face_1_check_similarity |
boolean
|
False
|
If True, discard images with low similarity
|
face_1_compute_similarity |
boolean
|
False
|
If True will compute similarity and add it to the image info
|
face_1_min_sim |
number
|
0
Max: 1 |
Minimum similarity against the used face
|
face_1_min_ref_sim |
number
|
0
Max: 1 |
Minimum similarity against the reference
|
face_1_faces_index |
string
|
0
|
The face index to use for swapping, comma separated list of face numbers starting from 0
|
face_1_reference_face_index |
integer
|
0
|
The face index to use to extract face from reference
|
face_1_improved_mask |
boolean
|
False
|
Use Improved Mask
|
face_1_color_corrections |
boolean
|
False
|
Use Color Correction
|
face_1_sharpen |
boolean
|
False
|
Sharpen Image
|
face_1_erosion_factor |
number
|
1
Max: 10 |
Erosion Factor
|
face_2_enable |
boolean
|
False
|
Enable face 2
|
face_2_source_img |
string
|
reference image
|
|
face_2_blend_faces |
boolean
|
True
|
Will blend faces if True
|
face_2_same_gender |
boolean
|
False
|
Use same gender filtering
|
face_2_sort_by_size |
boolean
|
False
|
Sort Faces by size
|
face_2_check_similarity |
boolean
|
False
|
If True, discard images with low similarity
|
face_2_compute_similarity |
boolean
|
False
|
If True will compute similarity and add it to the image info
|
face_2_min_sim |
number
|
0
Max: 1 |
Minimum similarity against the used face
|
face_2_min_ref_sim |
number
|
0
Max: 1 |
Minimum similarity against the reference
|
face_2_faces_index |
string
|
0
|
The face index to use for swapping, comma separated list of face numbers starting from 0
|
face_2_reference_face_index |
integer
|
0
|
The face index to use to extract face from reference
|
face_2_improved_mask |
boolean
|
False
|
Use Improved Mask
|
face_2_color_corrections |
boolean
|
False
|
Use Color Correction
|
face_2_sharpen |
boolean
|
False
|
Sharpen Image
|
face_2_erosion_factor |
number
|
1
Max: 10 |
Erosion Factor
|
face_restorer_name |
string
(enum)
|
CodeFormer
Options: None, CodeFormer, GFPGAN |
face restorer name
|
restorer_visibility |
number
|
1
Max: 1 |
face restorer visibility
|
codeformer_weight |
number
|
1
Max: 1 |
face restorer codeformer weight
|
upscaler_name |
string
(enum)
|
4x-UltraSharp
Options: 4x-AnimeSharp, 4x-UltraSharp, 4x_foolhardy_Remacri, 8x_NMKD-Superscale_150000_G, Без модели |
upscaler name
|
scale |
number
|
1
Max: 10 |
upscaling scale
|
upscaler_visibility |
number
|
1
Max: 1 |
upscaler visibility
|
{
"type": "object",
"title": "Input",
"properties": {
"image": {
"type": "string",
"title": "Image",
"format": "uri",
"x-order": 0,
"description": "Input image [img2img or postprocessing modes only]"
},
"scale": {
"type": "number",
"title": "Scale",
"default": 1,
"maximum": 10,
"minimum": 0,
"x-order": 34,
"description": "upscaling scale"
},
"face_2_enable": {
"type": "boolean",
"title": "Face 2 Enable",
"default": false,
"x-order": 15,
"description": "Enable face 2"
},
"upscaler_name": {
"enum": [
"4x-AnimeSharp",
"4x-UltraSharp",
"4x_foolhardy_Remacri",
"8x_NMKD-Superscale_150000_G",
"\u0411\u0435\u0437 \u043c\u043e\u0434\u0435\u043b\u0438"
],
"type": "string",
"title": "upscaler_name",
"description": "upscaler name",
"default": "4x-UltraSharp",
"x-order": 33
},
"face_1_min_sim": {
"type": "number",
"title": "Face 1 Min Sim",
"default": 0,
"maximum": 1,
"minimum": 0,
"x-order": 7,
"description": "Minimum similarity against the used face"
},
"face_1_sharpen": {
"type": "boolean",
"title": "Face 1 Sharpen",
"default": false,
"x-order": 13,
"description": "Sharpen Image"
},
"face_2_min_sim": {
"type": "number",
"title": "Face 2 Min Sim",
"default": 0,
"maximum": 1,
"minimum": 0,
"x-order": 22,
"description": "Minimum similarity against the used face"
},
"face_2_sharpen": {
"type": "boolean",
"title": "Face 2 Sharpen",
"default": false,
"x-order": 28,
"description": "Sharpen Image"
},
"codeformer_weight": {
"type": "number",
"title": "Codeformer Weight",
"default": 1,
"maximum": 1,
"minimum": 0,
"x-order": 32,
"description": "face restorer codeformer weight"
},
"face_1_source_img": {
"type": "string",
"title": "Face 1 Source Img",
"format": "uri",
"x-order": 1,
"description": "reference image"
},
"face_2_source_img": {
"type": "string",
"title": "Face 2 Source Img",
"format": "uri",
"x-order": 16,
"description": "reference image"
},
"face_1_blend_faces": {
"type": "boolean",
"title": "Face 1 Blend Faces",
"default": true,
"x-order": 2,
"description": "Will blend faces if True"
},
"face_1_faces_index": {
"type": "string",
"title": "Face 1 Faces Index",
"default": "0",
"x-order": 9,
"description": "The face index to use for swapping, comma separated list of face numbers starting from 0"
},
"face_1_min_ref_sim": {
"type": "number",
"title": "Face 1 Min Ref Sim",
"default": 0,
"maximum": 1,
"minimum": 0,
"x-order": 8,
"description": "Minimum similarity against the reference"
},
"face_1_same_gender": {
"type": "boolean",
"title": "Face 1 Same Gender",
"default": false,
"x-order": 3,
"description": "Use same gender filtering"
},
"face_2_blend_faces": {
"type": "boolean",
"title": "Face 2 Blend Faces",
"default": true,
"x-order": 17,
"description": "Will blend faces if True"
},
"face_2_faces_index": {
"type": "string",
"title": "Face 2 Faces Index",
"default": "0",
"x-order": 24,
"description": "The face index to use for swapping, comma separated list of face numbers starting from 0"
},
"face_2_min_ref_sim": {
"type": "number",
"title": "Face 2 Min Ref Sim",
"default": 0,
"maximum": 1,
"minimum": 0,
"x-order": 23,
"description": "Minimum similarity against the reference"
},
"face_2_same_gender": {
"type": "boolean",
"title": "Face 2 Same Gender",
"default": false,
"x-order": 18,
"description": "Use same gender filtering"
},
"face_restorer_name": {
"enum": [
"None",
"CodeFormer",
"GFPGAN"
],
"type": "string",
"title": "face_restorer_name",
"description": "face restorer name",
"default": "CodeFormer",
"x-order": 30
},
"face_1_sort_by_size": {
"type": "boolean",
"title": "Face 1 Sort By Size",
"default": false,
"x-order": 4,
"description": "Sort Faces by size"
},
"face_2_sort_by_size": {
"type": "boolean",
"title": "Face 2 Sort By Size",
"default": false,
"x-order": 19,
"description": "Sort Faces by size"
},
"restorer_visibility": {
"type": "number",
"title": "Restorer Visibility",
"default": 1,
"maximum": 1,
"minimum": 0,
"x-order": 31,
"description": "face restorer visibility"
},
"upscaler_visibility": {
"type": "number",
"title": "Upscaler Visibility",
"default": 1,
"maximum": 1,
"minimum": 0,
"x-order": 35,
"description": "upscaler visibility"
},
"face_1_improved_mask": {
"type": "boolean",
"title": "Face 1 Improved Mask",
"default": false,
"x-order": 11,
"description": "Use Improved Mask"
},
"face_2_improved_mask": {
"type": "boolean",
"title": "Face 2 Improved Mask",
"default": false,
"x-order": 26,
"description": "Use Improved Mask"
},
"face_1_erosion_factor": {
"type": "number",
"title": "Face 1 Erosion Factor",
"default": 1,
"maximum": 10,
"minimum": 0,
"x-order": 14,
"description": "Erosion Factor"
},
"face_2_erosion_factor": {
"type": "number",
"title": "Face 2 Erosion Factor",
"default": 1,
"maximum": 10,
"minimum": 0,
"x-order": 29,
"description": "Erosion Factor"
},
"face_1_check_similarity": {
"type": "boolean",
"title": "Face 1 Check Similarity",
"default": false,
"x-order": 5,
"description": "If True, discard images with low similarity"
},
"face_2_check_similarity": {
"type": "boolean",
"title": "Face 2 Check Similarity",
"default": false,
"x-order": 20,
"description": "If True, discard images with low similarity"
},
"face_1_color_corrections": {
"type": "boolean",
"title": "Face 1 Color Corrections",
"default": false,
"x-order": 12,
"description": "Use Color Correction"
},
"face_2_color_corrections": {
"type": "boolean",
"title": "Face 2 Color Corrections",
"default": false,
"x-order": 27,
"description": "Use Color Correction"
},
"face_1_compute_similarity": {
"type": "boolean",
"title": "Face 1 Compute Similarity",
"default": false,
"x-order": 6,
"description": "If True will compute similarity and add it to the image info"
},
"face_2_compute_similarity": {
"type": "boolean",
"title": "Face 2 Compute Similarity",
"default": false,
"x-order": 21,
"description": "If True will compute similarity and add it to the image info"
},
"face_1_reference_face_index": {
"type": "integer",
"title": "Face 1 Reference Face Index",
"default": 0,
"x-order": 10,
"description": "The face index to use to extract face from reference"
},
"face_2_reference_face_index": {
"type": "integer",
"title": "Face 2 Reference Face Index",
"default": 0,
"x-order": 25,
"description": "The face index to use to extract face from reference"
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "string",
"title": "Output",
"format": "uri"
}