ComfyUI-AdvancedLivePortrait-Universal
Maintained AdvancedLivePortrait fork with universal device support (Intel XPU, Apple MPS, CUDA, ROCm, CPU) and other improvements.
Nodes (6)
The node that actually renders the animation
Build an expression from raw numbers instead of sliders
Puppet a face with sliders instead of a prompt
Pull a saved expression back into your graph
A print statement for the pack's expression data
Turn a dialed-in expression into a reusable preset
ComfyUI-AdvancedLivePortrait (Universal Edition)
🌟 Maintained Community Edition: This is an actively maintained, modernized edition of the original PowerHouseMan/ComfyUI-AdvancedLivePortrait. Beyond adding native multi-device hardware acceleration, this edition loads the official neural eye & lip retargeting networks, modernizes expression presets to safe JSON, adds optional FP16 autocast acceleration, and includes updated workflow templates.
Key Enhancements in this Edition
1. Universal Device & Hardware Acceleration
Unlike the original CUDA-only implementation, this edition integrates natively with ComfyUI's model management:
- Intel Arc & Data Center GPUs (XPU) — Full acceleration via PyTorch XPU backend.
- Apple Silicon (MPS) — Metal Performance Shaders acceleration on macOS (M1/M2/M3/M4).
- NVIDIA GPUs (CUDA) — Native CUDA acceleration with Tensor Core optimizations.
- AMD GPUs (ROCm / DirectML) — Accelerated through ComfyUI device mapping.
- CPU Fallback — Graceful execution when ComfyUI is launched in CPU mode (
--cpu).
2. Safe & Portable JSON Expression Presets
- No More Pickled Binaries: Upstream used
dillto pickle internal Python objects and PyTorch tensors, which hardcoded CUDA memory pointers (crashing on Intel Arc, Mac, and CPU) and broke on forked repository paths. - Human-Readable
.json: Presets are now saved as lightweight, human-readable JSON files that can be edited, shared, and loaded seamlessly across any operating system and hardware device. - Automatic Legacy Migration: Any legacy
.expfiles inoutput/exp_data/orsample/are automatically loaded safely across all devices (CUDA, XPU, MPS, CPU) and auto-migrated to.json.
3. Optional Half-Precision (FP16) Acceleration
- Faster Batch Rendering: Optional
half_precisiontoggle onAdvancedLivePortraitandExpressionEditoraccelerates video rendering by ~35% to 45% and cuts peak activation VRAM in half. - Native PyTorch Autocast: Uses dynamic autocast rather than destructive model casting.
- Zero Jitter: Heavy neural networks (
WarpingNetwork,SPADEDecoder) run in FP16, while coordinate math, Euler rotation matrices, and stitching offsets stay in Float32 to eliminate pupil/mouth micro-jittering.
4. Neural Eye & Lip Retargeting Networks
- Real Retargeting Modules: Unlike the original implementation which used basic coordinate-shift heuristics, this fork actually loads and runs the official LivePortrait
retarget_eyeandretarget_lipneural networks fromstitching_retargeting_module.pth/.safetensors. - Natural Eye Blinking & Lip Motion: Dynamically calculates eye openness and lip separation ratios, feeding them through the retargeting MLPs for lifelike eye blinking, pupil tracking, and mouth synchronization without facial distortion.
- Full Node Integration: Fully integrated into both
AdvancedLivePortrait(for video retargeting) andExpressionEditor(forOnlyEyesandOnlyMouthtransfer modes), with automatic fallback if retargeting weights are absent.
5. Ready-to-Run Workflow Templates
Includes 5 refreshed, ready-to-use workflows in example_workflows/ accessible directly from ComfyUI's sidebar template browser.
Features Overview
- ExpressionEditor: Interactive slider-based facial expression adjustments (smile, wink, eyebrow, gaze, mouth shapes, head pose) with real-time UI preview.
- Animation Chaining: Multi-keyframe facial expression sequences with automated smoothing and interpolation.
- Expression Presets: Save and load reusable
.jsonexpression presets (SaveExpData,LoadExpData). - Video Retargeting: Drive portraits with facial motion extracted from driving video clips or reference photos.
https://github.com/user-attachments/assets/90b78639-6477-48af-ba49-7945488df581
Installation
Clone this repository into your ComfyUI/custom_nodes/ directory:
cd ComfyUI/custom_nodes
git clone https://github.com/cyberterm/ComfyUI-AdvancedLivePortrait-Universal.git
Or install via ComfyUI Manager by searching for ComfyUI-AdvancedLivePortrait-Universal.
Usage & Workflow Templates
Built-in Templates
This extension includes ready-to-run ComfyUI workflow templates. To load them inside ComfyUI:
- Click on the Templates icon in the ComfyUI sidebar.
- Select ComfyUI-AdvancedLivePortrait-Universal.
- Choose any of the included workflows:
01_Basic_Simple_Expression_Editing— Interactive slider expression editing on a single portrait.02_Basic_LivePortrait_With_Expression_Editing— Driving portrait animation with a video + expression tweaking.03_Basic_Extracting_Expression_From_Photo— Extracting expressions from a reference photo onto your portrait.04_Advanced_Animate_Without_Video— Multi-keyframe animation chaining without needing a driving video.05_Advanced_Inserting_Expressions_Into_Video— Seamlessly injecting scripted expressions into driving video clips.
Test Assets & Sample Media
Sample assets are bundled in the sample/ directory:
- Ready-to-use samples:
source_image.png,driving_video.mp4,exp_image.png,sample_exp_data.json. - Sample library:
sample/original_sample_asset/contains additional driving video clips (driving/d0–d9.mp4) and portrait photos (source/s0–s10.jpg).
Command Timeline Scripting
You can sequence facial expressions over time using the command text box in the AdvancedLivePortrait node:
[Motion index] = [Changing frame length] : [Length of frames waiting for next motion]
- Motion index
0is the original source image. - Indexes
1, 2, ...correspond to the order connected throughmotion_link. - Linking a driving video to
src_imageswill layer facial expressions on top of the driving video.
Saving & Loading Expressions
You can save and load custom expression presets with the Save Exp Data and Load Exp Data nodes:
- Save Exp Data: Connect
save_expfromExpressionEditorand specify afile_name(e.g.happy_smile). Presets are saved as clean, human-readable.jsonfiles inComfyUI/output/exp_data/. Outputs the saved preset name as a string. - Load Exp Data: Select any saved preset from the
file_namedropdown menu, or wire a name intocustom_name(e.g. chained directly fromSaveExpData). Scale the expression strength using theratioslider (0.0–1.0). - Universal Backwards Compatibility: Legacy
.expfiles inoutput/exp_data/orsample/are automatically loaded across all devices (CUDA, Intel XPU, Apple MPS, CPU) and auto-migrated to.json.
Changelog
See CHANGELOG.md for full release notes and version history.
Thanks & Credits
- Original LivePortrait paper & models: https://liveportrait.github.io/
- Upstream ComfyUI implementation: https://github.com/PowerHouseMan/ComfyUI-AdvancedLivePortrait
- Safetensors model conversions: https://github.com/kijai/ComfyUI-LivePortraitKJ