5.1 KiB
5.1 KiB
TL;DR
If you saw the last post on real-time avatar control with ComfyUI and Vision Pro, here’s the next piece: a fully open-source guide to adding gamepad integration. 🎮
With this setup, you can use your gamepad to control live portrait movements and expressions in ComfyUI. It’s all about bringing that next level of interactive control into your setup—perfect for adding expressions, head movement, and more to your avatar with just a joystick and buttons. Follow along and give it a try!
Preparations
- Install
ComfyUI Web Viewercustome node:- Method 1: search for
ComfyUI Web Viewerin ComfyUI Manager - Method 2: install from github: https://github.com/VrchStudio/comfyui-web-viewer
- Method 1: search for
- Install
Advanced Live Portraitcustome node:- Method 1: search for
ComfyUI-AdvancedLivePortraitin ComfyUI Manager - Method 2: install from github: https://github.com/PowerHouseMan/ComfyUI-AdvancedLivePortrait
- Method 1: search for
- Download
Workflow Example: Live Portrait + Gamepadworkflow:- Download it from here: example_osc_control_002_live_portrait_with_gamepad.json
- Install
TouchOSCapp- AppStore: https://apps.apple.com/us/app/touchosc/id1569996730
- Official Website: https://hexler.net/touchosc
- Download
comfyui_osc_control.tosccomfyui osc control panel inTouchOSCapp- Download it from here: comfyui_osc_control.tosc
How to play
Using Gamepad in TouchOSC App
- Connect Your Gamepad: Connect your gamepad to the device running the
TouchOSCapp (usually through Bluetooth). - Open TouchOSC: Open
TouchOSCapp on your device. - Set Up Connections in TouchOSC:
- Go to Connections settings in
TouchOSCapp. - For OSC, enter your ComfyUI server’s IP address (e.g.,
192.168.1.100:8000). - For Gamepad, enable the Gamepad connection feature.
- Go to Connections settings in
- Import the OSC Control Panel File: Add the comfyui_osc_control.tosc file into
TouchOSC. - Run the Control Panel:
- In the
TouchOSCapp, open thecomfyui_osc_controlpanel. - Go to the
Gamepadtab.
- In the
- Test Your Setup: Try using your gamepad to control the buttons in
TouchOSC. If it works, you’re all set!
Run Workflow in ComfyUI
- Load Workflow
- In ComfyUI, load the file example_osc_control_002_live_portrait_with_gamepad.json
- Set Server Address
- Go to
Server Settingsgroup panel - Update
Server Addressto your ComfyUI Server IP address, e.g.192.168.1.100
- Go to
- Select Portrait Image
- You could use sample_pic_01_woman_head.png as an example portait to control
- Enable Auto Queue
- Enable and select
Extra options->Auto Queue->instant
- Enable and select
- Run Workflow
- Press
Queue Promptbutton to start executing the workflow - Click
[Open Web Viewer]button to view the portrait in a separate window
- Press
- Use Your Gamepad
- Grab your gamepad and enjoy controlling the portrait with it!
Cheat Code
Head Move (pitch/yaw) --- Left Stick
Head Move (rotate/roll) - Left Stick + A
Pupil Move -------------- Right Stick
Smile ------------------- Left Trigger + Right Bumper
Wink -------------------- Left Trigger + Y
Blink ------------------- Right Trigger + Left Bumper
Eyebrow ----------------- Left Trigger + X
Oral - aaa -------------- Right Trigger + Pad Left
Oral - eee -------------- Right Trigger + Pad Up
Oral - woo -------------- Right Trigger + Pad Right
Advanced Tips
- If you are an expert on OSC communcation protocol, you may change / update / add more OSC controls by using the
OSC Control nodesinComfyUI Web ViewerComfyUI custome node.
Materials
- ComfyUI workflow: example_osc_control_002_live_portrait_with_gamepad.json
- TouchOSC panel file: comfyui_osc_control.tosc
- Sample portrait picture: sample_pic_01_woman_head.png
