# ⚛️ ComfyUV

This guide explains how to deploy the Docker image:

[sandichhuu/comfyuv on Docker Hub](https://hub.docker.com/r/sandichhuu/comfyuv?utm_source=chatgpt.com)

---

An optimized, production-ready ComfyUI Docker image built with `uv` for ultra-fast Python package management. It comes pre-configured with modern performance optimizations like Triton, SageAttention.

<br>

> **⚠️ Important Note**  
> 🌵 I only have RTX 20, 30 series (SM75 & SM86). So newer series untested.  
> 🌵 If you facing any issue, please send the error log to:  
> &nbsp;&nbsp;&nbsp;&nbsp; 💮 [LinkedIn](https://www.linkedin.com/in/huu-san-dich-91a079119/)   
> &nbsp;&nbsp;&nbsp;&nbsp; 💮 [Facebook](https://www.facebook.com/shuugame/)  
> &nbsp;&nbsp;&nbsp;&nbsp; 💮 [Whatsapp](https://wa.me/84328071096)  

<br>

<table style="border: none; border-collapse: collapse;">
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px;"><strong>🌵 Compatible GPU</strong></td>
    <td style="border: none; padding: 5px 10px;"></td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px;">✅ <strong>Newer</strong></td>
    <td style="border: none; padding: 5px 10px;">Runnable, but slower.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px;">✅ <strong>SM120</strong></td>
    <td style="border: none; padding: 5px 10px;">RTX 50 Series.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px;">✅ <strong>SM89</strong></td>
    <td style="border: none; padding: 5px 10px;">RTX 40 Series.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px;">✅ <strong>SM86</strong></td>
    <td style="border: none; padding: 5px 10px;">RTX 30 Series.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px;">✅ <strong>SM75</strong></td>
    <td style="border: none; padding: 5px 10px;">RTX 20 Series.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px;">⛔ <strong>Unsupported</strong></td>
    <td style="border: none; padding: 5px 10px;">GTX 10 Series and older, AMD or Intel GPU.</td>
  </tr>
</table>

<br>

> ⚠️ Unsupport **xformers**.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Because cu132 have no pre-build for this package & have no reason to use the slowest method.  
> ✅ You can use sage-attention or triton instead.

> ⚠️ No longer support **flash-attn** (because the compile time is super slow).  
> ✅ You can do it your self with this command:  
> ```
> MAX_JOBS=10 NVCC_THREADS=1 uv pip install flash-attn --no-build-isolation  
> ```  

<br>

---

<br>

### 🌸 Why use this Docker image for ComfyUI?

<table style="border: none; border-collapse: collapse; width: 100%;">
  <tr style="border: none;">
    <td style="border: none; padding: 6px 15px 6px 0; vertical-align: top; white-space: nowrap;"><strong>✅ Nodes Compatibility</strong></td>
    <td style="border: none; padding: 6px 0; vertical-align: top;">Python 3.13.13, widely compatible with extensions.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 6px 15px 6px 0; vertical-align: top; white-space: nowrap;"><strong>✅ Blazing Fast Speed</strong></td>
    <td style="border: none; padding: 6px 0; vertical-align: top;">Uses <code>uv</code> and <strong>CUDA 13.2</strong> for ultra-fast compilation and execution.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 6px 15px 6px 0; vertical-align: top; white-space: nowrap;"><strong>✅ Precompiled Nodes</strong></td>
    <td style="border: none; padding: 6px 0; vertical-align: top;">Comes with precompiled ecosystem, saving your setup and compile time.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 6px 15px 6px 0; vertical-align: top; white-space: nowrap;"><strong>✅ Strict Privacy</strong></td>
    <td style="border: none; padding: 6px 0; vertical-align: top;">Completely stripped of telemetry. Your data and workflows remain private.</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 6px 15px 6px 0; vertical-align: top; white-space: nowrap;"><strong>✅ Cloud Optimized</strong></td>
    <td style="border: none; padding: 6px 0; vertical-align: top;">Ready for public deployment. Use caddy or nginx for authentication.</td>
  </tr>
</table>

<br>

### 🌸 PRE-INSTALLED Custom Nodes

<table style="border: none; border-collapse: collapse;">
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px 5px 0;">▫️ <a href="https://github.com/calcuis/gguf.git">calcuis/gguf</a></td>
    <td style="border: none; padding: 5px 10px; color: #888;">(calcuis/gguf)</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px 5px 0;">▫️ <a href="https://github.com/BobRandomNumber/ComfyUI-Crystools-MonitorOnly.git">ComfyUI-Crystools-MonitorOnly</a></td>
    <td style="border: none; padding: 5px 10px; color: #888;">(BobRandomNumber)</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px 5px 0;">▫️ <a href="https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git">ComfyUI-VideoHelperSuite</a></td>
    <td style="border: none; padding: 5px 10px; color: #888;">(Kosinkadink)</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px 5px 0;">▫️ <a href="https://github.com/rgthree/rgthree-comfy.git">rgthree-comfy</a></td>
    <td style="border: none; padding: 5px 10px; color: #888;">(rgthree)</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px 5px 0;">▫️ <a href="https://github.com/willmiao/ComfyUI-Lora-Manager.git">ComfyUI-Lora-Manager</a></td>
    <td style="border: none; padding: 5px 10px; color: #888;">(willmiao)</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px 5px 0;">▫️ <a href="https://github.com/Comfy-Org/Nvidia_RTX_Nodes_ComfyUI.git">Nvidia_RTX_Nodes_ComfyUI</a></td>
    <td style="border: none; padding: 5px 10px; color: #888;">(Comfy-Org)</td>
  </tr>
  <tr style="border: none;">
    <td style="border: none; padding: 5px 10px 5px 0;">▫️ <a href="https://github.com/kijai/ComfyUI-KJNodes.git">ComfyUI-KJNodes</a></td>
    <td style="border: none; padding: 5px 10px; color: #888;">(kijai)</td>
  </tr>
</table>

<br>

### 🌸 Quick Start (Docker Compose)

Install **Docker**, **Nvidia Driver** (refer Studio version), **CUDA Toolkit** (version 13.2).  
Next, copy **docker-compose.yml** content below and put to empty folder.  
Then, open **Terminal**/**CMD**/**Windows PowerShell** and navigate to directory contain `docker-compose.yml` file.  
Finally, run this command `docker compose up -d` to start the container.
Go to `http://localhost:8188` and enjoy.

>#### **Requirements**  
> ⬇️ [Docker](https://docs.docker.com/desktop)  
> ⬇️ [nvidia-driver](https://www.nvidia.com/en-us/drivers)  
> ⬇️ [cuda-toolkit (CUDA 13.2)](https://developer.nvidia.com/cuda-downloads)  

#### **docker-compose.yml**

```yaml
services:
  comfyuv:
    image: sandichhuu/comfyuv:sm86cu132
    container_name: comfyuv
    ipc: host
    port:
      - 8188:8188
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    volumes:
      - ./input:/comfy/input
      - ./output:/comfy/output
      - ./workflows:/comfy/user/default/workflows
      - ./models:/comfy/models
      - ./workflows:/comfy/user/default/workflows
      
      - comfyuv:/comfy
      - uv_cache:/root/.cache/uv
    command: >
      --enable-triton-backend
#     --use-flash-attention unsupport becase it take long times to compile.
#     --lowvram
      --use-sage-attention
      --disable-pinned-memory
      --fast fp8_matrix_mult autotune
      --front-end-version Comfy-Org/ComfyUI_frontend@latest

volumes:
  comfyuv:
  uv_cache:
```

### 🌸 Setup Structure

```
comfyuv/
├── docker-compose.yml
├── input/
├── models/
├── workflows/
└── output/
```

---

### 🌸 Why have no all-in-one image ?

All GPU support int4, int8, fp16, fp32.  
But each GPU series has different physics structure due to different kernels and different attention optimization.  

For example RTX4090 support fp8 native, RTX5090 support fp8 & nvfp4 native.  
RTX40xx fastest with FlashAttention3, RTX50xx with FlashAttention4.  
If I compile everything on one image, the file size come super heavy.  
And the compile time is slow as hell.  

---
#### References
* [ComfyUI Official Docs](https://docs.comfy.org/index?utm_source=chatgpt.com)
* [Docker Hub Image](https://hub.docker.com/r/sandichhuu/comfyuv?utm_source=chatgpt.com)
* [Docker Hub Documentation](https://docs.docker.com/docker-hub/?utm_source=chatgpt.com)