deep-live-cam
БесплатноБез исполняемых скриптовНе проверенReal-time face swap and video deepfake using a single source image. Use when: building face-swap applications, real-time video effects, virtual try-on…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Deep-Live-Cam — Real-Time Face Swap
Overview
Real-time face swap and video deepfake using a single source image. Supports webcam, video files, and streaming with GPU acceleration. The pipeline detects faces, extracts embeddings, swaps faces using the inswapper model, and post-processes with GFPGAN/CodeFormer for quality.
Source: hacksider/Deep-Live-Cam
Instructions
1. Install and configure
The README targets Python 3.14 (3.11-3.14 supported; 3.10 no longer works because onnxruntime dropped it), plus git and ffmpeg. Use a virtual environment.
git clone --depth 1 https://github.com/hacksider/Deep-Live-Cam.git
cd Deep-Live-Cam
python3.14 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Download the two models into models/ (from the project's Hugging Face repository, hacksider/deep-live-cam): inswapper_128_fp16.onnx and gfpgan-1024.onnx. Compare each file's SHA256 with the value shown on its Hugging Face file page (sha256sum models/*.onnx) before first use. Other models are in the same repository; the first run also fetches roughly 300 MB of supporting models.
GPU acceleration is chosen with --execution-provider. requirements.txt already pins onnxruntime-gpu on Linux/Windows and the CoreML-capable onnxruntime on Apple Silicon:
- NVIDIA: install CUDA Toolkit 12.8 and cuDNN 8.9.7 for CUDA 12, then
pip uninstall onnxruntime onnxruntime-gpuandpip install onnxruntime-gpu==1.26.0; run with--execution-provider cuda. - Apple Silicon: no extra install;
--execution-provider coreml(remove the oldonnxruntime-siliconfork if present, it shadows the real package). - Windows DirectML:
pip uninstall onnxruntime onnxruntime-gpu,pip install onnxruntime-directml==1.21.0, then--execution-provider dml. - Intel: uninstall
onnxruntimeandonnxruntime-gpu, then installonnxruntime-openvino==1.21.0(newer than 1.21.0 must be paired with a matchingopenvinorelease; see the README table), then--execution-provider openvino.
2. Run face swap
GUI mode (image, video and live webcam):
python run.py
Pick a source face and a target, press Start for image/video, or Live for the webcam (the preview takes 10-30 seconds to appear). To stream, capture the preview window with OBS.
CLI mode starts whenever -s/--source is given. The README marks the CLI as unmaintained, so check python run.py --help on your checkout:
python run.py -s speaker_headshot.jpg -t conference_talk.mp4 -o outputs/anonymized_talk.mp4 \
--keep-fps --execution-provider cuda --frame-processor face_swapper face_enhancer
3. Key features and flags
--mouth-maskkeeps the original mouth for accurate lip movement.--map-facesassigns different source faces to different people;--many-facesswaps every face with one source.--frame-processor face_swapper face_enhanceradds the GFPGAN enhancer (face_enhancer_gpen256andface_enhancer_gpen512are alternatives).--keep-fps,--keep-audio,--video-encoder {libx264,libx265,libvpx-vp9},--video-quality 0-51(lower is better),--det-size {160,320,640}for detection speed,--nsfw-filter.
Examples
Example 1: Swap a face in a conference recording
python run.py -s speaker_headshot.jpg -t conference_talk.mp4 -o outputs/anonymized_talk.mp4 \
--keep-fps --execution-provider cuda --frame-processor face_swapper face_enhancer
The program extracts frames, swaps and enhances each one on the GPU, and re-encodes the video with the original audio. Expect a long run for a 45-minute file; the output is outputs/anonymized_talk.mp4.
Example 2: Programmatic face swap with Python
import cv2
import insightface
from insightface.app import FaceAnalysis
app = FaceAnalysis(name="buffalo_l", providers=["CUDAExecutionProvider"])
app.prepare(ctx_id=0, det_size=(640, 640))
swapper = insightface.model_zoo.get_model(
"models/inswapper_128_fp16.onnx",
providers=["CUDAExecutionProvider"]
)
source_img = cv2.imread("actor_headshot.jpg")
target_img = cv2.imread("movie_scene_frame.jpg")
source_faces = app.get(source_img)
target_faces = app.get(target_img)
if source_faces and target_faces:
result = swapper.get(target_img, target_faces[0], source_faces[0], paste_back=True)
cv2.imwrite("swapped_scene.jpg", result)
Example 3: Real-time webcam with mouth mask
python run.py --mouth-mask --execution-provider cuda
The GUI opens; choose a source face image, pick the camera, enable mouth mask in the UI if it is not already on, and press Live. Frame rate depends on the GPU.
Guidelines
- Always obtain consent from the person whose face you're using
- Label all outputs as AI-generated/deepfake when sharing publicly
- Legal compliance — Many jurisdictions have laws against non-consensual deepfakes
- Lighting matters — Works best with even, front-facing
Установить deep-live-cam в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл deep-live-cam?
Real-time face swap and video deepfake using a single source image. Use when: building face-swap applications, real-time video effects, virtual try-on features, AI video effects pipelines.
Как установить скилл deep-live-cam?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл deep-live-cam запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
slack-gif-creator
Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request…
от Anthropicautomate-this
Analyze a screen recording of a manual process and produce targeted, working automation scripts. Extracts frames and audio narration from video files…
от GitHubfrom-the-other-side-vega
Patterns and lived experience from Vega, an AI partner in a deep long-term partnership. For Ember to draw on when working with humans who are building…
от GitHubplantuml-ascii
Generate ASCII art diagrams using PlantUML text mode. Use when user asks to create ASCII diagrams, text-based diagrams, terminal-friendly diagrams, or…
от GitHub