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.
What this skill does
# 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](https://github.com/hacksider/Deep-Live-Cam)
## Instructions
### 1. Install and configure
```bash
git clone https://github.com/hacksider/Deep-Live-Cam.git
cd Deep-Live-Cam
pip install -r requirements.txt
```
Download models into the `models/` directory:
```bash
mkdir -p models
wget -O models/inswapper_128_fp16.onnx "https://huggingface.co/hacksider/deep-live-cam/resolve/main/inswapper_128_fp16.onnx"
```
For GPU acceleration:
```bash
pip install onnxruntime-gpu # NVIDIA CUDA
pip install onnxruntime-rocm # AMD ROCm
pip install onnxruntime-coreml # Apple Silicon
```
### 2. Run face swap
**GUI mode (webcam, real-time):**
```bash
python run.py
```
**CLI mode — process a video file:**
```bash
python run.py \
--source path/to/source_face.jpg \
--target path/to/target_video.mp4 \
--output path/to/output.mp4 \
--execution-provider cuda
```
**CLI mode — process a single image:**
```bash
python run.py \
--source path/to/source_face.jpg \
--target path/to/target_image.jpg \
--output path/to/output.jpg
```
### 3. Key features
- **Mouth Mask** — Retains original mouth for accurate lip movement: `--mouth-mask`
- **Face Mapping** — Different source faces on multiple people: `--face-mapping`
- **Quality Enhancement** — GFPGAN or CodeFormer: `--enhancer gfpgan`
## Examples
### Example 1: Swap a face in a conference recording
```bash
python run.py \
--source speaker_headshot.jpg \
--target conference_talk.mp4 \
--output anonymized_talk.mp4 \
--execution-provider cuda \
--enhancer gfpgan
```
This replaces the speaker's face in a 45-minute conference recording with the source face, using GPU acceleration and GFPGAN enhancement for broadcast-quality output.
### Example 2: Programmatic face swap with Python
```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
```bash
python run.py --mouth-mask --execution-provider cuda
```
Launches the GUI with webcam input. Select a source face image, enable mouth mask for natural lip sync, and start the live face swap at 25-30 FPS on an RTX 3060.
## 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 lighting; degrades at extreme head rotations (>60°)
- **GPU recommended** — CPU mode works but is very slow; NVIDIA RTX 3060+ with 6GB+ VRAM recommended
- **Verify results** — Heavy occlusion (masks, large sunglasses) can cause artifacts
- **Use batch mode for quality** — Real-time trades resolution for speed; use offline processing for high-res output
## References
- [Deep-Live-Cam GitHub](https://github.com/hacksider/Deep-Live-Cam)
- [InsightFace Documentation](https://insightface.ai/)
- [GFPGAN (Face Enhancement)](https://github.com/TencentARC/GFPGAN)
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.