Ravana swaps faces in photos, video and webcam, and scores every result for identity and sharpness. Compare settings with numbers, not guesses. Works on NVIDIA, AMD and Intel GPUs.
pip install "git+https://github.com/mrigankad/Ravana.git"
Other swappers leave you to squint at the output. Ravana measures it, so you can see which setting actually worked.
ArcFace cosine similarity between the source face and the result. It tells you whether the swap still looks like the person.
Detail gained or lost against the target. It catches restorers that smear the face.
Try GFPGAN, GPEN or a 1024 boost in one click and compare them side by side with their scores.
Examples from the repo's comparison set. Run ravana evaluate to score your own.



| Ravana | Typical open-source swapper | |
|---|---|---|
| Quality scores on every result | Yes, identity and sharpness | Judge by eye |
| AMD and Intel GPUs | DirectML, picked automatically | Mostly NVIDIA, or separate builds |
| Install | Windows zip, models download on first run | CUDA, cuDNN and version pinning |
| Use as a library | swap_image() in 3 lines, plus a CLI | App or CLI only |
| Consent and labelling | Consent gate, optional watermark | A README disclaimer |
| Batch | Queue tab with retry | CLI scripts |
Detect, embed, swap, mask, restore and composite. ONNX Runtime throughout, so the same models run on CUDA, DirectML or CPU.

HyperSwap 256 for best stills, InSwapper 128 for speed.
GFPGAN, GPEN, CodeFormer, XSeg occlusion, lighting and colour match.
Detect-every-N, ROI tracking and One-Euro smoothing for webcam.
pip install "git+https://github.com/mrigankad/Ravana.git" # CPU
pip install "ravana-sdk[gpu] @ git+https://github.com/mrigankad/Ravana.git" # NVIDIA
pip install "ravana-sdk[directml] @ git+https://github.com/mrigankad/Ravana.git" # AMD / Intel
ravana doctor # explains which GPU is used and how to fix itimport cv2
from face_swap import FaceSwapConfig, swap_image
out = swap_image(cv2.imread("source.jpg"), cv2.imread("target.jpg"),
FaceSwapConfig(quality="seamless", device="auto"))ravana -s source.jpg -t target.jpg -o out.jpg -q seamless
ravana -s source.jpg -t input.mp4 -o out.mp4 -q medium
ravana evaluate -s source.jpg -t target.jpg -o out.jpg
78 icons on a 24 px grid, and Dasha, a ten-headed king with one pose per app state.

Ravana is for VFX, entertainment, privacy and creative work with the consent of everyone shown. Don't use it to impersonate, deceive or harass. Label synthetic media where the law requires it, for example EU AI Act Article 50.
The code is MIT. The default model weights are not: InsightFace and HyperSwap are for non-commercial research, and CodeFormer is under the NTU S-Lab licence. Check each one before you ship anything.
The only official download is GitHub Releases.