Skip to content

feat: cleanup comfyui to move from blibla to runpod #115

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

Merged
merged 7 commits into from
Apr 25, 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
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement

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

All community leaders are obligated to respect the privacy and security of the
Expand Down
14 changes: 0 additions & 14 deletions .github/FUNDING.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Development

on:
workflow_dispatch:
push:
branches-ignore:
- main
# push:
# branches-ignore:
# - main

jobs:
dev:
runs-on: ubuntu-latest-l
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Release

on:
workflow_dispatch:
push:
branches:
- "main"
# push:
# branches:
# - "main"

jobs:
release:
runs-on: ubuntu-latest-l
runs-on: [self-hosted, linux]
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
permissions:
contents: write
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
additional-packages: |
['@semantic-release/git', '@semantic-release/changelog', '@semantic-release/exec']
env:
GITHUB_TOKEN: ${{ secrets.BLIBLA_SEMANTIC_RELEASE }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

- name: Set environment variables
if: steps.semanticrelease.outputs.new-release-published == 'true'
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Tests

on:
push:
branches: [main, dev]
pull_request:
types: [opened, synchronize]
branches: [main, dev]
workflow_dispatch:
# push:
# branches: [main, dev]
# pull_request:
# types: [opened, synchronize]
# branches: [main, dev]

jobs:
test:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux]

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[
"@semantic-release/exec",
{
"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"
"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"
}
],
[
Expand Down
35 changes: 0 additions & 35 deletions .runpod/hub.json

This file was deleted.

39 changes: 24 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Base image with common dependencies
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as base
FROM nvidia/cuda:12.6.3-cudnn-runtime-ubuntu22.04 AS base

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

# Install Python, git and other necessary tools
RUN apt-get update && apt-get install -y \
python3.10 \
python3.11 \
python3-pip \
git \
wget \
libgl1 \
&& ln -sf /usr/bin/python3.10 /usr/bin/python \
&& ln -sf /usr/bin/python3.11 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip

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

# Install uv
RUN pip install uv

# Install comfy-cli
RUN pip install comfy-cli
RUN uv pip install comfy-cli --system

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

# Change working directory to ComfyUI
WORKDIR /comfyui

# Install runpod
RUN pip install runpod requests

# Support for the network volume
ADD src/extra_model_paths.yaml ./

# Go back to the root
WORKDIR /

# Add scripts
# install dependencies
RUN uv pip install runpod requests --system


# Add files
ADD src/start.sh src/restore_snapshot.sh src/rp_handler.py test_input.json ./
RUN chmod +x /start.sh /restore_snapshot.sh

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

# Stage 2: Download models
FROM base as downloader
FROM base AS downloader

ARG HUGGINGFACE_ACCESS_TOKEN
ARG MODEL_TYPE
# Set default model type if none is provided
ARG MODEL_TYPE=flux1-dev-fp8

# Change working directory to ComfyUI
WORKDIR /comfyui

# Create necessary directories
RUN mkdir -p models/checkpoints models/vae
# Create necessary directories upfront
RUN mkdir -p models/checkpoints models/vae models/unet models/clip

# Download checkpoints/vae/LoRA to include in image based on model type
# Download checkpoints/vae/unet/clip models to include in image based on model type
RUN if [ "$MODEL_TYPE" = "sdxl" ]; then \
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 && \
wget -O models/vae/sdxl_vae.safetensors https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors && \
Expand All @@ -79,14 +84,18 @@ RUN if [ "$MODEL_TYPE" = "sdxl" ]; then \
wget -O models/clip/t5xxl_fp8_e4m3fn.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors && \
wget -O models/vae/ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors; \
elif [ "$MODEL_TYPE" = "flux1-dev" ]; then \
# Full precision FLUX.1 dev
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 && \
wget -O models/clip/clip_l.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors && \
wget -O models/clip/t5xxl_fp8_e4m3fn.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors && \
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; \
elif [ "$MODEL_TYPE" = "flux1-dev-fp8" ]; then \
# Default model if none specified during build
wget -O models/checkpoints/flux1-dev-fp8.safetensors https://huggingface.co/Comfy-Org/flux1-dev/resolve/main/flux1-dev-fp8.safetensors; \
fi

# Stage 3: Final image
FROM base as final
FROM base AS final

# Copy models from stage 2 to the final image
COPY --from=downloader /comfyui/models /comfyui/models
Expand Down
Loading