Open source · MIT · runs on your machine

The face swap that tells you how good it is.

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"
Ravana desktop app: compare slider over a swapped face with identity and sharpness scores

Every result comes with a score.

Other swappers leave you to squint at the output. Ravana measures it, so you can see which setting actually worked.

Identity

ArcFace cosine similarity between the source face and the result. It tells you whether the swap still looks like the person.

Sharpness

Detail gained or lost against the target. It catches restorers that smear the face.

Variants, ranked

Try GFPGAN, GPEN or a 1024 boost in one click and compare them side by side with their scores.

Same inputs, different settings.

Examples from the repo's comparison set. Run ravana evaluate to score your own.

Source face
Source
Seamless preset result
Seamless ID 0.31 · +16.9
GPEN restore result
GPEN restore

Built for the problems people actually hit.

RavanaTypical open-source swapper
Quality scores on every resultYes, identity and sharpnessJudge by eye
AMD and Intel GPUsDirectML, picked automaticallyMostly NVIDIA, or separate builds
InstallWindows zip, models download on first runCUDA, cuDNN and version pinning
Use as a libraryswap_image() in 3 lines, plus a CLIApp or CLI only
Consent and labellingConsent gate, optional watermarkA README disclaimer
BatchQueue tab with retryCLI scripts

How it works.

Detect, embed, swap, mask, restore and composite. ONNX Runtime throughout, so the same models run on CUDA, DirectML or CPU.

Pipeline: ingest, detect and track, identity, swap, mask, restore, composite, temporal, verify, seal, encode

Swappers

HyperSwap 256 for best stills, InSwapper 128 for speed.

Restore and mask

GFPGAN, GPEN, CodeFormer, XSeg occlusion, lighting and colour match.

Realtime

Detect-every-N, ROI tracking and One-Euro smoothing for webcam.

Up and running in a minute.

Python

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 it

Three lines

import cv2
from face_swap import FaceSwapConfig, swap_image

out = swap_image(cv2.imread("source.jpg"), cv2.imread("target.jpg"),
                 FaceSwapConfig(quality="seamless", device="auto"))

CLI

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

One icon set. One mascot.

78 icons on a 24 px grid, and Dasha, a ten-headed king with one pose per app state.

Dasha character poses for ten app states

Use it responsibly.

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.