vetkastar / face_swap_lab

  • Public
  • 243 runs
  • L40S
Iterate in playground

Input

pip install replicate
Set the REPLICATE_API_TOKEN environment variable:
export REPLICATE_API_TOKEN=<paste-your-token-here>

Find your API token in your account settings.

Import the client:
import replicate

Run vetkastar/face_swap_lab using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

output = replicate.run(
    "vetkastar/face_swap_lab:7096726973074d1e8f866c734e467c524806ea0d319934374bd343abceaef88f",
    input={
        "scale": 1,
        "face_2_enable": False,
        "upscaler_name": "4x-UltraSharp",
        "face_1_min_sim": 0,
        "face_1_sharpen": False,
        "face_2_min_sim": 0,
        "face_2_sharpen": False,
        "codeformer_weight": 1,
        "face_1_blend_faces": True,
        "face_1_faces_index": "0",
        "face_1_min_ref_sim": 0,
        "face_1_same_gender": False,
        "face_2_blend_faces": True,
        "face_2_faces_index": "0",
        "face_2_min_ref_sim": 0,
        "face_2_same_gender": False,
        "face_restorer_name": "CodeFormer",
        "face_1_sort_by_size": False,
        "face_2_sort_by_size": False,
        "restorer_visibility": 1,
        "upscaler_visibility": 1,
        "face_1_improved_mask": False,
        "face_2_improved_mask": False,
        "face_1_erosion_factor": 1,
        "face_2_erosion_factor": 1,
        "face_1_check_similarity": False,
        "face_2_check_similarity": False,
        "face_1_color_corrections": False,
        "face_2_color_corrections": False,
        "face_1_compute_similarity": False,
        "face_2_compute_similarity": False,
        "face_1_reference_face_index": 0,
        "face_2_reference_face_index": 0
    }
)

# To access the file URL:
print(output.url())
#=> "http://example.com"

# To write the file to disk:
with open("my-image.png", "wb") as file:
    file.write(output.read())

To learn more, take a look at the guide on getting started with Python.

Output

No output yet! Press "Submit" to start a prediction.

Run time and cost

This model runs on Nvidia L40S GPU hardware. We don't yet have enough runs of this model to provide performance information.

Readme

This model doesn't have a readme.