Avatar & Image Animation
Run FOMM yourself: one still image, one driving video, under 2GB of VRAM
First Order Motion Model is the NeurIPS 2019 first-order motion model — MIT licensed, 10 self-supervised keypoints, 256x256 output. Inference weights total just 228MB. On NexGPU that is a Tesla V100 32GB at $0.188/GPU-hr or an RTX 3090 24GB at $0.193/GPU-hr, billed per second.
FOMM · self-hosted
FOMM stands for First Order Motion Model for Image Animation, by Aliaksandr Siarohin, Stephane Lathuiliere, Sergey Tulyakov, Elisa Ricci and Nicu Sebe, out of the University of Trento and Snap, published at NeurIPS 2019. The repo lives at github.com/AliaksandrSiarohin/first-order-model under an MIT license. Its counter-intuitive trick is that it uses no facial landmark supervision at all: it learns 10 keypoints without labels, takes a first-order Taylor expansion around each one to get a local affine transform, stitches those into a dense optical flow field, and hands the result to an occlusion-aware generator that inpaints the pixels the warp could not cover. Because it knows nothing about what a face is, the same architecture drives faces, full-body tai chi, fashion models, animal silhouettes and even a robot arm.
The 2020 wave of talking-photo apps, the Dame da ne meme videos and Avatarify's live Zoom face swaps were nearly all running FOMM's vox-adv weights underneath. The lineage has moved three generations since: the same lead author built MRAA at Snap Research (CVPR 2021, aimed at articulated objects — that "Check out our new paper" banner at the top of the FOMM README points to it), the community shipped Thin-Plate Spline Motion Model (CVPR 2022, swapping thin-plate splines in for the first-order affine transforms), and Kuaishou's KwaiVGI released LivePortrait (2024), which pushed the same implicit-keypoint warping into production-grade lip and gaze retargeting. So be clear about what you are downloading: today FOMM is the baseline and the textbook, not the state of the art. It has not been deleted, renamed or archived, and it still runs end to end.
That is exactly what makes it the best model in this family to run yourself. The full inference stack is 228MB of weights — 54.2MB for the keypoint detector and 174MB for the generator, per Qualcomm AI Hub's float ONNX export — so the cheapest card in the fleet can render clips all day. And its training recipe is honest about what it costs: the official vox-256.yaml specifies batch_size=40, num_epochs=100, num_repeats=75, and the README says outright that this batch "is tuned to run on 2 or 4 Titan-X gpu". NexGPU covers both ends: a Tesla V100 32GB from $0.188/GPU-hr to validate, or four RTX 4090s aggregating 96GB to reproduce — metered per second, no minimum, no setup fee, and compute billing stops the moment the instance stops.
01 —
The official checkpoints, and what each one actually drives
All 256x256, all MIT — the filenames and byte sizes below match the Google Drive / Yandex Disk listings exactly
| Version | Parameters | VRAM | Context | Notes |
|---|---|---|---|---|
| vox-256 (vox-cpk.pth.tar) | 10 keypoints / 728.8MB checkpoint | Under 2GB peak at fp32 inference; training at batch_size=40 needs 40GB-class VRAM or multiple cards | 256x256 output; driving video must be cropped to a face-centred square | The VoxCeleb face model. Default choice for talking-head avatars and photo revival, and the one checkpoint that appears in nine out of ten tutorials. |
| vox-adv-256 (vox-adv-cpk.pth.tar) | 10 keypoints / same architecture plus adversarial loss | Same sub-2GB inference footprint as vox-256; training additionally keeps a discriminator resident | 256x256 output; same face-crop requirement | The GAN-trained face variant — sharper texture, fewer smeared edges. This is the checkpoint Avatarify-style live face-swap tools shipped with. |
| taichi-256 / taichi-adv-256 (taichi-cpk.pth.tar) | 10 keypoints / 750.9MB checkpoint | Under 2GB inference; leave a few extra GB for decode and write-out buffers on busy full-body frames | 256x256 output; needs the full body in frame, one subject, simple background | Trained on tai chi video. One of the few FOMM weights that animates an entire person rather than just a head — reach for it for full-body pose transfer demos. |
| fashion-256 (fashion.pth.tar) | 10 keypoints / 750.8MB checkpoint | Under 2GB inference; in batch rendering the bottleneck is ffmpeg encoding, not VRAM | 256x256 output; plain background, model standing and turning | Trained on the Fashion Video dataset. The shortest path to making a static e-commerce model shot turn around, and it handles skirt and fabric deformation far more stably than the face weights. |
| mgif-256 (mgif-cpk.pth.tar) | 10 keypoints / quadruped side-view silhouettes | Under 2GB inference; the source material is low-resolution GIF, so VRAM is never the constraint | 256x256 output; flat-background side-profile silhouettes | The MGif dataset is all animal silhouettes. Cheapest way to sanity-check that FOMM generalises past humans, and it produces a watchable result in minutes. |
| bair-256 (bair-cpk.pth.tar) | 10 keypoints / 750.8MB checkpoint | Under 2GB inference; sequences are short, so one card can run several streams concurrently | 256x256 output; fixed overhead camera on a tabletop | The BAIR robot-pushing dataset, included to show the first-order motion representation does not care whether the subject is alive. Still cited as a control in robot video-prediction work. |
02 —
Picking a card: check which GPU architectures torch 1.12.1 covers before you check VRAM
The official requirements.txt pins PyTorch to 1.12.1, and that constraint rules out cards long before memory does
Run inference on the exact pinned environment, at the lowest possible cost
Tesla V100 32GB$0.188/GPU-hr
V100 is sm_70, which the official torch 1.12.1 wheels ship native kernels for — clone, pip install -r requirements.txt, run, without editing a single line for compatibility. And 32GB against a 228MB model is pure headroom.
Batch rendering, with a 256x256-to-1024 upscaler resident on the same card
RTX 3090 24GB$0.193/GPU-hr
sm_86 is also inside 1.12.1's build targets, and 24GB comfortably holds FOMM inference plus a GFPGAN or Real-ESRGAN pass at the same time, so frames never round-trip through disk.
Reproduce the official vox-256 training recipe (batch_size=40) on a single card
RTX A6000 48GB$0.817/GPU-hr
The README states that batch was tuned for 2 to 4 Titan X cards at 12GB each; 48GB on one card absorbs in a single device what used to need four. FOMM is also fp32 throughout with no AMP path in the code, which is exactly where the A6000's fp32 throughput pays off.
Replicate the official --device_ids 0,1,2,3 multi-GPU run and finish faster
4 x RTX 4090 24GB$0.540/GPU-hr ($2.160/hr for four)
96GB aggregate dwarfs the original 4x Titan X, and DataParallel over PCIe is plenty at 256x256. One caveat: Ada is sm_89 and is not in 1.12.1's compiled targets, so a 4090 means moving to PyTorch 2.x and dealing with the torch.load and numpy breaking changes that come with it.
03 —
Instance to finished clip, in four steps
Every command below is straight from the official repo, unmodified
- 01
Boot an instance and install the pinned dependencies
Start from a PyTorch prebuilt image in the NexGPU console and get in over SSH or Jupyter. requirements.txt is only fifteen packages, all hard-pinned: torch==1.12.1, torchvision==0.13.1, numpy==1.23.3, scikit-image==0.19.3, imageio==2.22.0. numpy stops at 1.23.3 for a reason — 1.24 removed the np.float and np.int aliases, and upgrading on your own initiative breaks the code immediately.
git clone https://github.com/AliaksandrSiarohin/first-order-model.git && cd first-order-model && pip install -r requirements.txt - 02
Fetch a checkpoint and crop the driving video to a face square
The author hosts weights on Google Drive and Yandex Disk. vox-cpk.pth.tar is 728.8MB and taichi-cpk.pth.tar is 750.9MB — those figures include the generator, the discriminator, the keypoint detector and three optimizer states, of which pure inference touches only about 228MB. The driving video has to be cropped to a face-centred square first or the keypoints drift; the repo's crop-video.py prints the exact ffmpeg command to run.
python crop-video.py --inp driving_raw.mp4 - 03
Run demo.py — and do not forget --relative
This is where most first attempts go wrong. demo.py's parser.set_defaults sets both relative and adapt_scale to False, so the default run uses absolute keypoint coordinates and transplants the driver's face geometry onto your output, which reads as a different person entirely. --relative transfers only the motion delta, --adapt_scale normalises motion magnitude using the convex hull of the keypoints, and --find_best_frame picks the driving frame whose pose best matches your source. Note that face-alignment is not in requirements.txt and has to be installed separately.
pip install face-alignment && python demo.py --config config/vox-256.yaml --checkpoint vox-cpk.pth.tar --source_image source.png --driving_video driving.mp4 --relative --adapt_scale --find_best_frame --result_video result.mp4 - 04
Either chain an upscaler, or scale out and train on your own data
Every official checkpoint outputs 256x256, so anything destined for production needs a face-restoration or general upscaling pass behind it. To train your own data, follow the official command: vox-256.yaml carries num_epochs=100, num_repeats=75 and batch_size=40, using DataParallel with the sync_batchnorm implementation vendored in the repo. Card count is just a list in --device_ids — add cards, add numbers.
CUDA_VISIBLE_DEVICES=0,1,2,3 python run.py --config config/vox-256.yaml --device_ids 0,1,2,3
Pennies per clip, about $150 to reproduce a training run
Inference first. An RTX 3090 24GB is $0.193/GPU-hr, which is $0.193 / 3600 = about $0.0000536 per second. Boot, install, pull the 728.8MB vox-cpk.pth.tar, render a 30-second driving clip — cap that at 20 minutes and you pay 0.193 x (20 / 60) = $0.064. Want it cheaper? A Tesla V100 32GB costs 0.188 x (20 / 60) = $0.063, and because it is sm_70 the pinned torch 1.12.1 supports it natively, so the environment time you save is worth far more than the cent you save. Training next. Replicating the official four-card setup: 4 x RTX 4090 24GB = 4 x $0.540 = $2.160/hr. Budget 72 hours and that is 2.160 x 72 = $155.52. The same 72 hours on a single RTX A6000 48GB is 0.817 x 72 = $58.82 — cheaper but slower, which makes it the sensible way to validate the config and the data pipeline before you scale out. Storage last. Call it 20GB for the repo, one checkpoint and a cropped dataset: at the $0.414/GB-month median that is 20 x 0.414 = $8.28/month. Pulling 2GB of finished renders back down costs 2 x 0.0081 = $0.016 at the $0.0081/GB median egress rate. One thing to keep in mind: compute billing stops the second the instance stops, but storage keeps billing until the volume is destroyed — clean up after a training run.
04 —
FAQ
How much VRAM does First Order Motion Model actually need?
Is FOMM stuck at 256x256? How do I get a 1080p avatar out of it?
Is FOMM still worth using, or should I go straight to LivePortrait or TPSMM?
vox-cpk.pth.tar is 728MB — why do you say the model is only 228MB?
I installed the official requirements.txt and everything breaks — torch.load and numpy errors. What now?
Why does my output look like the person in the driving video instead of my source photo?
More in Digital humans and face animation
Start building on NexGPU
Enterprise R&D team or solo developer — either way, your first job can be running in minutes.
Sign up to browse live network pricing. No payment method required.
