diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..eb9c1fec --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +__pycache__/ +*.pyc +models/ +data/ +logs/ \ No newline at end of file diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml deleted file mode 100644 index ede8516e..00000000 --- a/.github/workflows/dev.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Development - -on: - workflow_dispatch: - push: - branches-ignore: - - main - -jobs: - dev: - runs-on: ubuntu-latest-l - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - run: pip install -r requirements.txt - - - name: Clear space to remove unused folders - run: | - rm -rf /usr/share/dotnet - rm -rf /opt/ghc - rm -rf "/usr/local/share/boost" - rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set environment variables - run: | - echo "DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}" >> $GITHUB_ENV - echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}" >> $GITHUB_ENV - echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV - echo "RELEASE_VERSION=${GITHUB_REF##refs/heads/}" | sed 's/\//-/g' >> $GITHUB_ENV - - - name: Build and push the images to Docker Hub - uses: docker/bake-action@v2 - with: - push: true - set: | - *.args.DOCKERHUB_REPO=${{ env.DOCKERHUB_REPO }} - *.args.DOCKERHUB_IMG=${{ env.DOCKERHUB_IMG }} - *.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }} - *.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }} diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 00000000..06a73f9b --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,39 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ docker-integration ] + +jobs: + docker: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "${{ vars.DOCKER_USER }}/test001" + install: true + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/runpod-worker-comfy:latest + platforms: linux/amd64 + build-args: | + MODEL_TYPE=sdxl + HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }} + outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 0a1dc2e2..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Release - -on: - workflow_dispatch: - push: - branches: - - "main" - -jobs: - release: - runs-on: ubuntu-latest-l - if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }} - permissions: - contents: write - issues: write - pull-requests: write - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - run: pip install -r requirements.txt - - - name: Clear space to remove unused folders - run: | - rm -rf /usr/share/dotnet - rm -rf /opt/ghc - rm -rf "/usr/local/share/boost" - rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Update the ToC in the README.md - run: npx markdown-toc README.md -i - - - name: Semantic release - uses: codfish/semantic-release-action@v3 - id: semanticrelease - with: - additional-packages: | - ['@semantic-release/git', '@semantic-release/changelog', '@semantic-release/exec'] - env: - GITHUB_TOKEN: ${{ secrets.BLIBLA_SEMANTIC_RELEASE }} - - - name: Set environment variables - if: steps.semanticrelease.outputs.new-release-published == 'true' - run: | - echo "DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}" >> $GITHUB_ENV - echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}" >> $GITHUB_ENV - echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV - echo "RELEASE_VERSION=${{ steps.semanticrelease.outputs.release-version }}" >> $GITHUB_ENV - - - name: Build and push the images to Docker Hub - if: steps.semanticrelease.outputs.new-release-published == 'true' - uses: docker/bake-action@v2 - with: - push: true - set: | - *.args.DOCKERHUB_REPO=${{ env.DOCKERHUB_REPO }} - *.args.DOCKERHUB_IMG=${{ env.DOCKERHUB_IMG }} - *.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }} - *.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }} - - - name: Update description on Docker Hub - if: steps.semanticrelease.outputs.new-release-published == 'true' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: ${{ env.DOCKERHUB_REPO }}/${{ env.DOCKERHUB_IMG }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index cba3c08c..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Tests - -on: - push: - branches: [main, dev] - pull_request: - types: [opened, synchronize] - branches: [main, dev] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - run: pip install -r requirements.txt - - - name: Run Python tests - run: python -m unittest discover - - - name: Run snapshot restoration tests - run: | - chmod +x tests/test_restore_snapshot.sh - ./tests/test_restore_snapshot.sh diff --git a/.gitignore b/.gitignore index 733b2f2c..cb0d9d41 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,9 @@ venv data models simulated_uploaded -__pycache__ \ No newline at end of file +__pycache__ +/.idea/php.xml +/.idea/runpod-worker-comfy.iml +/.idea/vcs.xml +/.idea/webResources.xml +/.idea/workspace.xml diff --git a/2024-11-28_17-01-59_snapsho.json b/2024-11-28_17-01-59_snapsho.json new file mode 100644 index 00000000..b1d99728 --- /dev/null +++ b/2024-11-28_17-01-59_snapsho.json @@ -0,0 +1,295 @@ +{ + "comfyui": "bf2650a80e5a7a888da206eab45c53dbb22940f7", + "git_custom_nodes": { + "https://github.com/ltdrdata/ComfyUI-Impact-Pack": { + "hash": "c9b3aecd1af14f39b2dd311f096a24dbea18d5aa", + "disabled": false + }, + "https://github.com/Stability-AI/stability-ComfyUI-nodes": { + "hash": "001154622564b17223ce0191803c5fff7b87146c", + "disabled": false + }, + "https://github.com/cubiq/ComfyUI_essentials": { + "hash": "5a4e5cd5750515d76f3a3363b7d2a0f362507796", + "disabled": false + }, + "https://github.com/vuongminh1907/ComfyUI_ZenID": { + "hash": "9590d4bf18289fe7927d56a18bf23041c03b7c98", + "disabled": false + }, + "https://github.com/cubiq/ComfyUI_InstantID": { + "hash": "1ef34ef573581bd9727c1e0ac05aa956b356a510", + "disabled": false + }, + "https://github.com/cubiq/ComfyUI_IPAdapter_plus": { + "hash": "b188a6cb39b512a9c6da7235b880af42c78ccd0d", + "disabled": false + }, + "https://github.com/theUpsider/ComfyUI-Logic": { + "hash": "42d4f3df45fb7f0dd6e2201a14c07d4dd09f235d", + "disabled": false + }, + "https://github.com/ltdrdata/ComfyUI-Manager.git": { + "hash": "05ecca1f4d36ca32d58186e1f2870dc757e165d2", + "disabled": false + } + }, + "file_custom_nodes": [ + { + "filename": "websocket_image_save.py", + "disabled": false + } + ], + "pips": { + "accelerate==0.33.0": "", + "aiohappyeyeballs==2.3.4": "", + "aiohttp==3.11.8": "", + "aiosignal==1.3.1": "", + "albucore==0.0.20": "", + "albumentations==1.4.21": "", + "annotated-types==0.7.0": "", + "anyio==4.4.0": "", + "argon2-cffi==23.1.0": "", + "argon2-cffi-bindings==21.2.0": "", + "arrow==1.3.0": "", + "asttokens==2.4.1": "", + "async-lru==2.0.4": "", + "attrs==23.2.0": "", + "Babel==2.15.0": "", + "beautifulsoup4==4.12.3": "", + "binaryornot==0.4.4": "", + "bleach==6.1.0": "", + "blinker==1.4": "", + "certifi==2024.7.4": "", + "cffi==1.16.0": "", + "chardet==5.2.0": "", + "charset-normalizer==3.3.2": "", + "click==8.1.7": "", + "color-matcher==0.5.0": "", + "coloredlogs==15.0.1": "", + "colour-science==0.4.6": "", + "comm==0.2.2": "", + "contourpy==1.3.1": "", + "cryptography==3.4.8": "", + "cycler==0.12.1": "", + "Cython==3.0.11": "", + "dbus-python==1.2.18": "", + "ddt==1.7.2": "", + "debugpy==1.8.2": "", + "decorator==5.1.1": "", + "defusedxml==0.7.1": "", + "Deprecated==1.2.14": "", + "dill==0.3.9": "", + "distro==1.7.0": "", + "docutils==0.21.2": "", + "easydict==1.13": "", + "einops==0.8.0": "", + "eval_type_backport==0.2.0": "", + "executing==2.0.1": "", + "fastapi==0.115.5": "", + "fastjsonschema==2.20.0": "", + "filelock==3.13.1": "", + "flatbuffers==24.3.25": "", + "flet-core==0.24.1": "", + "flet-runtime==0.24.1": "", + "fonttools==4.55.0": "", + "fqdn==1.5.1": "", + "frozenlist==1.4.1": "", + "fsspec==2024.2.0": "", + "gdown==5.2.0": "", + "gitdb==4.0.11": "", + "GitPython==3.1.43": "", + "gyp==0.1": "", + "h11==0.14.0": "", + "httpcore==1.0.5": "", + "httplib2==0.20.2": "", + "httptools==0.6.4": "", + "httpx==0.27.0": "", + "huggingface-hub==0.24.5": "", + "humanfriendly==10.0": "", + "idna==3.7": "", + "imageio==2.36.0": "", + "importlib-metadata==4.6.4": "", + "insightface==0.7.3": "", + "ipykernel==6.29.5": "", + "ipython==8.26.0": "", + "ipywidgets==8.1.3": "", + "isoduration==20.11.0": "", + "jedi==0.19.1": "", + "jeepney==0.7.1": "", + "Jinja2==3.1.3": "", + "joblib==1.4.2": "", + "json5==0.9.25": "", + "jsonpointer==3.0.0": "", + "jsonschema==4.23.0": "", + "jsonschema-specifications==2023.12.1": "", + "jupyter-events==0.10.0": "", + "jupyter-lsp==2.2.5": "", + "jupyter_client==8.6.2": "", + "jupyter_core==5.7.2": "", + "jupyter_server==2.14.2": "", + "jupyter_server_terminals==0.5.3": "", + "jupyterlab==4.2.4": "", + "jupyterlab_pygments==0.3.0": "", + "jupyterlab_server==2.27.3": "", + "jupyterlab_widgets==3.0.11": "", + "keyring==23.5.0": "", + "kiwisolver==1.4.7": "", + "kornia==0.7.3": "", + "kornia_rs==0.1.5": "", + "launchpadlib==1.10.16": "", + "lazr.restfulclient==0.14.4": "", + "lazr.uri==1.0.6": "", + "lazy_loader==0.4": "", + "llvmlite==0.43.0": "", + "markdown-it-py==3.0.0": "", + "MarkupSafe==2.1.5": "", + "matplotlib==3.9.2": "", + "matplotlib-inline==0.1.7": "", + "matrix-client==0.4.0": "", + "mdurl==0.1.2": "", + "mistune==3.0.2": "", + "more-itertools==8.10.0": "", + "mpmath==1.3.0": "", + "mss==10.0.0": "", + "multidict==6.0.5": "", + "nbclient==0.10.0": "", + "nbconvert==7.16.4": "", + "nbformat==5.10.4": "", + "nest-asyncio==1.6.0": "", + "networkx==3.2.1": "", + "notebook_shim==0.2.4": "", + "numba==0.60.0": "", + "numpy==1.26.3": "", + "nvidia-cublas-cu12==12.1.3.1": "", + "nvidia-cuda-cupti-cu12==12.1.105": "", + "nvidia-cuda-nvrtc-cu12==12.1.105": "", + "nvidia-cuda-runtime-cu12==12.1.105": "", + "nvidia-cudnn-cu12==9.1.0.70": "", + "nvidia-cufft-cu12==11.0.2.54": "", + "nvidia-curand-cu12==10.3.2.106": "", + "nvidia-cusolver-cu12==11.4.5.107": "", + "nvidia-cusparse-cu12==12.1.0.106": "", + "nvidia-nccl-cu12==2.20.5": "", + "nvidia-nvjitlink-cu12==12.1.105": "", + "nvidia-nvtx-cu12==12.1.105": "", + "oauthlib==3.2.2": "", + "OhMyRunPod==0.2.4": "", + "onnx==1.17.0": "", + "onnxruntime==1.20.1": "", + "onnxruntime-gpu==1.20.1": "", + "opencv-python==4.10.0.84": "", + "opencv-python-headless==4.10.0.84": "", + "overrides==7.7.0": "", + "packaging==23.2": "", + "pandas==2.2.3": "", + "pandocfilters==1.5.1": "", + "parso==0.8.4": "", + "pexpect==4.9.0": "", + "piexif==1.1.3": "", + "pillow==11.0.0": "", + "pixeloe==0.0.10": "", + "platformdirs==4.2.2": "", + "pooch==1.8.2": "", + "prettytable==3.12.0": "", + "prometheus_client==0.20.0": "", + "prompt_toolkit==3.0.47": "", + "propcache==0.2.0": "", + "protobuf==5.28.3": "", + "psutil==6.0.0": "", + "ptyprocess==0.7.0": "", + "pure_eval==0.2.3": "", + "py-cpuinfo==9.0.0": "", + "pycparser==2.22": "", + "pydantic==2.10.2": "", + "pydantic_core==2.27.1": "", + "PyGithub==2.3.0": "", + "Pygments==2.18.0": "", + "PyGObject==3.42.1": "", + "PyJWT==2.9.0": "", + "PyMatting==1.1.13": "", + "PyNaCl==1.5.0": "", + "pyparsing==2.4.7": "", + "pypng==0.20220715.0": "", + "PySocks==1.7.1": "", + "python-apt==2.4.0+ubuntu3": "", + "python-dateutil==2.9.0.post0": "", + "python-dotenv==1.0.1": "", + "python-json-logger==2.0.7": "", + "python-slugify==8.0.4": "", + "pytz==2024.2": "", + "PyYAML==6.0.1": "", + "pyzmq==26.0.3": "", + "qrcode==7.4.2": "", + "referencing==0.35.1": "", + "regex==2024.7.24": "", + "rembg==2.0.60": "", + "repath==0.9.0": "", + "requests==2.32.3": "", + "rfc3339-validator==0.1.4": "", + "rfc3986-validator==0.1.1": "", + "rich==13.7.1": "", + "rpds-py==0.19.1": "", + "safetensors==0.4.4": "", + "scikit-image==0.24.0": "", + "scikit-learn==1.5.2": "", + "scipy==1.14.0": "", + "seaborn==0.13.2": "", + "SecretStorage==3.3.1": "", + "segment-anything==1.0": "", + "Send2Trash==1.8.3": "", + "sentencepiece==0.2.0": "", + "shellingham==1.5.4": "", + "simsimd==6.2.1": "", + "six==1.16.0": "", + "smmap==5.0.1": "", + "sniffio==1.3.1": "", + "soundfile==0.12.1": "", + "soupsieve==2.5": "", + "spandrel==0.3.4": "", + "stack-data==0.6.3": "", + "starlette==0.41.3": "", + "stringzilla==3.10.10": "", + "sympy==1.12": "", + "terminado==0.18.1": "", + "text-unidecode==1.3": "", + "threadpoolctl==3.5.0": "", + "tifffile==2024.9.20": "", + "tinycss2==1.3.0": "", + "tokenizers==0.19.1": "", + "torch==2.4.0+cu121": "", + "torchaudio==2.4.0+cu121": "", + "torchsde==0.2.6": "", + "torchvision==0.19.0+cu121": "", + "tornado==6.4.1": "", + "tqdm==4.66.4": "", + "traitlets==5.14.3": "", + "trampoline==0.1.2": "", + "transformers==4.43.4": "", + "triton==3.0.0": "", + "typer==0.12.3": "", + "types-python-dateutil==2.9.0.20240316": "", + "typing_extensions==4.12.2": "", + "tzdata==2024.2": "", + "ultralytics==8.0.176": "", + "ultralytics-thop==2.0.12": "", + "uri-template==1.3.0": "", + "urllib3==1.26.19": "", + "uvicorn==0.32.1": "", + "uvloop==0.21.0": "", + "wadllib==1.3.6": "", + "watchdog==4.0.2": "", + "watchfiles==1.0.0": "", + "wcwidth==0.2.13": "", + "webcolors==24.6.0": "", + "webencodings==0.5.1": "", + "websocket-client==1.8.0": "", + "websockets==14.1": "", + "wget==3.2": "", + "widgetsnbextension==4.0.11": "", + "wrapt==1.16.0": "", + "xformers==0.0.27.post2": "", + "yarl==1.18.0": "", + "zipp==1.0.0": "" + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b13a7008..8a7a4976 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,34 @@ # Stage 1: Base image with common dependencies -FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as base - +#no snapFROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as base +FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 AS base # Prevents prompts from packages asking for user input during installation ENV DEBIAN_FRONTEND=noninteractive # Prefer binary wheels over source distributions for faster pip installations ENV PIP_PREFER_BINARY=1 # Ensures output from python is printed immediately to the terminal without buffering -ENV PYTHONUNBUFFERED=1 +ENV PYTHONUNBUFFERED=1 # Speed up some cmake builds ENV CMAKE_BUILD_PARALLEL_LEVEL=8 # Install Python, git and other necessary tools -RUN apt-get update && apt-get install -y \ +#RUN apt-get update && apt-get install -y \# + ## python3.10 \ + # python3-pip \ + # git \ + # wget \ + # libgl1 \ + # && ln -sf /usr/bin/python3.10 /usr/bin/python \ + # && ln -sf /usr/bin/pip3 /usr/bin/pip + + RUN apt-get update && apt-get install -y --no-install-recommends \ python3.10 \ python3-pip \ git \ wget \ libgl1 \ && ln -sf /usr/bin/python3.10 /usr/bin/python \ - && ln -sf /usr/bin/pip3 /usr/bin/pip + && ln -sf /usr/bin/pip3 /usr/bin/pip \ + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Clean up to reduce image size RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* @@ -48,6 +58,25 @@ RUN chmod +x /start.sh /restore_snapshot.sh # Optionally copy the snapshot file ADD *snapshot*.json / +# EDIT Copier les modèles téléchargés dans l'image Docker +# Avant l'exécution de restore_snapshot.sh // Idealement il faut qu'on stocke quelque part sur S3 les models nécessaires aux custom nodes? +#RUN mkdir -p /comfyui/models/sams/ +#RUN wget -O /comfyui/models/sams/sam_vit_b_01ec64.pth "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth" + + +# Créer les répertoires nécessaires +#RUN mkdir -p /comfyui/models/ultralytics/bbox/ +#RUN mkdir -p /comfyui/models/ultralytics/segm/ + +# Télécharger le modèle de détection des visages +#RUN wget -O /comfyui/models/ultralytics/bbox/face_yolov8m.pt "https://huggingface.co/xingren23/comfyflow-models/resolve/976de8449674de379b02c144d0b3cfa2b61482f2/ultralytics/bbox/face_yolov8m.pt" + +# Télécharger le modèle de détection des mains +#RUN wget -O /comfyui/models/ultralytics/bbox/hand_yolov8s.pt "https://huggingface.co/xingren23/comfyflow-models/resolve/976de8449674de379b02c144d0b3cfa2b61482f2/ultralytics/bbox/hand_yolov8s.pt" + +# Télécharger le modèle de segmentation des personnes +#RUN wget -O /comfyui/models/ultralytics/segm/person_yolov8m-seg.pt "https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-seg.pt" + # Restore the snapshot to install custom nodes RUN /restore_snapshot.sh @@ -55,7 +84,7 @@ 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 @@ -64,32 +93,35 @@ ARG MODEL_TYPE WORKDIR /comfyui # Create necessary directories -RUN mkdir -p models/checkpoints models/vae +#RUN mkdir -p models/checkpoints models/vae + +# Download checkpoints/sd_xl_base_1.0.safetensors +#RUN 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 # Download checkpoints/vae/LoRA 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 && \ - wget -O models/vae/sdxl-vae-fp16-fix.safetensors https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/resolve/main/sdxl_vae.safetensors; \ - elif [ "$MODEL_TYPE" = "sd3" ]; then \ - wget --header="Authorization: Bearer ${HUGGINGFACE_ACCESS_TOKEN}" -O models/checkpoints/sd3_medium_incl_clips_t5xxlfp8.safetensors https://huggingface.co/stabilityai/stable-diffusion-3-medium/resolve/main/sd3_medium_incl_clips_t5xxlfp8.safetensors; \ - elif [ "$MODEL_TYPE" = "flux1-schnell" ]; then \ - wget -O models/unet/flux1-schnell.safetensors https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/flux1-schnell.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 -O models/vae/ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors; \ - elif [ "$MODEL_TYPE" = "flux1-dev" ]; then \ - 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; \ - fi +#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 && \ +# wget -O models/vae/sdxl-vae-fp16-fix.safetensors https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/resolve/main/sdxl_vae.safetensors; \ +# elif [ "$MODEL_TYPE" = "sd3" ]; then \ +# wget --header="Authorization: Bearer ${HUGGINGFACE_ACCESS_TOKEN}" -O models/checkpoints/sd3_medium_incl_clips_t5xxlfp8.safetensors https://huggingface.co/stabilityai/stable-diffusion-3-medium/resolve/main/sd3_medium_incl_clips_t5xxlfp8.safetensors; \ +# elif [ "$MODEL_TYPE" = "flux1-schnell" ]; then \ +# wget -O models/unet/flux1-schnell.safetensors https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/flux1-schnell.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 -O models/vae/ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors; \ +# elif [ "$MODEL_TYPE" = "flux1-dev" ]; then \ +# 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; \ +# 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 +#COPY --from=downloader /comfyui/models /comfyui/models # Start container -CMD ["/start.sh"] \ No newline at end of file +CMD ["/start.sh"] diff --git a/simple2024-11-28_17-01-59_snapsh.json b/simple2024-11-28_17-01-59_snapsh.json new file mode 100644 index 00000000..34775794 --- /dev/null +++ b/simple2024-11-28_17-01-59_snapsh.json @@ -0,0 +1,267 @@ +{ + "comfyui": "bf2650a80e5a7a888da206eab45c53dbb22940f7", + "git_custom_nodes": { + "https://github.com/theUpsider/ComfyUI-Logic": { + "hash": "42d4f3df45fb7f0dd6e2201a14c07d4dd09f235d", + "disabled": false + } + }, + "file_custom_nodes": [ + { + "filename": "websocket_image_save.py", + "disabled": false + } + ], + "pips": { + "accelerate==0.33.0": "", + "aiohappyeyeballs==2.3.4": "", + "aiohttp==3.11.8": "", + "aiosignal==1.3.1": "", + "albucore==0.0.20": "", + "albumentations==1.4.21": "", + "annotated-types==0.7.0": "", + "anyio==4.4.0": "", + "argon2-cffi==23.1.0": "", + "argon2-cffi-bindings==21.2.0": "", + "arrow==1.3.0": "", + "asttokens==2.4.1": "", + "async-lru==2.0.4": "", + "attrs==23.2.0": "", + "Babel==2.15.0": "", + "beautifulsoup4==4.12.3": "", + "binaryornot==0.4.4": "", + "bleach==6.1.0": "", + "blinker==1.4": "", + "certifi==2024.7.4": "", + "cffi==1.16.0": "", + "chardet==5.2.0": "", + "charset-normalizer==3.3.2": "", + "click==8.1.7": "", + "color-matcher==0.5.0": "", + "coloredlogs==15.0.1": "", + "colour-science==0.4.6": "", + "comm==0.2.2": "", + "contourpy==1.3.1": "", + "cryptography==3.4.8": "", + "cycler==0.12.1": "", + "Cython==3.0.11": "", + "dbus-python==1.2.18": "", + "ddt==1.7.2": "", + "debugpy==1.8.2": "", + "decorator==5.1.1": "", + "defusedxml==0.7.1": "", + "Deprecated==1.2.14": "", + "dill==0.3.9": "", + "distro==1.7.0": "", + "docutils==0.21.2": "", + "easydict==1.13": "", + "einops==0.8.0": "", + "eval_type_backport==0.2.0": "", + "executing==2.0.1": "", + "fastapi==0.115.5": "", + "fastjsonschema==2.20.0": "", + "filelock==3.13.1": "", + "flatbuffers==24.3.25": "", + "flet-core==0.24.1": "", + "flet-runtime==0.24.1": "", + "fonttools==4.55.0": "", + "fqdn==1.5.1": "", + "frozenlist==1.4.1": "", + "fsspec==2024.2.0": "", + "gdown==5.2.0": "", + "gitdb==4.0.11": "", + "GitPython==3.1.43": "", + "gyp==0.1": "", + "h11==0.14.0": "", + "httpcore==1.0.5": "", + "httplib2==0.20.2": "", + "httptools==0.6.4": "", + "httpx==0.27.0": "", + "huggingface-hub==0.24.5": "", + "humanfriendly==10.0": "", + "idna==3.7": "", + "imageio==2.36.0": "", + "importlib-metadata==4.6.4": "", + "insightface==0.7.3": "", + "ipykernel==6.29.5": "", + "ipython==8.26.0": "", + "ipywidgets==8.1.3": "", + "isoduration==20.11.0": "", + "jedi==0.19.1": "", + "jeepney==0.7.1": "", + "Jinja2==3.1.3": "", + "joblib==1.4.2": "", + "json5==0.9.25": "", + "jsonpointer==3.0.0": "", + "jsonschema==4.23.0": "", + "jsonschema-specifications==2023.12.1": "", + "jupyter-events==0.10.0": "", + "jupyter-lsp==2.2.5": "", + "jupyter_client==8.6.2": "", + "jupyter_core==5.7.2": "", + "jupyter_server==2.14.2": "", + "jupyter_server_terminals==0.5.3": "", + "jupyterlab==4.2.4": "", + "jupyterlab_pygments==0.3.0": "", + "jupyterlab_server==2.27.3": "", + "jupyterlab_widgets==3.0.11": "", + "keyring==23.5.0": "", + "kiwisolver==1.4.7": "", + "kornia==0.7.3": "", + "kornia_rs==0.1.5": "", + "launchpadlib==1.10.16": "", + "lazr.restfulclient==0.14.4": "", + "lazr.uri==1.0.6": "", + "lazy_loader==0.4": "", + "llvmlite==0.43.0": "", + "markdown-it-py==3.0.0": "", + "MarkupSafe==2.1.5": "", + "matplotlib==3.9.2": "", + "matplotlib-inline==0.1.7": "", + "matrix-client==0.4.0": "", + "mdurl==0.1.2": "", + "mistune==3.0.2": "", + "more-itertools==8.10.0": "", + "mpmath==1.3.0": "", + "mss==10.0.0": "", + "multidict==6.0.5": "", + "nbclient==0.10.0": "", + "nbconvert==7.16.4": "", + "nbformat==5.10.4": "", + "nest-asyncio==1.6.0": "", + "networkx==3.2.1": "", + "notebook_shim==0.2.4": "", + "numba==0.60.0": "", + "numpy==1.26.3": "", + "nvidia-cublas-cu12==12.1.3.1": "", + "nvidia-cuda-cupti-cu12==12.1.105": "", + "nvidia-cuda-nvrtc-cu12==12.1.105": "", + "nvidia-cuda-runtime-cu12==12.1.105": "", + "nvidia-cudnn-cu12==9.1.0.70": "", + "nvidia-cufft-cu12==11.0.2.54": "", + "nvidia-curand-cu12==10.3.2.106": "", + "nvidia-cusolver-cu12==11.4.5.107": "", + "nvidia-cusparse-cu12==12.1.0.106": "", + "nvidia-nccl-cu12==2.20.5": "", + "nvidia-nvjitlink-cu12==12.1.105": "", + "nvidia-nvtx-cu12==12.1.105": "", + "oauthlib==3.2.2": "", + "OhMyRunPod==0.2.4": "", + "onnx==1.17.0": "", + "onnxruntime==1.20.1": "", + "onnxruntime-gpu==1.20.1": "", + "opencv-python==4.10.0.84": "", + "opencv-python-headless==4.10.0.84": "", + "overrides==7.7.0": "", + "packaging==23.2": "", + "pandas==2.2.3": "", + "pandocfilters==1.5.1": "", + "parso==0.8.4": "", + "pexpect==4.9.0": "", + "piexif==1.1.3": "", + "pillow==11.0.0": "", + "pixeloe==0.0.10": "", + "platformdirs==4.2.2": "", + "pooch==1.8.2": "", + "prettytable==3.12.0": "", + "prometheus_client==0.20.0": "", + "prompt_toolkit==3.0.47": "", + "propcache==0.2.0": "", + "protobuf==5.28.3": "", + "psutil==6.0.0": "", + "ptyprocess==0.7.0": "", + "pure_eval==0.2.3": "", + "py-cpuinfo==9.0.0": "", + "pycparser==2.22": "", + "pydantic==2.10.2": "", + "pydantic_core==2.27.1": "", + "PyGithub==2.3.0": "", + "Pygments==2.18.0": "", + "PyGObject==3.42.1": "", + "PyJWT==2.9.0": "", + "PyMatting==1.1.13": "", + "PyNaCl==1.5.0": "", + "pyparsing==2.4.7": "", + "pypng==0.20220715.0": "", + "PySocks==1.7.1": "", + "python-apt==2.4.0+ubuntu3": "", + "python-dateutil==2.9.0.post0": "", + "python-dotenv==1.0.1": "", + "python-json-logger==2.0.7": "", + "python-slugify==8.0.4": "", + "pytz==2024.2": "", + "PyYAML==6.0.1": "", + "pyzmq==26.0.3": "", + "qrcode==7.4.2": "", + "referencing==0.35.1": "", + "regex==2024.7.24": "", + "rembg==2.0.60": "", + "repath==0.9.0": "", + "requests==2.32.3": "", + "rfc3339-validator==0.1.4": "", + "rfc3986-validator==0.1.1": "", + "rich==13.7.1": "", + "rpds-py==0.19.1": "", + "safetensors==0.4.4": "", + "scikit-image==0.24.0": "", + "scikit-learn==1.5.2": "", + "scipy==1.14.0": "", + "seaborn==0.13.2": "", + "SecretStorage==3.3.1": "", + "segment-anything==1.0": "", + "Send2Trash==1.8.3": "", + "sentencepiece==0.2.0": "", + "shellingham==1.5.4": "", + "simsimd==6.2.1": "", + "six==1.16.0": "", + "smmap==5.0.1": "", + "sniffio==1.3.1": "", + "soundfile==0.12.1": "", + "soupsieve==2.5": "", + "spandrel==0.3.4": "", + "stack-data==0.6.3": "", + "starlette==0.41.3": "", + "stringzilla==3.10.10": "", + "sympy==1.12": "", + "terminado==0.18.1": "", + "text-unidecode==1.3": "", + "threadpoolctl==3.5.0": "", + "tifffile==2024.9.20": "", + "tinycss2==1.3.0": "", + "tokenizers==0.19.1": "", + "torch==2.4.0+cu121": "", + "torchaudio==2.4.0+cu121": "", + "torchsde==0.2.6": "", + "torchvision==0.19.0+cu121": "", + "tornado==6.4.1": "", + "tqdm==4.66.4": "", + "traitlets==5.14.3": "", + "trampoline==0.1.2": "", + "transformers==4.43.4": "", + "triton==3.0.0": "", + "typer==0.12.3": "", + "types-python-dateutil==2.9.0.20240316": "", + "typing_extensions==4.12.2": "", + "tzdata==2024.2": "", + "ultralytics==8.0.176": "", + "ultralytics-thop==2.0.12": "", + "uri-template==1.3.0": "", + "urllib3==1.26.19": "", + "uvicorn==0.32.1": "", + "uvloop==0.21.0": "", + "wadllib==1.3.6": "", + "watchdog==4.0.2": "", + "watchfiles==1.0.0": "", + "wcwidth==0.2.13": "", + "webcolors==24.6.0": "", + "webencodings==0.5.1": "", + "websocket-client==1.8.0": "", + "websockets==14.1": "", + "wget==3.2": "", + "widgetsnbextension==4.0.11": "", + "wrapt==1.16.0": "", + "xformers==0.0.27.post2": "", + "yarl==1.18.0": "", + "zipp==1.0.0": "" + } +} \ No newline at end of file diff --git a/src/extra_model_paths.yaml b/src/extra_model_paths.yaml index 676f615b..730707a5 100644 --- a/src/extra_model_paths.yaml +++ b/src/extra_model_paths.yaml @@ -1,5 +1,5 @@ runpod_worker_comfy: - base_path: /runpod-volume + base_path: /runpod-volume/ComfyUI/ checkpoints: models/checkpoints/ clip: models/clip/ clip_vision: models/clip_vision/ @@ -10,3 +10,12 @@ runpod_worker_comfy: upscale_models: models/upscale_models/ vae: models/vae/ unet: models/unet/ + ipadapter: models/ipadapter/ + insighface: models/insighface/ + instantid: models/instantid/ + style_models: style_models/ + ultralytics: models/ultralytics/ + + + +