Giter Club home page Giter Club logo

lilai-pixels's Introduction

Docker image for ComfyUI

GitHub Workflow Status
Concept Design

This repo is for Docker images that runs ComfyUI - a Stable Diffusion GUI powering node-based workflow.

How it works

  1. At first start, a script will download latest ComfyUI, some custom nodes and models.

  2. The whole ComfyUI will be stored in a local folder (./storage/ComfyUI).

  3. If you already have a ComfyUI bundle, put it there and make an empty file (./storage/ComfyUI/.download-complete) so the start script will skip downloading.

  4. At every restart of the container, a script will update ComfyUI & its custom nodes.

Prerequisites

  • NVIDIA GPU with ≥6GB VRAM

  • Latest NVIDIA GPU Drivers, Both Game and Studio version will work.

  • Docker Installed

Usage - NVIDIA GPU

A. Using docker compose
git clone https://github.com/YanWenKun/ComfyUI-Docker.git

cd ComfyUI-Docker

docker compose up --detach

# Update image (only when Python components is outdated)
git pull
docker compose pull
docker compose up --detach --remove-orphans
docker image prune
B. Using docker run
mkdir -p storage

docker run -it \
  --name comfyui \
  --gpus all \
  -p 8188:8188 \
  -v "$(pwd)"/storage:/home/runner \
  --env CLI_ARGS="" \
  yanwk/comfyui-boot:latest

# Update image (only when Python components is outdated)
docker rm comfyui
docker pull yanwk/comfyui-boot:latest
# Then re-run 'docker run' above again

Once the app is loaded, visit http://localhost:8188/

Usage - AMD GPU (Experimental)

C. Using docker compose
git clone https://github.com/YanWenKun/ComfyUI-Docker.git

cd ComfyUI-Docker

docker compose -f docker-compose-rocm.yml up --detach

# Update image (only when Python components is outdated)
git pull
docker compose -f docker-compose-rocm.yml pull
docker compose -f docker-compose-rocm.yml up --detach --remove-orphans
docker image prune
D. Using docker run
mkdir -p storage

docker run -it \
  --name comfyui \
  --gpus all \
  -p 8188:8188 \
  -v "$(pwd)"/storage:/home/runner \
  --env CLI_ARGS="--use-pytorch-cross-attention" \
  --device=/dev/kfd --device=/dev/dri \
  --group-add=video --ipc=host --cap-add=SYS_PTRACE \
  --security-opt seccomp=unconfined \
  yanwk/comfyui-boot:rocm

# Update image (only when Python components is outdated)
docker rm comfyui
docker pull yanwk/comfyui-boot:rocm
# Then re-run 'docker run' above again

Once the app is loaded, visit http://localhost:8188/

Q & A

Q: My GPU has only 4GB VRAM
A: Add --lowvram to CLI_ARGS.

Q: Adding --lowvram still out-of-memory
A: Use --novram instead. It will use CPU RAM.

Q: How to run on CPU?
A: Add --cpu to CLI_ARGS. It’s pretty slow.

More CLI_ARGS available at ComfyUI.

Some commands for debugging

Compile latest xFormers, targeting specific NVIDIA architechtures.

You may want to check Gencode List.

docker build . --build-arg TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.2;7.5;8.0;8.6" -f Dockerfile-xformers -t yanwk/comfyui-boot:xformers
Build the image, print all logs to STDOUT.
docker build . --progress=plain -f Dockerfile -t yanwk/comfyui-boot:latest
Run a one-time container
docker run -it --rm --gpus all -p 8188:8188 \
  -v "$(pwd)"/storage:/home/runner \
  --env CLI_ARGS="" \
  yanwk/comfyui-boot:latest
Run into a root bash
docker run -it --rm --gpus all \
  -v "$(pwd)"/storage:/home/runner \
  -p 8188:8188 \
  -e CLI_ARGS="" \
  --user root \
  yanwk/comfyui-boot:latest /bin/bash

License

This open source license is written and valid both in Chinese and English, how good is that!

lilai-pixels's People

Contributors

grantalope avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.