Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hacksider/Deep-Live-Cam/llms.txt

Use this file to discover all available pages before exploring further.

Deep-Live-Cam can run in two modes: a graphical interface launched with no arguments, and a headless CLI mode activated by supplying at least one of -s, -t, or -o. Every flag listed below is available in both modes, but flags that relate to on-screen controls (such as --live-mirror) have no visible effect when the GUI is absent.

I/O paths

FlagAliasTypeDescription
--source-spathSource image containing the face to swap in. Providing this flag (or -t/-o) activates headless mode.
--target-tpathTarget image or video file to process.
--output-opathOutput file path or directory. The final name is derived automatically when omitted.
Passing any of -s, -t, or -o sets headless = True in modules.globals, which skips the GUI window entirely and calls start() directly.

Frame processors

FlagDefaultChoicesDescription
--frame-processorface_swapperface_swapper face_enhancer face_enhancer_gpen256 face_enhancer_gpen512One or more processors to run on each frame, evaluated left to right. Accepts multiple values.
# Swap only
python run.py -s source.jpg -t video.mp4 --frame-processor face_swapper

# Swap then enhance
python run.py -s source.jpg -t video.mp4 --frame-processor face_swapper face_enhancer

Processing options

FlagDefaultDescription
--keep-fpsFalsePreserve the original frame rate of the target video. When disabled, output defaults to 30 fps.
--keep-audioTrueMux the original audio stream back into the processed video using FFmpeg.
--keep-framesFalseRetain the extracted per-frame PNG files on disk after encoding finishes.
--many-facesFalseApply the swap to every detected face in the frame instead of just the most prominent one.
--nsfw-filterFalseRun an NSFW classifier on the target before processing and abort if content is flagged.
--map-facesFalseEnable multi-face mapping mode; uses source_target_map to match specific source faces to specific target faces. Disables the in-memory FFmpeg pipeline and forces disk-based frame extraction.
--mouth-maskFalseComposite the original mouth region back over the swapped face to preserve natural lip movement and teeth.
Use --many-faces when the target contains a crowd or multiple subjects. For precise per-identity control over who gets swapped, use --map-faces with the GUI’s face-mapping panel instead.

Video encoding

FlagDefaultChoices / RangeDescription
--video-encoderlibx264libx264 libx265 libvpx-vp9FFmpeg codec for the output video. On CUDA hardware, libx264 is automatically promoted to h264_nvenc and libx265 to hevc_nvenc. On DirectML hardware, these map to h264_amf and hevc_amf respectively.
--video-quality18051CRF value passed to the encoder. Lower values produce larger, higher-quality files; higher values produce smaller files with more compression artifacts.
python run.py -s source.jpg -t input.mp4 \
  --video-encoder libx264 \
  --video-quality 18
Good balance of compatibility and file size. Playable on virtually all devices.

Live mode

FlagDefaultDescription
--live-mirrorFalseFlip the live webcam output horizontally, matching the natural mirror orientation of a front-facing camera.
--live-resizableFalseAllow the live preview window to be resized by dragging its edges.
-l / --langenUI language code for the GUI interface. Has no effect in headless mode.

Performance and memory

FlagDefaultDescription
--max-memory4 (macOS) / 16 (others)Hard RAM cap in GB. Enforced via resource.setrlimit on Linux/macOS and SetProcessWorkingSetSize on Windows.
--execution-providerauto-detectedOne or more ONNX Runtime execution providers. Auto-detection order: cudarocmcoremldmlcpu.
--execution-threadsauto-detectedThread count for parallel frame processing. Defaults: 1 for DML/ROCm, 2 for CUDA, max(4, min(cpu_count - 2, 16)) for CPU.
# Run on NVIDIA GPU with 2 threads and 8 GB memory limit
python run.py -s source.jpg -t video.mp4 \
  --execution-provider cuda \
  --execution-threads 2 \
  --max-memory 8
Setting --max-memory below the size of the model weights will cause the process to be killed by the OS. The inswapper_128_fp16.onnx model alone requires approximately 500 MB.

Utility

FlagAliasDescription
--version-vPrint the application name and version string, then exit.

Deprecated flags

These flags are still accepted to avoid breaking existing scripts, but they print a deprecation warning and will be removed in a future release.
Deprecated flagReplacementNotes
-f / --face-s / --sourceSource image path.
--cpu-cores--execution-threadsThread count.
--gpu-vendor nvidia--execution-provider cuda
--gpu-vendor apple--execution-provider coreml
--gpu-vendor amd--execution-provider rocm
--gpu-threads--execution-threads

Build docs developers (and LLMs) love