-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip installable comfyui, single file .exe, multi-backend / distributed comfyui, pip installable plugins, rich API, OpenAPI specs #298
base: master
Are you sure you want to change the base?
Conversation
90d5d48
to
dec408a
Compare
dec408a
to
ecb210c
Compare
9e8eb58
to
b9872d2
Compare
This looks really good (worked well for me). |
3fdd2de
to
21dd240
Compare
This is now tested on fairly complex setups except AMD DirectML on Windows. I will try that on my AMD Windows station later. Additionally, PyTorch 2.1+ nightlies are now the default for all accelerators I tested (Windows NVIDIA, Windows CPU, Linux NVIDIA, Linux AMD, macOS Apple Silicon). This leaves Windows AMD and macOS AMD to test. |
Looks like for NVidia, I currently get torch@https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp311-cp311-win_amd64.whl (the url in setup.py is for torch 2.0.1 and CUDA 11.8) when I run |
That's the error! I accidentally left out that commit, I'll tie up my other work shortly and tidy this up. |
…es for the current platform and supported devices - setup.py now works - Makes installation work a variety of ways, including making other packages dependent on this one for e.g. plugins - Fixes missing __init__.py issues - Fixes imports - Compatible with your existing scripts that rely on requirements.txt - Fixes error in comfy/ldm/models/diffusion/ddim.py - Fixes missing packages for other diffusers code in this repo
This reverts commit f138701.
A fully featured update to ComfyUI
This fork allows you to
pip install git+https://github.com/hiddenswitch/ComfyUI.git
. You never need to think about installing torch again.python -m PyInstaller --onefile --noupx -n ComfyUI --add-data="comfy/;comfy/" --paths . --paths comfy/cmd main.py
comfyui
with lots of useful options you can find in--help
comfyui-worker --distributed-queue-connection-uri=amqp://guest:guest@rabbitmq-server --cwd //shared/network/path
on as many machines as you'd like;comfyui --distributed-queue-roles=frontend --distributed-queue-connection-uri=amqp://guest:guest@rabbitmq-server --cwd //shared/network/path
on others.setup.py
, and install new nodes or web extensions withpip install git+https://github.com/some/repository.git
. No more messing around with requirements.txt or manually resolving dependency conflicts.EmbeddedComfyClient
to run comfyui prompts directly in your python application without a backend;AsyncRemoteComfyClient
to connect to a remote server, or a fully-featured OpenAPI 3.1 spec to make a rich UI.Previous Discussion
This includes the setup.py changes: (resolves #1613 #1342 #188)
setup.py
all .py files with
that are in a package (i.e. a directory with an
__init__.py
) inmodule.root.to.recursively.scan.for.nodes
or deeper will be recognized by comfyui as providing nodes.since you will be using pip to install custom nodes this way, you will get dependency resolution automatically, so you never have to
pip install -r requirements.txt
or similar garbage. this will deprecate / obsolete ComfyUI-Manager's functionality, you can use any pip package manager UI (mostly resolves #1773). this also fixes issues like #1678 #1665 #1596 #1385 #1373 if adoptedyou would also be able to add the comfyui git hash and custom nodes packages by git+commit or name in the metadata for maximum reproducibility.
This PR also creates two new api endpoints documented in the openapi.yaml. These are ergonomic for common usage like batches or using from other applications.
test using the instructions from: https://github.com/hiddenswitch/ComfyUI/tree/master#manual-install-windows-linux-macos
also copied here to improve comprehension of the purpose of this PR
Manual Install (Windows, Linux, macOS)
You must have Python 3.11 or 3.10 installed. 3.12 is not yet supported. On Windows, download the latest Python from their website. You can also directly download 3.11.4 here..
On macOS, install exactly Python 3.11 using
brew
, which you can download from https://brew.sh, using this command:brew install python@3.11
. Do not use 3.9 or older, and do not use 3.12 or newer. Its compatibility with Stable Diffusion in both directions is broken.Create a virtual environment:
Activate it on
Windows (PowerShell):
Linux and macOS
source ./venv/bin/activate
Then, run the following command to install
comfyui
into your current environment. This will correctly select the version of pytorch that matches the GPU on your machine (NVIDIA or CPU on Windows, NVIDIA AMD or CPU on Linux):To run the web server:
To generate python OpenAPI models:
Manual Install (Windows, Linux, macOS) For Development
Clone this repo:
git clone https://github.com/comfyanonymous/ComfyUI.git cd ComfyUI
Put your Stable Diffusion checkpoints (the huge ckpt/safetensors files) into the
models/checkpoints
folder. You can download SD v1.5 using the following command:Put your VAE into the
models/vae
folder.(Optional) Create a virtual environment:
Create an environment:
Activate it:
Windows (PowerShell):
Linux and macOS
source ./venv/bin/activate
Then, run the following command to install
comfyui
into your current environment. This will correctly select the version of pytorch that matches the GPU on your machine (NVIDIA or CPU on Windows, NVIDIA AMD or CPU on Linux):pip install -e .
To run the web server:
To generate python OpenAPI models:
You can use
comfyui
as an API. Visit the OpenAPI specification. This file can be used to generate typed clients for your preferred language.