Download api comfyui/scripts/liveportrait.py from killbill007/comfyui: direct link, hf CLI and curl.
- Browser
- Download file 604 Bytes
-
https://huggingface.co/killbill007/comfyui/resolve/main/api%20comfyui/scripts/liveportrait.py
- Command line
-
hf download 'hf://killbill007/comfyui/api comfyui/scripts/liveportrait.py'
-
curl -L -o liveportrait.py https://huggingface.co/killbill007/comfyui/resolve/main/api%20comfyui/scripts/liveportrait.py
604 Bytes
| import websocket | |
| import uuid | |
| import json | |
| import urllib.request | |
| import urllib.parse | |
| import json | |
| class LP: | |
| def __init__(self , listen , port , work_path = './workflow/lp.json'): | |
| self.lp_workflow = json.loads(work_path) | |
| self.server_address = f'{listen}:{port}' | |
| def LP(self , image_path , video_path): | |
| client_id = str(uuid.uuid4()) | |
| return image_bgra | |
| def __del__(self): | |
| self.model = None | |
| self.processor = None | |
| del self.model | |
| del self.processor | |
| torch.cuda.empty_cache() | |
| import gc | |
| gc.collect() | |