This commit significantly enhances the `Dockerfile` for the ComfyUI service by introducing several new features and configurations. Here's a detailed breakdown of the changes:
1. **Base Image Update**:
- Updated the base image from `pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime` to `pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime`. This ensures compatibility with newer versions of PyTorch and CUDA, providing better performance and support for recent hardware.
2. **Environment Variables**:
- Introduced several new environment variables (`USE_UID`, `USE_GID`, `USE_USER`, `USE_GROUP`) to allow customization of the user and group IDs within the container.
- Added flags (`USE_EDGE`, `USE_GGUF`, `USE_XFLUX`, `USE_CNAUX`, `USE_KRITA`, `USE_IPAPLUS`, `USE_INPAINT`, `USE_TOOLING`) to enable or disable optional features and integrations.
3. **User/Group Management**:
- Added logic to create a user and group with specified IDs (`USE_UID` and `USE_GID`). This is useful for running the container in environments where specific user permissions are required.
- Set default values for these variables, ensuring that the Dockerfile remains functional without explicit configuration.
4. **Optional Feature Integration**:
- Included conditional logic to clone and install additional repositories based on the flags set (`USE_GGUF`, `USE_XFLUX`, `USE_CNAUX`, `USE_KRITA`, `USE_IPAPLUS`, `USE_INPAINT`, `USE_TOOLING`). This allows users to customize their ComfyUI installation by enabling only the features they need.
- Ensured that dependencies for these optional features are installed correctly, including handling specific cases like separating ONNX Runtime installations to restore CUDA support.
5. **Python Version Update**:
- Changed the Python command from `python` to `python3` in the CMD instruction to explicitly specify the use of Python 3, which is a best practice for clarity and compatibility.
6. **File Permissions and Ownership**:
- Used `--chown=${USE_UID}:${USE_GID}` when copying files into the container to ensure that the correct user owns these files, preventing permission issues during execution.
7. **General Improvements**:
- Improved readability and maintainability of the Dockerfile by organizing the steps logically and adding comments where necessary.
- Ensured that all commands are idempotent, meaning they can be run multiple times without causing unintended side effects.
- `USE_UID`: Specifies the user ID for the non-root user within the container. Default is set to value 0.
- `USE_GID`: Specifies the group ID for the non-root user within the container. Default is set to value like 0.
- `USE_USER`: Specifies the username for the non-root user within the container. Default is set to `root`.
- `USE_GROUP`: Specifies the group name for the non-root user within the container. Default is set to `root`.
- `USE_EDGE`: If set to `true`, clones and installs the latest development version of ComfyUI from the main branch.
- `USE_GGUF`: If set to `true`, clones and installs the ComfyUI-GGUF extension for GPU acceleration.
- `USE_XFLUX`: If set to `true`, clones and installs the x-flux-comfyui extension for additional functionalities.
- `USE_CNAUX`: If set to `true`, clones and installs the comfyui_controlnet_aux extension for control net auxiliary features.
- `USE_KRITA`: If set to `true`, clones and installs multiple extensions (comfyui_controlnet_aux, ComfyUI_IPAdapter_plus, comfyui-inpaint-nodes, comfyui-tooling-nodes) that are useful when integrating with Krita.
- `USE_IPAPLUS`: If set to `true`, clones and installs the ComfyUI_IPAdapter_plus extension for IP Adapter functionalities.
- `USE_INPAINT`: If set to `true`, clones and installs the comfyui-inpaint-nodes extension for inpainting capabilities.
- `USE_TOOLING`: If set to `true`, clones and installs the comfyui-tooling-nodes extension for additional tooling features.
These ARGs provide flexibility in configuring the Docker container, allowing users to tailor the ComfyUI installation to their specific needs.
Stable Diffusion WebUI Docker
Run Stable Diffusion on your machine with a nice UI without any hassle!
Setup & Usage
Visit the wiki for Setup and Usage instructions, checkout the FAQ page if you face any problems, or create a new issue!
Features
This repository provides multiple UIs for you to play around with stable diffusion:
AUTOMATIC1111
Full feature list here, Screenshots:
| Text to image | Image to image | Extras |
|---|---|---|
![]() |
![]() |
![]() |
ComfyUI
Full feature list here, Screenshot:
| Workflow |
|---|
![]() |
Contributing
Contributions are welcome! Create a discussion first of what the problem is and what you want to contribute (before you implement anything)
Disclaimer
The authors of this project are not responsible for any content generated using this interface.
This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups. For the full list of restrictions please read the license.
Thanks
Special thanks to everyone behind these awesome projects, without them, none of this would have been possible:
- AUTOMATIC1111/stable-diffusion-webui
- InvokeAI
- ComfyUI
- CompVis/stable-diffusion
- Sygil-webui
- and many many more.



