From fd32f8f44254b5f5298487923f677ca1a8763ff1 Mon Sep 17 00:00:00 2001 From: Andy Bunce Date: Fri, 12 Dec 2025 15:13:55 +0000 Subject: [PATCH] [mod] sdnext --- sdnext/Dockerfile.ipex | 98 ------------------------------------------ sdnext/compose.yml | 27 ++++++++++++ sdnext/readme.md | 1 + 3 files changed, 28 insertions(+), 98 deletions(-) delete mode 100644 sdnext/Dockerfile.ipex create mode 100644 sdnext/compose.yml create mode 100644 sdnext/readme.md diff --git a/sdnext/Dockerfile.ipex b/sdnext/Dockerfile.ipex deleted file mode 100644 index 393a936..0000000 --- a/sdnext/Dockerfile.ipex +++ /dev/null @@ -1,98 +0,0 @@ -# SD.Next IPEX Dockerfile -# docs: - -# base image -FROM ubuntu:noble - -# metadata -LABEL org.opencontainers.image.vendor="SD.Next" -LABEL org.opencontainers.image.authors="disty0" -LABEL org.opencontainers.image.url="https://github.com/vladmandic/sdnext/" -LABEL org.opencontainers.image.documentation="https://github.com/vladmandic/sdnext/wiki/Docker" -LABEL org.opencontainers.image.source="https://github.com/vladmandic/sdnext/" -LABEL org.opencontainers.image.licenses="AGPL-3.0" -LABEL org.opencontainers.image.title="SD.Next IPEX" -LABEL org.opencontainers.image.description="SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models" -LABEL org.opencontainers.image.base.name="https://hub.docker.com/_/ubuntu:noble" -LABEL org.opencontainers.image.version="latest" - -# essentials -RUN apt-get update && \ - apt-get install -y --no-install-recommends --fix-missing \ - software-properties-common \ - build-essential \ - ca-certificates \ - wget \ - gpg \ - git - -# intel compute runtime -RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg -RUN echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu noble client" | tee /etc/apt/sources.list.d/intel-gpu-noble.list -RUN apt-get update - -RUN apt-get install -y --no-install-recommends --fix-missing \ - intel-opencl-icd \ - libze-intel-gpu1 \ - libze1 - -# required by pytorch / ipex -RUN apt-get install -y --no-install-recommends --fix-missing \ - libgl1 \ - libglib2.0-0 \ - libgomp1 - -# python3.12 -RUN apt-get install -y --no-install-recommends --fix-missing \ - python3 \ - python3-dev \ - python3-venv \ - python3-pip - -# jemalloc is not required but it is highly recommended (also used with optional ipexrun) -RUN apt-get install -y --no-install-recommends --fix-missing libjemalloc-dev -ENV LD_PRELOAD=libjemalloc.so.2 - -# cleanup -RUN /usr/sbin/ldconfig -RUN apt-get clean && rm -rf /var/lib/apt/lists/* - -# stop pip and uv from caching -ENV PIP_NO_CACHE_DIR=true -ENV UV_NO_CACHE=true - -# set paths to use with sdnext -ENV SD_DOCKER=true -ENV SD_DATADIR="/mnt/data" -ENV SD_MODELSDIR="/mnt/models" -ENV venv_dir="/mnt/python/venv" - -# paths used by sdnext can be a volume if necessary -#VOLUME [ "/app" ] -#VOLUME [ "/mnt/data" ] -#VOLUME [ "/mnt/models" ] -#VOLUME [ "/mnt/python" ] -#VOLUME [ "/root/.cache/huggingface" ] - -# intel specific environment variables -#ENV IPEX_SDPA_SLICE_TRIGGER_RATE=1 -#ENV IPEX_ATTENTION_SLICE_RATE=0.5 -#ENV IPEX_FORCE_ATTENTION_SLICE=-1 -#ENV IPEXRUN=False - -# git clone and run sdnext -RUN echo '#!/bin/bash\ngit status || git clone https://github.com/vladmandic/sdnext.git .\n/app/webui.sh "$@"' | tee /bin/startup.sh -RUN chmod 755 /bin/startup.sh - -# actually run sdnext -WORKDIR /app -ENTRYPOINT [ "startup.sh", "-f", "--use-ipex", "--uv", "--listen", "--debug", "--api-log", "--log", "sdnext.log" ] - -# expose port -EXPOSE 7860 - -# healthcheck function -# HEALTHCHECK --interval=60s --timeout=10s --start-period=60s --retries=3 CMD curl --fail http://localhost:7860/sdapi/v1/status || exit 1 - -# stop signal -STOPSIGNAL SIGINT diff --git a/sdnext/compose.yml b/sdnext/compose.yml new file mode 100644 index 0000000..5f34a88 --- /dev/null +++ b/sdnext/compose.yml @@ -0,0 +1,27 @@ +services: + sdnext-ipex: + image: liutyi/sdnext-ipex:master + container_name: sdnext-ipex + restart: unless-stopped + devices: + - /dev/dri:/dev/dri + #- /dev/accel:/dev/accel + environment: + #- https_proxy=http://proxy.example.com:3128/ + #- HF_TOKEN="" + #- HF_INFERENCE_ENDPOINT="https://api-inference.huggingface.co" + - HF_HUB_VERBOSITY="debug" + - HF_DEBUG=True + + ports: + - 7860:7860 + volumes: + - sdnext-app-volume:/app + - sdnext-mnt-volume:/mnt + - sdnext-huggingface-volume:/root/.cache/huggingface + - /dev/shm:/dev/shm +volumes: + sdnext-app-volume: {} + sdnext-mnt-volume: {} + sdnext-huggingface-volume: {} + diff --git a/sdnext/readme.md b/sdnext/readme.md new file mode 100644 index 0000000..5e8b516 --- /dev/null +++ b/sdnext/readme.md @@ -0,0 +1 @@ +https://hub.docker.com/r/liutyi/sdnext-ipex \ No newline at end of file