ComfyUI Node

LightSketch Live Portrait

Drive a face from a video, billed per run

By LightSketch-ai·Created 2 years ago·Updated 2 years ago· 2
LightSketch Live Portrait
  • face_image
  • video
video
live_portrait_dsize512
live_portrait_scale2.30
video_frame_load_cap128
live_portrait_lip_zerotrue
live_portrait_relativetrue
live_portrait_vx_ratio0.00
live_portrait_vy_ratio-0.12
live_portrait_stitchingtrue
video_select_every_n_frames1
live_portrait_eye_retargetingfalse
live_portrait_lip_retargetingfalse
live_portrait_lip_retargeting_multiplier1.00
live_portrait_eyes_retargeting_multiplier1.00
api_key_override

LightSketch Live Portrait is a face-driven video animation node: you give it a still face and a video of someone talking, and you get a video of your face doing that person's motions - head turns, blinks, mouth shapes and all. Under the hood it's LivePortrait, the keypoint-based portrait animation model, but the interesting part is where it runs. Not on your machine. On Replicate.

That's the whole pitch. LivePortrait is genuinely great at this - it's fast (the original paper quotes roughly 12.8 ms per frame on a 4090) and, unlike diffusion-based video, it's controllable. But the standard way to run it in ComfyUI, Kijai's LivePortraitKJ, drags in face-detection weights (InsightFace historically, with all the install pain and the non-commercial license that comes with it). This node sidesteps the entire local setup: no model download, no InsightFace, no GPU requirement, nothing. If you're on a weak laptop, a Mac, or just want to try LivePortrait in five minutes, that's a real win.

The trade is obvious: it's a paid API. Every run is a billed Replicate prediction, you're uploading a face image to a third party, and the output round-trips through the network. And fair warning - this is a small hobby pack (a couple of stars, an empty README). The plumbing works, but you're on your own for support.

How it works

The node serializes your face_image to a PNG, opens the driving video from ComfyUI's input/ folder, and hands both to lightsketch-ai/live-portrait on Replicate, forwarding the live_portrait_* settings as model inputs. When the prediction finishes it downloads the result to ComfyUI/output/output_<timestamp>.mp4 and returns that file path as a VIDEO output. No tensors in RAM - just a downloaded file and a path to it.

The inputs that matter

Two required inputs, plus a shelf of optional knobs that mirror the LivePortrait codebase the model wraps - and most you can ignore.

  • face_image (IMAGE) - the still portrait you want to animate. Wire in a Load Image node. A clean, front-facing headshot works best.
  • video - the driving video, chosen from a dropdown of videos in your input/ folder (how to get one in there: see Install).

Of the optional settings, these three are the ones a beginner actually touches:

  • live_portrait_relative (default true) - relative motion transfer. Keep it true when the driving face is a different person and you just want their expressions and head pose. Flip it false for same-person motion replay.
  • live_portrait_lip_zero (default true) - zeros out the driving video's lip motion so only head movement transfers. Turn it false when you want the mouth to actually talk.
  • live_portrait_scale (default 2.3) - how tightly the face is cropped (roughly 1–3). Lower values keep more of the frame; the default is fine for most headshots.

Two more worth knowing for your wallet: video_frame_load_cap (default 128) caps frames processed - lower it to test cheap and fast - and video_select_every_n_frames (default 1) subsamples. The eye/lip retargeting toggles are advanced; leave them off. api_key_override lets you paste a Replicate token on the node itself, which beats fiddling with environment variables.

Install

ComfyUI Manager is easiest: search for "LivePortraitNode" and install the "ComfyUI-LivePortraitNode (Replicate API)" pack, then restart. Or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/LightSketch-ai/ComfyUI-LivePortraitNode

Then restart ComfyUI. There are no model files to download - that's the whole point. The declared dependencies are light (just opencv-python and imageio-ffmpeg), but the code also imports the replicate client and that package is missing from requirements.txt, so install it manually:

pip install replicate

Finally, get a token from replicate.com and either export it or drop it in a replicate_api_key.txt file inside the node's folder:

# Linux/macOS
export REPLICATE_API_TOKEN=r8_xxxx
# Windows PowerShell
$env:REPLICATE_API_TOKEN="r8_xxxx"

Common issues

  • The node is red / won't import. Almost always the missing replicate package - pip install replicate fixes it.
  • "API Key is required" error. The token isn't set. Set REPLICATE_API_TOKEN, add the key file, or use api_key_override.
  • Your driving video isn't in the dropdown. The list is scanned when the node is created. Drop the file into ComfyUI/input/ and re-add the node - or use the "choose video to upload" button on the node, which uploads and selects it for you.
  • The video output won't plug into tensor-based nodes. It's a file path, not frames. Wire it into the pack's own Preview Video node.

If you have a GPU and don't mind the local install, LivePortraitKJ is still free, private, and the community standard. Reach for this node when you want LivePortrait running now, anywhere, with no setup - and you're okay paying per run for it.

CategoryLightSketch

Inputs (16)

NameTypeDefaultDescription
face_imageIMAGE
videoCOMBO0 options:
live_portrait_dsizeoptINT512
live_portrait_scaleoptFLOAT2.30
video_frame_load_capoptINT128
live_portrait_lip_zerooptBOOLEANtrue
live_portrait_relativeoptBOOLEANtrue
live_portrait_vx_ratiooptFLOAT0.00
live_portrait_vy_ratiooptFLOAT-0.12
live_portrait_stitchingoptBOOLEANtrue
video_select_every_n_framesoptINT1
live_portrait_eye_retargetingoptBOOLEANfalse
live_portrait_lip_retargetingoptBOOLEANfalse
live_portrait_lip_retargeting_multiplieroptFLOAT1.00
live_portrait_eyes_retargeting_multiplieroptFLOAT1.00
api_key_overrideoptSTRING

Outputs (1)

NameTypeDescription
videoVIDEO