mirror of
				https://github.com/AbdBarho/stable-diffusion-webui-docker.git
				synced 2025-10-31 02:03:32 -04:00 
			
		
		
		
	Update, more ComfyUI Dockerfile features & bugfix
- Update base image to pytorch 2.3.1
    - Fix missing comment line escape
    - Support [krita-ai-diffusion](https://github.com/Acly/krita-ai-diffusion/wiki/ComfyUI-Setup) (`USE_KRITA=true`)
      This enables the following custom nodes (including comfyui_controlnet_aux):
      * **ComfyUI_IPAdapter_plus** (`USE_IPAPLUS=true`)
      * **comfyui-inpaint-nodes** (`USE_INPAINT=true`)
      * **comfyui-tooling-nodes** (`USE_TOOLING=true`)
			
			
This commit is contained in:
		| @@ -1,29 +1,30 @@ | |||||||
|  | FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime | ||||||
|  |  | ||||||
| # Limited system user UID | # Limited system user UID | ||||||
| ARG USE_UID=991 | ARG USE_UID=991 | ||||||
| # Limited system user GID | # Limited system user GID | ||||||
| ARG USE_GID=991 | ARG USE_GID=991 | ||||||
| # Latest tag or bleeding edge commit | # Latest tag or bleeding edge commit | ||||||
| ARG USE_EDGE=false | ARG USE_EDGE=false | ||||||
| # ComfyUI-GGUF support | # ComfyUI-GGUF | ||||||
| ARG USE_GGUF=false | ARG USE_GGUF=false | ||||||
| # x-flux-comfyui support | # x-flux-comfyui | ||||||
| ARG USE_XFLUX=false | ARG USE_XFLUX=false | ||||||
| # comfyui_controlnet_aux support | # comfyui_controlnet_aux | ||||||
| ARG USE_CNAUX=false | ARG USE_CNAUX=false | ||||||
|  | # krita-ai-diffusion | ||||||
| FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime | ARG USE_KRITA=false | ||||||
|  | # ComfyUI_IPAdapter_plus | ||||||
| # Use args | ARG USE_IPAPLUS=false | ||||||
| ARG USE_UID | # comfyui-inpaint-nodes | ||||||
| ARG USE_GID | ARG USE_INPAINT=false | ||||||
| ARG USE_EDGE | # comfyui-tooling-nodes | ||||||
| ARG USE_GGUF | ARG USE_TOOLING=false | ||||||
| ARG USE_XFLUX |  | ||||||
| ARG USE_CNAUX |  | ||||||
|  |  | ||||||
| ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 USE_EDGE=$USE_EDGE | ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 USE_EDGE=$USE_EDGE | ||||||
| ENV USE_GGUF=$USE_GGUF USE_XFLUX=$USE_XFLUX ROOT=/stable-diffusion | ENV USE_GGUF=$USE_GGUF USE_XFLUX=$USE_XFLUX ROOT=/stable-diffusion | ||||||
| ENV CACHE=/home/app/.cache USE_CNAUX=$USE_CNAUX | ENV CACHE=/home/app/.cache USE_CNAUX=$USE_CNAUX USE_KRITA=$USE_KRITA | ||||||
|  | ENV USE_IPAPLUS=$USE_IPAPLUS USE_INPAINT=$USE_INPAINT USE_TOOLING=$USE_TOOLING | ||||||
|  |  | ||||||
| # User/Group | # User/Group | ||||||
| RUN groupadd -r app -g ${USE_GID} && useradd --no-log-init -m -r -g app app -u ${USE_UID} && \ | RUN groupadd -r app -g ${USE_GID} && useradd --no-log-init -m -r -g app app -u ${USE_UID} && \ | ||||||
| @@ -45,6 +46,10 @@ RUN --mount=type=cache,uid=${USE_UID},gid=${USE_GID},target=${CACHE} \ | |||||||
|   if [ "${USE_EDGE}" = "true" ]; then VERSION=$(git describe --abbrev=7); fi && \ |   if [ "${USE_EDGE}" = "true" ]; then VERSION=$(git describe --abbrev=7); fi && \ | ||||||
|   git reset --hard ${VERSION}' && \ |   git reset --hard ${VERSION}' && \ | ||||||
|   pip --cache-dir=${CACHE}/pip install -r requirements.txt && \ |   pip --cache-dir=${CACHE}/pip install -r requirements.txt && \ | ||||||
|  |   if [ "${USE_KRITA}" = "true" ]; then \ | ||||||
|  |     USE_CNAUX="true"; USE_IPAPLUS="true"; \ | ||||||
|  |     USE_INPAINT="true"; USE_TOOLING="true"; \ | ||||||
|  |   fi; \ | ||||||
|   if [ "${USE_GGUF}" = "true" ]; then \ |   if [ "${USE_GGUF}" = "true" ]; then \ | ||||||
|     git clone https://github.com/city96/ComfyUI-GGUF.git && \ |     git clone https://github.com/city96/ComfyUI-GGUF.git && \ | ||||||
|     cd ComfyUI-GGUF && git checkout main && \ |     cd ComfyUI-GGUF && git checkout main && \ | ||||||
| @@ -59,8 +64,21 @@ RUN --mount=type=cache,uid=${USE_UID},gid=${USE_GID},target=${CACHE} \ | |||||||
|     git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git && \ |     git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git && \ | ||||||
|     cd comfyui_controlnet_aux && git checkout main && \ |     cd comfyui_controlnet_aux && git checkout main && \ | ||||||
|     pip --cache-dir=${CACHE}/pip install -r requirements.txt && \ |     pip --cache-dir=${CACHE}/pip install -r requirements.txt && \ | ||||||
|     # This extra step to separate onnxruntime installation is required to restore onnx cuda support |     # This extra step to separate onnxruntime installation is required to restore onnx cuda support \ | ||||||
|     pip --cache-dir=${CACHE}/pip install onnxruntime && pip --cache-dir=${CACHE}/pip install onnxruntime-gpu && cd ..; \ |     pip --cache-dir=${CACHE}/pip install onnxruntime && pip --cache-dir=${CACHE}/pip install onnxruntime-gpu && cd ..; \ | ||||||
|  |   fi; \ | ||||||
|  |   if [ "${USE_IPAPLUS}" = "true" ]; then \ | ||||||
|  |     git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git && \ | ||||||
|  |     cd ComfyUI_IPAdapter_plus && git checkout main && cd ..; \ | ||||||
|  |   fi; \ | ||||||
|  |   if [ "${USE_INPAINT}" = "true" ]; then \ | ||||||
|  |     git clone https://github.com/Acly/comfyui-inpaint-nodes.git && \ | ||||||
|  |     cd comfyui-inpaint-nodes && git checkout main && \ | ||||||
|  |     pip install opencv-python && cd ..; \ | ||||||
|  |   fi; \ | ||||||
|  |   if [ "${USE_TOOLING}" = "true" ]; then \ | ||||||
|  |     git clone https://github.com/Acly/comfyui-tooling-nodes.git && \ | ||||||
|  |     cd comfyui-tooling-nodes && git checkout main && cd ..; \ | ||||||
|   fi |   fi | ||||||
|  |  | ||||||
| WORKDIR ${ROOT} | WORKDIR ${ROOT} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user