How luxxxonly/deep-live-cam works
Deep-Live-Cam is a desktop application for live and file-based face swapping, with optional enhancement, face mapping, mouth masking, and GPU acceleration. Users choose a source face and a camera or image/video target; the UI or CLI configures processing, frame processors transform frames, and the application displays or writes the result. The graph combines sampled calls with relationships named by the source index and README. Some dynamic processor dispatch and live-mode wiring are not shown in the excerpts, so those links are marked unverified.
Main entry points: ui.py Desktop UI · modules/core.py CLI entry · face_swapper.py Face swapping · frame/core.py Frame dispatch
Components 23
Interaction
- CLI entry
modules/core.py - Desktop UI
modules/ui.py - Live capture
modules/capturer.py - Video capture
modules/video_capture.py
Face analysis
- Face analysis
modules/face_analyser.py - Face mapping
modules/cluster_analysis.py
Frame processing
- Face swapping
modules/processors/frame/face_swapper.py - Frame dispatch
modules/processors/frame/core.py - Mouth masking
modules/processors/frame/face_masking.py - Face enhancement
modules/processors/frame/face_enhancer.py - GPEN 256
modules/processors/frame/face_enhancer_gpen256.py - GPEN 512
modules/processors/frame/face_enhancer_gpen512.py - ONNX enhancement
modules/processors/frame/_onnx_enhancer.py
Runtime support
- Media utilities
modules/utilities.py - Runtime settings
modules/globals.py - GPU image ops
modules/gpu_processing.py - Model files
models - Model downloader
modules/model_downloader.py - ONNX optimization
modules/onnx_optimize.py - Frame prediction
modules/predicter.py
Other components
- User
- Camera
- Hugging Face
Connections 30
- User → Desktop UI: configures
README.md - User → CLI entry: configures
modules/core.py - Desktop UI → CLI entry: starts
modules/core.py - Desktop UI → Live capture: controls
modules/ui.py - Camera → Live capture: provides frames
- Desktop UI → Video capture: uses
modules/ui.py - CLI entry → Frame dispatch: dispatches frames
modules/core.py - CLI entry → Media utilities: uses media tools
modules/core.py - CLI entry → Desktop UI: initializes
modules/core.py - CLI entry → Runtime settings: sets options
modules/core.py - Frame dispatch → Face analysis: gets faces
modules/processors/frame/core.py - Frame dispatch → Face swapping: dispatches processor
modules/processors/frame/face_swapper.py - Face swapping → Face analysis: detects faces
modules/processors/frame/face_swapper.py - Face swapping → Face mapping: uses mapping
modules/processors/frame/face_swapper.py - Face swapping → GPU image ops: uses GPU ops
modules/processors/frame/face_swapper.py - Face swapping → Model downloader: ensures models
modules/processors/frame/face_swapper.py - Face analysis → Model downloader: ensures models
modules/face_analyser.py - Face analysis → ONNX optimization: optimizes models
modules/face_analyser.py - Frame dispatch → Media utilities: reads and writes media
modules/processors/frame/core.py - Face enhancement → ONNX enhancement: uses inference
modules/processors/frame/face_enhancer.py - GPEN 256 → ONNX enhancement: uses inference
modules/processors/frame/face_enhancer_gpen256.py - GPEN 512 → ONNX enhancement: uses inference
modules/processors/frame/face_enhancer_gpen512.py - ONNX enhancement → ONNX optimization: uses optimization
modules/processors/frame/_onnx_enhancer.py - Model downloader → Hugging Face: downloads models
modules/model_downloader.py - Model downloader → Model files: stores models
modules/model_downloader.py - Desktop UI → Face analysis: uses face tools
modules/ui.py - Desktop UI → Frame dispatch: selects processors
modules/ui.py - Desktop UI → Frame prediction: uses prediction
modules/ui.py - Mouth masking → GPU image ops: uses GPU ops
modules/processors/frame/face_masking.py - CLI entry → Runtime settings: configures runtime
modules/core.py