Skip to content

Commit b424b22

Browse files
authored
feat: cleanup comfyui to move from blibla to runpod (#115)
* ci: test self-hosted runner * ci: check the size of the runner * ci: check the size of the docker cache * refactor: renamed "runpod-worker-comfy" to "worker-comfyui" * chore: this was just an example, we add a new one later * feat: use flux.1-dev-fp8 as default model; added conventions; improved start * chore: deactivated workflows as the runner can't be used currently
1 parent efb745a commit b424b22

16 files changed

+160
-157
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ representative at an online or offline event.
5959
## Enforcement
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62-
reported to the community leaders responsible for enforcement at Blibla.
62+
reported to the community leaders responsible for enforcement at RunPod.
6363
All complaints will be reviewed and investigated promptly and fairly.
6464

6565
All community leaders are obligated to respect the privacy and security of the

.github/FUNDING.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/dev.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Development
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches-ignore:
7-
- main
5+
# push:
6+
# branches-ignore:
7+
# - main
88

99
jobs:
1010
dev:
11-
runs-on: ubuntu-latest-l
11+
runs-on: [self-hosted, linux]
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Release
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- "main"
5+
# push:
6+
# branches:
7+
# - "main"
88

99
jobs:
1010
release:
11-
runs-on: ubuntu-latest-l
11+
runs-on: [self-hosted, linux]
1212
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
1313
permissions:
1414
contents: write
@@ -58,7 +58,7 @@ jobs:
5858
additional-packages: |
5959
['@semantic-release/git', '@semantic-release/changelog', '@semantic-release/exec']
6060
env:
61-
GITHUB_TOKEN: ${{ secrets.BLIBLA_SEMANTIC_RELEASE }}
61+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
6262

6363
- name: Set environment variables
6464
if: steps.semanticrelease.outputs.new-release-published == 'true'

.github/workflows/test.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
name: Tests
22

33
on:
4-
push:
5-
branches: [main, dev]
6-
pull_request:
7-
types: [opened, synchronize]
8-
branches: [main, dev]
4+
workflow_dispatch:
5+
# push:
6+
# branches: [main, dev]
7+
# pull_request:
8+
# types: [opened, synchronize]
9+
# branches: [main, dev]
910

1011
jobs:
1112
test:
12-
runs-on: ubuntu-latest
13+
runs-on: [self-hosted, linux]
1314

1415
steps:
1516
- name: Checkout

.releaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[
1616
"@semantic-release/exec",
1717
{
18-
"prepareCmd": "sed -i \"s/timpietruskyblibla\\/runpod-worker-comfy:[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*/timpietruskyblibla\\/runpod-worker-comfy:${nextRelease.version}/g\" README.md"
18+
"prepareCmd": "sed -i \"s/runpod\\/worker-comfyui:[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*/runpod\\/worker-comfyui:${nextRelease.version}/g\" README.md"
1919
}
2020
],
2121
[

.runpod/hub.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

Dockerfile

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Base image with common dependencies
2-
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as base
2+
FROM nvidia/cuda:12.6.3-cudnn-runtime-ubuntu22.04 AS base
33

44
# Prevents prompts from packages asking for user input during installation
55
ENV DEBIAN_FRONTEND=noninteractive
@@ -12,36 +12,40 @@ ENV CMAKE_BUILD_PARALLEL_LEVEL=8
1212

1313
# Install Python, git and other necessary tools
1414
RUN apt-get update && apt-get install -y \
15-
python3.10 \
15+
python3.11 \
1616
python3-pip \
1717
git \
1818
wget \
1919
libgl1 \
20-
&& ln -sf /usr/bin/python3.10 /usr/bin/python \
20+
&& ln -sf /usr/bin/python3.11 /usr/bin/python \
2121
&& ln -sf /usr/bin/pip3 /usr/bin/pip
2222

2323
# Clean up to reduce image size
2424
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
2525

26+
# Install uv
27+
RUN pip install uv
28+
2629
# Install comfy-cli
27-
RUN pip install comfy-cli
30+
RUN uv pip install comfy-cli --system
2831

2932
# Install ComfyUI
30-
RUN /usr/bin/yes | comfy --workspace /comfyui install --cuda-version 11.8 --nvidia --version 0.3.26
33+
RUN /usr/bin/yes | comfy --workspace /comfyui install --version 0.3.29 --cuda-version 12.6 --nvidia --skip-manager
3134

3235
# Change working directory to ComfyUI
3336
WORKDIR /comfyui
3437

35-
# Install runpod
36-
RUN pip install runpod requests
37-
3838
# Support for the network volume
3939
ADD src/extra_model_paths.yaml ./
4040

4141
# Go back to the root
4242
WORKDIR /
4343

44-
# Add scripts
44+
# install dependencies
45+
RUN uv pip install runpod requests --system
46+
47+
48+
# Add files
4549
ADD src/start.sh src/restore_snapshot.sh src/rp_handler.py test_input.json ./
4650
RUN chmod +x /start.sh /restore_snapshot.sh
4751

@@ -55,18 +59,19 @@ RUN /restore_snapshot.sh
5559
CMD ["/start.sh"]
5660

5761
# Stage 2: Download models
58-
FROM base as downloader
62+
FROM base AS downloader
5963

6064
ARG HUGGINGFACE_ACCESS_TOKEN
61-
ARG MODEL_TYPE
65+
# Set default model type if none is provided
66+
ARG MODEL_TYPE=flux1-dev-fp8
6267

6368
# Change working directory to ComfyUI
6469
WORKDIR /comfyui
6570

66-
# Create necessary directories
67-
RUN mkdir -p models/checkpoints models/vae
71+
# Create necessary directories upfront
72+
RUN mkdir -p models/checkpoints models/vae models/unet models/clip
6873

69-
# Download checkpoints/vae/LoRA to include in image based on model type
74+
# Download checkpoints/vae/unet/clip models to include in image based on model type
7075
RUN if [ "$MODEL_TYPE" = "sdxl" ]; then \
7176
wget -O models/checkpoints/sd_xl_base_1.0.safetensors https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors && \
7277
wget -O models/vae/sdxl_vae.safetensors https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors && \
@@ -79,14 +84,18 @@ RUN if [ "$MODEL_TYPE" = "sdxl" ]; then \
7984
wget -O models/clip/t5xxl_fp8_e4m3fn.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors && \
8085
wget -O models/vae/ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors; \
8186
elif [ "$MODEL_TYPE" = "flux1-dev" ]; then \
87+
# Full precision FLUX.1 dev
8288
wget --header="Authorization: Bearer ${HUGGINGFACE_ACCESS_TOKEN}" -O models/unet/flux1-dev.safetensors https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors && \
8389
wget -O models/clip/clip_l.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors && \
8490
wget -O models/clip/t5xxl_fp8_e4m3fn.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors && \
8591
wget --header="Authorization: Bearer ${HUGGINGFACE_ACCESS_TOKEN}" -O models/vae/ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors; \
92+
elif [ "$MODEL_TYPE" = "flux1-dev-fp8" ]; then \
93+
# Default model if none specified during build
94+
wget -O models/checkpoints/flux1-dev-fp8.safetensors https://huggingface.co/Comfy-Org/flux1-dev/resolve/main/flux1-dev-fp8.safetensors; \
8695
fi
8796

8897
# Stage 3: Final image
89-
FROM base as final
98+
FROM base AS final
9099

91100
# Copy models from stage 2 to the final image
92101
COPY --from=downloader /comfyui/models /comfyui/models

0 commit comments

Comments
 (0)