Downloads · 30 days
0
tonyassi/face-swap
face-swap is a video-to-video model from tonyassi. Use it for the video-to-video task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Mar 10, 2026
Repo size
—
Likes
1
Public
Click a slice to open those files.
.md5.1 KB · 77%
From the Hugging Face model README
The Face Swap API lets you generate AI face swap videos with a single HTTP request. Send a source face image, a target video URL, and the desired duration, and our service returns a deepfake-style video face swap URL.
No code face swap video generations
<div class="banner-pos" style="width:400px;height:400px;position:relative;overflow:hidden;"> <video class="banner-video" id="banner-video" preload="metadata" poster="https://huggingface.co/spaces/ai-media/storage/resolve/main/banner-poster1.png" autoplay muted loop playsinline style="width:100%;height:100%;object-fit:cover;display:block;" > <source src="https://huggingface.co/spaces/tonyassi/storage/resolve/main/banner1.mp4" type="video/mp4"> Your browser does not support the video tag. </video><button id="mute-btn" class="mute-btn" type="button" aria-label="Unmute" style="position:absolute;right:12px;bottom:12px;z-index:2;"> 🔇 </button>
</div>import requests
url = "https://www.face-swap.co/api/generate"
payload = {
"key": "YOUR_API_KEY",
"input_image_url": "https://tinyurl.com/elonmusk-faceswap",
"input_video_url": "https://tinyurl.com/ironman-faceswap",
"duration": 120, # required: 4 | 60 | 120 | 180 (use 4 for trial credits)
"gender": "all", # optional: all | female | male (default: all)
}
r = requests.post(url, json=payload, timeout=60)
r.raise_for_status()
print(r.json())
<a href="https://colab.research.google.com/drive/1OfLNmgUiAek2wQbX5IOOJ5F4iwOUL8Wd?usp=sharing" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid rgba(0,0,0,0.15);border-radius:10px;text-decoration:none;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:14px;color:#111;background:#fff;"> <img src="https://colab.research.google.com/img/colab_favicon_256px.png" alt="Google Colab" style="height:22px;width:auto;display:block;"> <span style="font-weight:600;">Colab Notebook</span> </a>
<a href="https://huggingface.co/spaces/tonyassi/face-swap-video-api" target="_blank" rel="noopener noreferrer" style="display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid rgba(0,0,0,0.15);border-radius:10px;text-decoration:none;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:14px;color:#111;background:#fff;"> <img src="https://huggingface.co/front/assets/huggingface_logo-noborder.svg" alt="Hugging Face" style="height:22px;width:auto;display:block;"> <span style="font-weight:600;">API Playground</span> </a>
Create a face-swapped video job.
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | ✅ | Your API key |
input_image_url | string | ✅ | Public URL to a face image |
input_video_url | string | ✅ | Public URL to a target video |
duration | int | ✅ | Allowed: 4, 60, 120, 180 seconds (use 4 for trial credits) |
gender | string | ❌ | all | female | male (default: all) |
import requests
url = "https://www.face-swap.co/api/generate"
payload = {
"key": "YOUR_API_KEY",
"input_image_url": "https://tinyurl.com/elonmusk-faceswap",
"input_video_url": "https://tinyurl.com/ironman-faceswap",
"duration": 120, # required: 4|60|120|180 (use 4 for trial credits)
"gender": "all", # optional: all|female|male (default: all)
}
r = requests.post(url, json=payload, timeout=60)
r.raise_for_status()
print(r.json())
Check the status of a job.
import requests
job_id = "0c1449fc0e764b5ebdfe24a52bd8f8fa"
r = requests.get(f"https://www.face-swap.co/api/status/{job_id}", timeout=30)
r.raise_for_status()
print(r.json())
View remaining credits for your API key.
import requests
api_key = "YOUR_API_KEY"
r = requests.get(f"https://www.face-swap.co/api/credits/{api_key}", timeout=30)
r.raise_for_status()
print(r.json())
List recent jobs for your API key.
import requests
api_key = "YOUR_API_KEY"
r = requests.get(f"https://www.face-swap.co/api/jobs/{api_key}", timeout=30)
r.raise_for_status()
print(r.json())