Sign inSign up

corundex/comfyui-rocm

By corundex

โ€ขUpdated over 1 year ago

ComfyUI with AMD ROCm support for GPU-accelerated AI image generation on AMD RX 6000/7000+ GPUs

Image
Machine learning & AI
Developer tools
Data science
4

50K+

corundex/comfyui-rocm repository overview

โ ComfyUI ROCm Docker Image

๐Ÿ”ฅ ComfyUI with AMD ROCm support - Run ComfyUI on AMD GPUs with optimized ROCm-compatible dependencies.

Docker Pulls ROCm AMD GPU

corundex/comfyui-rocm GitHub repositoryโ 

ComfyUI Interface ComfyUI running on AMD ROCm with sample workflow and generated landscape image

โ ๐Ÿ“‹ Version Information

  • Base Image: rocm/pytorch:rocm6.4.1_ubuntu24.04_py3.12_pytorch_release_2.6.0
  • Python: 3.12.10
  • PyTorch: 2.6.0+git684f6f2
  • ROCm: 6.4.43483-a187df25c
  • ComfyUI: v0.3.43 (e18f53c, 2025-06-27)

โ ๐Ÿ“ฆ What's Different from Standard ComfyUI?

This ROCm-optimized build:

  • โœ… Uses ROCm PyTorch instead of CUDA PyTorch
  • โœ… Pre-tested dependencies on real AMD hardware

โ ๐Ÿงช Tested Package Compatibility

All packages in this container have been tested on real AMD hardware. See requirements_rocm.txt for the complete lists:

โ โœ… ROCm-Compatible Packages (18 total):
  • comfyui-frontend-package==1.23.4
  • comfyui-workflow-templates==0.1.30
  • comfyui-embedded-docs==0.2.3
  • torchsde
  • einops
  • transformers>=4.37.2
  • tokenizers>=0.13.3
  • sentencepiece
  • safetensors>=0.4.2
  • pyyaml
  • Pillow
  • alembic
  • SQLAlchemy
  • kornia>=0.7.1
  • spandrel
  • av>=14.2.0
  • pydantic~=2.0
  • pydantic-settings~=2.0
โ ๐Ÿ“ฆ Pre-installed in ROCm Base (9 total):
  • torch
  • torchvision
  • numpy>=1.25.0
  • aiohttp>=3.11.8
  • yarl>=1.18.0
  • scipy
  • tqdm
  • psutil
  • soundfile
โ ๐ŸŒ™ Incompatible packages (1 total):
  • torchaudio - Excluded from the image

โ ๐Ÿš€ Quick Start

# Pull and run ComfyUI with ROCm support
docker run -d \
  --device=/dev/kfd \
  --device=/dev/dri \
  --group-add=video \
  -p 8188:8188 \
  -v $(pwd)/models:/workspace/ComfyUI/models \
  -v $(pwd)/output:/workspace/ComfyUI/output \
  corundex/comfyui-rocm:latest

Access ComfyUI at: http://localhost:8188โ 

โ ๐ŸŽฏ What's Included

  • ComfyUI - Latest stable version
  • ROCm-optimized PyTorch - AMD GPU acceleration
  • Filtered dependencies - Only ROCm-compatible packages
  • Ready-to-use workflow - Sample workflow included
  • Persistent storage - Models and outputs preserved

โ ๐Ÿ“‹ Requirements

โ Hardware
  • AMD GPU with ROCm support (RX 6000+, RX 7000+, etc.)
  • 8GB+ VRAM (16GB+ recommended for larger models)
โ Software
  • Docker with GPU support
  • ROCm drivers 6.4+ installed on host
  • Linux (Ubuntu 24.04+ recommended)

โ ๐Ÿ”ง Installation & Setup

โ 1. Install ROCm Drivers
# Ubuntu/Debian
curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/rocm.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.4 jammy main" | sudo tee /etc/apt/sources.list.d/rocm.list
sudo apt update && sudo apt install rocm-dkms
sudo usermod -a -G render,video $USER
โ 2. Verify ROCm Installation
rocm-smi
# Should show your AMD GPU(s)
โ 3. Run ComfyUI Container
docker run -d \
  --name comfyui-rocm \
  --device=/dev/kfd \
  --device=/dev/dri \
  --group-add=video \
  -p 8188:8188 \
  -v ./models:/workspace/ComfyUI/models \
  -v ./output:/workspace/ComfyUI/output \
  -v ./input:/workspace/ComfyUI/input \
  -v ./custom_nodes:/workspace/ComfyUI/custom_nodes \
  corundex/comfyui-rocm:latest

โ ๐Ÿ“ Volume Mounts

Host PathContainer PathPurpose
./models/workspace/ComfyUI/modelsStore models (checkpoints, VAE, LoRA, etc.)
./output/workspace/ComfyUI/outputGenerated images and videos
./input/workspace/ComfyUI/inputInput images for processing
./custom_nodes/workspace/ComfyUI/custom_nodesCustom ComfyUI extensions

โ ๐ŸŽ›๏ธ Smart Model Management

The ComfyUI Docker image includes an intelligent model management system that automatically downloads models based on your needs.

โ Model Download Modes

Control model downloading with the MODEL_DOWNLOAD environment variable:

โ MODEL_DOWNLOAD=default (Default)

Downloads essential model to get started:

  • Stable Diffusion 1.5 - Most popular base model (4GB)
โ MODEL_DOWNLOAD=common

Downloads comprehensive starter set:

  • Stable Diffusion 1.5 + SD 1.5 VAE
  • SDXL Base 1.0 + SDXL Refiner 1.0
  • ControlNet models (Canny, Depth, OpenPose)
  • Real-ESRGAN upscalers (4x General + 4x Anime)
  • EasyNegative embedding
โ MODEL_DOWNLOAD=realistic

Downloads realistic photo models:

  • Realistic Vision v5.1 - High-quality realistic images
  • DreamShaper 8 - Versatile realistic model
  • Realistic VAE
โ MODEL_DOWNLOAD=photorealistic

Downloads SDXL-based photorealistic models:

  • Juggernaut XL v9 - Top-tier SDXL photorealism
  • RealVisXL V4.0 - Excellent SDXL realistic model
โ MODEL_DOWNLOAD=artistic

Downloads creative/stylized models:

  • Deliberate v2 - Artistic and painterly style
โ MODEL_DOWNLOAD=all

Downloads everything from all model sets above (โš ๏ธ Large download ~100GB+)

โ MODEL_DOWNLOAD=none

Skips all downloads - uses only existing models in volumes

โ Custom Model Sets

Add your own sections to models.yaml and use them:

MODEL_DOWNLOAD=mycustom
โ Docker Usage Examples
โ Basic Usage (SD 1.5 only)
docker run -d \
  --device=/dev/kfd --device=/dev/dri --group-add=video \
  -p 8188:8188 \
  -v ./models:/workspace/ComfyUI/models \
  corundex/comfyui-rocm:latest
โ Common Model Set
docker run -d \
  --device=/dev/kfd --device=/dev/dri --group-add=video \
  -p 8188:8188 \
  -e MODEL_DOWNLOAD=common \
  -v ./models:/workspace/ComfyUI/models \
  corundex/comfyui-rocm:latest
โ All Models (Large Download)
docker run -d \
  --device=/dev/kfd --device=/dev/dri --group-add=video \
  -p 8188:8188 \
  -e MODEL_DOWNLOAD=all \
  -v ./models:/workspace/ComfyUI/models \
  corundex/comfyui-rocm:latest
โ No Downloads (Use Existing Models)
docker run -d \
  --device=/dev/kfd --device=/dev/dri --group-add=video \
  -p 8188:8188 \
  -e MODEL_DOWNLOAD=none \
  -v ./models:/workspace/ComfyUI/models \
  corundex/comfyui-rocm:latest
โ Smart Features
โ Automatic Skip Existing
  • Never re-downloads existing models
  • Validates file sizes - redownloads corrupted files
  • Resume support - continues interrupted downloads
โ Model Inventory

On startup, see what's available:

[ComfyUI] Current model inventory:
  checkpoints: 3 models
  vae: 1 models
  loras: 2 models
  upscale_models: 1 models
  controlnet: 3 models
  embeddings: 1 models
โ Customizing Models
โ Edit models.yaml

Add your own model sections in YAML format:

models:
  mycustom:
    - name: "My Custom Model"
      url: "https://example.com/model.safetensors"
      path: "checkpoints/my_model.safetensors"
      min_size: 2000000000
    - name: "Another Model"
      url: "https://example.com/model2.safetensors"
      path: "checkpoints/model2.safetensors"
      min_size: 4000000000
โ Model Configuration Format
  • name: Human-readable description
  • url: Download URL
  • path: Relative path from /workspace/ComfyUI/models/
  • min_size: Minimum file size in bytes for validation

โ ๐ŸŽจ Getting Started

โ Load Sample Workflow
  1. Open ComfyUI at http://localhost:8188
  2. Click "Load" โ†’ "Upload"
  3. Upload sample_workflow.json (included in this directory)
  4. Click "Queue Prompt" to generate your first image!

Create docker-compose.yml:

version: '3.8'

services:
  comfyui-rocm:
    image: corundex/comfyui-rocm:latest
    container_name: comfyui-rocm
    devices:
      - /dev/kfd:/dev/kfd
      - /dev/dri:/dev/dri
    group_add:
      - video
    ports:
      - "8188:8188"
    volumes:
      # Model storage (checkpoints, VAE, LoRA, etc.)
      - ./data/models:/workspace/ComfyUI/models
      # Generated images and outputs
      - ./data/output:/workspace/ComfyUI/output
      # Input images for processing
      - ./data/input:/workspace/ComfyUI/input
      # Custom nodes and extensions
      - ./data/custom_nodes:/workspace/ComfyUI/custom_nodes
      # ComfyUI user settings and workflows
      - ./data/user:/workspace/ComfyUI/user
    environment:
      # Model download behavior: default, common, realistic, photorealistic, artistic, all, none
      - MODEL_DOWNLOAD=default
      # ROCm environment
      - HIP_VISIBLE_DEVICES=0
      - CUDA_VISIBLE_DEVICES=""
    restart: unless-stopped

Run with: docker compose up -d

./data/
โ”œโ”€โ”€ models/           # AI models (checkpoints, VAE, LoRA, etc.)
โ”‚   โ”œโ”€โ”€ checkpoints/  # Main AI models (.safetensors)
โ”‚   โ”œโ”€โ”€ vae/         # VAE models for better image quality
โ”‚   โ”œโ”€โ”€ loras/       # LoRA fine-tuning models
โ”‚   โ”œโ”€โ”€ embeddings/  # Text embeddings
โ”‚   โ”œโ”€โ”€ controlnet/  # ControlNet guidance models
โ”‚   โ””โ”€โ”€ upscale_models/ # Image upscaler models
โ”œโ”€โ”€ output/          # Generated images and videos
โ”œโ”€โ”€ input/           # Input images for processing
โ”œโ”€โ”€ custom_nodes/    # ComfyUI extensions
โ””โ”€โ”€ user/            # User settings and saved workflows

โ ๐Ÿงช Tested Hardware

  • AMD Radeon RX 9060 XT (16GB VRAM) โœ…

โ โšก Performance Notes

  • Image Generation: ~30-60 seconds for 512x512 (depends on model and steps)
  • Memory Usage: 4-8GB VRAM for basic operations
  • Model Loading: ~30-60 seconds first time, cached afterward
  • Batch Processing: Supported for multiple images

โ ๐Ÿš€ Performance Tips

  1. Use Persistent Volumes: Always mount model directories to avoid re-downloading
  2. Start with default: Test with basic model first
  3. Upgrade to all: Download full set when ready
  4. Custom Sets: Create targeted collections for specific workflows
  5. External Storage: Use fast SSD for model storage

โ ๐Ÿ” Troubleshooting

โ Container won't start
# Check ROCm drivers
rocm-smi

# Check Docker GPU access
docker run --rm --device=/dev/kfd --device=/dev/dri rocm/pytorch:latest rocm-smi
โ ComfyUI shows "No GPU detected"
# Verify ROCm in container
docker exec comfyui-rocm python -c "import torch; print(f'ROCm: {torch.cuda.is_available()}')"
โ Model Download Failures
  • Check internet connection
  • Verify HuggingFace/source availability
  • Check disk space in mounted volumes
  • Review logs for specific error messages
โ Model Not Found
  • Ensure model downloaded successfully
  • Check file permissions in mounted volumes
  • Verify model file isn't corrupted (size check)
โ Startup Issues
  • Check MODEL_DOWNLOAD value is valid
  • Ensure volumes are properly mounted
  • Review container logs for errors
โ Out of memory errors
  • Reduce batch size in workflow
  • Use smaller models
  • Ensure sufficient VRAM (8GB minimum)

โ ๐Ÿ“„ License

This Docker image packages ComfyUI with ROCm support. ComfyUI is licensed under GPL-3.0.

โ ๐Ÿค Contributing

Found an issue or want to contribute? Visit our GitHub repositoryโ  to:

  • Report bugs
  • Suggest improvements
  • Submit pull requests
  • Share your AMD GPU test results

โ ๐Ÿ“„ License & Credits

This project is licensed under GPL-3.0.

โ Third-Party Components

โ ๐Ÿ™ Acknowledgments

Tag summary

Content type

Image

Digest

sha256:3079597cbโ€ฆ

Size

21.5 GB

Last updated

over 1 year ago

docker pull corundex/comfyui-rocm