Source Base: comfyui-base (original template)
Goal: Create a private, "Slim" ComfyUI image with automated model downloading, dynamic node installation, and SSH-based file management, removing FileBrowser and JupyterLab.
Target File: Dockerfile
Changes Made:
- Removed Web Tools: Deleted all instructions related to installing and configuring
filebrowser(port 8080) andjupyterlab(port 8888). - Added System Tools:
rsync: For efficient file transfer via SSH.socat: For bridging Port 80 to 8188 (RunPod Proxy support).iproute2: For network debugging (ipcommand).
- Refactored Custom Nodes: Removed hardcoded
git clonecommands for specific custom nodes (ControlNet, AnimateDiff, etc.) in thebuilderstage. Kept onlyComfyUI-Manageras a base. - Added Python Tooling: Added
pip install comfy-cli. - Expose Ports: Updated
EXPOSEto only list8188(ComfyUI) and22(SSH).
Target File: start.sh
Changes Made:
- Configuration Variables: Added variables at the top for easy user customization:
CUSTOM_NODES: Space-separated GitHub URLs to clone on boot.CHECKPOINT_MODELS,VAE_MODELS, etc.: URLs for automated downloading.
- Model Download Function: Implemented
download_models()to handle file downloading with existence checks (skips if file exists). - Dynamic Node Installation:
- Created a loop to process
CUSTOM_NODES. - Logic: Clone repo -> Activate Venv -> Install
requirements.txt-> Runinstall.py-> Runsetup.py.
- Created a loop to process
- Network Bridging: Added a background
socatprocess to forward traffic from Port 80 to localhost:8188, ensuring compatibility with RunPod's HTTP Proxy. - Environment Preservation: Enhanced SSH setup to ensure
PermitUserEnvironment yesis set and environment variables are exported to SSH sessions. - Cleanup: Removed logic for creating FileBrowser databases and Jupyter configs.
File: emergency_setup.sh
Purpose: A portable "patch script" that mimics the node/model setup logic of start.sh.
Use Case: Can be run on any standard ComfyUI container to install your preferred nodes and models without rebuilding the Docker image.
Custom Nodes Active:
rgthree-comfyComfyUI-KJNodesComfyUI-RunpodDirect
Models:
z-image-turbo-bf16-aio.safetensors
Build:
docker build -t comfyui-custom .Push (Example for Docker Hub):
docker tag comfyui-custom:latest <username>/comfyui-custom:latest
docker push <username>/comfyui-custom:latestRun (Local/Dev):
docker run -d -p 8188:8188 --gpus all comfyui-custom