Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove liveportrait #393

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/workflows/ai-runner-live-pipelines-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pipeline: [streamdiffusion, comfyui, liveportrait]
pipeline: [streamdiffusion, comfyui]
steps:
- name: Check out code
uses: actions/[email protected]
Expand All @@ -98,9 +98,6 @@ jobs:
files_yaml: |
base_dockerfile:
- runner/docker/Dockerfile.live-base-${{ matrix.pipeline }}
liveportrait:
- runner/images/**
- runner/requirements-liveportrait.txt

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -120,11 +117,7 @@ jobs:
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
(
steps.changed-files.outputs.base_dockerfile_any_changed == 'true' ||
(
matrix.pipeline == 'liveportrait' &&
steps.changed-files.outputs.liveportrait_any_changed == 'true'
)
steps.changed-files.outputs.base_dockerfile_any_changed == 'true'
)
)
with:
Expand Down
114 changes: 0 additions & 114 deletions runner/app/live/pipelines/liveportrait.py

This file was deleted.

3 changes: 0 additions & 3 deletions runner/app/live/pipelines/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ def load_pipeline(name: str, **params) -> Pipeline:
if name == "streamdiffusion":
from .streamdiffusion import StreamDiffusion
return StreamDiffusion(**params)
elif name == "liveportrait":
from .liveportrait import LivePortrait
return LivePortrait(**params)
elif name == "comfyui":
from .comfyui import ComfyUI
return ComfyUI(**params)
Expand Down
6 changes: 1 addition & 5 deletions runner/app/live/streamer/streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,7 @@ async def monitor_loop(self):
continue

active_after_reload = time_since_last_output < (time_since_reload - 1)
stopped_recently = (
time_since_last_output > 8
if self.pipeline == "liveportrait" # liveportrait loads very quick but gets stuck too often
else active_after_reload and time_since_last_output > 5 and time_since_last_output < 60
)
stopped_recently = active_after_reload and time_since_last_output > 5 and time_since_last_output < 60
if stopped_recently or gone_stale:
logging.warning(
"No output received while inputs are being sent. Restarting process."
Expand Down
24 changes: 1 addition & 23 deletions runner/dl_checkpoints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ function download_all_models() {
function download_live_models() {
huggingface-cli download KBlueLeaf/kohaku-v2.1 --include "*.safetensors" "*.json" "*.txt" --exclude ".onnx" ".onnx_data" --cache-dir models
huggingface-cli download stabilityai/sd-turbo --include "*.safetensors" "*.json" "*.txt" --exclude ".onnx" ".onnx_data" --cache-dir models
huggingface-cli download warmshao/FasterLivePortrait --local-dir models/FasterLivePortrait--checkpoints
huggingface-cli download yuvraj108c/Depth-Anything-Onnx --include depth_anything_vitl14.onnx --local-dir models/ComfyUI--models/Depth-Anything-Onnx
download_sam2_checkpoints
download_florence2_checkpoints
Expand Down Expand Up @@ -145,27 +144,6 @@ function build_tensorrt_models() {
done
done"

# FasterLivePortrait
AI_RUNNER_LIVEPORTRAIT_IMAGE=${AI_RUNNER_LIVEPORTRAIT_IMAGE:-livepeer/ai-runner:live-app-liveportrait}
docker pull $AI_RUNNER_LIVEPORTRAIT_IMAGE
# ai-worker has tags hardcoded in `var livePipelineToImage` so we need to use the same tag in here:
docker image tag $AI_RUNNER_LIVEPORTRAIT_IMAGE livepeer/ai-runner:live-app-liveportrait
docker run --rm -v ./models:/models --gpus all -l TensorRT-engines \
$AI_RUNNER_LIVEPORTRAIT_IMAGE \
bash -c "cd /app/app/live/FasterLivePortrait && \
if [ ! -f '/models/FasterLivePortrait--checkpoints/liveportrait_onnx/stitching_lip.trt' ]; then
echo 'Building TensorRT engines for LivePortrait models (regular)...'
sh scripts/all_onnx2trt.sh
else
echo 'Regular LivePortrait TensorRT engines already exist, skipping build'
fi && \
if [ ! -f '/models/FasterLivePortrait--checkpoints/liveportrait_animal_onnx/stitching_lip.trt' ]; then
echo 'Building TensorRT engines for LivePortrait models (animal)...'
sh scripts/all_onnx2trt_animal.sh
else
echo 'Animal LivePortrait TensorRT engines already exist, skipping build'
fi"

# ComfyUI (only DepthAnything for now)
AI_RUNNER_COMFYUI_IMAGE=${AI_RUNNER_COMFYUI_IMAGE:-livepeer/ai-runner:live-app-comfyui}
docker pull $AI_RUNNER_COMFYUI_IMAGE
Expand Down Expand Up @@ -242,7 +220,7 @@ echo "Starting livepeer AI subnet model downloader..."
echo "Creating 'models' directory in the current working directory..."
mkdir -p models
mkdir -p models/checkpoints
mkdir -p models/StreamDiffusion--engines models/FasterLivePortrait--checkpoints models/ComfyUI--models models/ComfyUI--models/sam2--checkpoints models/ComfyUI--models/checkpoints
mkdir -p models/StreamDiffusion--engines models/ComfyUI--models models/ComfyUI--models/sam2--checkpoints models/ComfyUI--models/checkpoints

# Ensure 'huggingface-cli' is installed.
echo "Checking if 'huggingface-cli' is installed..."
Expand Down
67 changes: 0 additions & 67 deletions runner/docker/Dockerfile.live-base-liveportrait

This file was deleted.

13 changes: 0 additions & 13 deletions runner/requirements-liveportrait.txt

This file was deleted.

1 change: 0 additions & 1 deletion worker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ var pipelineToImage = map[string]string{

var livePipelineToImage = map[string]string{
"streamdiffusion": "livepeer/ai-runner:live-app-streamdiffusion",
"liveportrait": "livepeer/ai-runner:live-app-liveportrait",
"comfyui": "livepeer/ai-runner:live-app-comfyui",
"segment_anything_2": "livepeer/ai-runner:live-app-segment_anything_2",
"noop": "livepeer/ai-runner:live-app-noop",
Expand Down
Loading