Skip to content

Commit 464a385

Browse files
committed
Merge branch 'upstream' into gempoll
# Conflicts: # web/scripts/ui.js
2 parents 9d41fcf + 2db86b4 commit 464a385

File tree

106 files changed

+16876
-4748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+16876
-4748
lines changed

.github/workflows/test-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
matrix:
2121
python-version: ["3.8", "3.9", "3.10", "3.11"]
2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v2
25+
uses: actions/setup-python@v4
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
- name: Install dependencies

.github/workflows/test-ui.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v3
11+
with:
12+
node-version: 18
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.10'
16+
- name: Install requirements
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
20+
pip install -r requirements.txt
21+
- name: Run Tests
22+
run: |
23+
npm ci
24+
npm run test:generate
25+
npm test
26+
working-directory: ./tests-ui
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Windows Release dependencies"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
xformers:
7+
description: 'xformers version'
8+
required: false
9+
type: string
10+
default: ""
11+
cu:
12+
description: 'cuda version'
13+
required: true
14+
type: string
15+
default: "121"
16+
17+
python_minor:
18+
description: 'python minor version'
19+
required: true
20+
type: string
21+
default: "11"
22+
23+
python_patch:
24+
description: 'python patch version'
25+
required: true
26+
type: string
27+
default: "6"
28+
# push:
29+
# branches:
30+
# - master
31+
32+
jobs:
33+
build_dependencies:
34+
runs-on: windows-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
- uses: actions/setup-python@v4
38+
with:
39+
python-version: 3.${{ inputs.python_minor }}.${{ inputs.python_patch }}
40+
41+
- shell: bash
42+
run: |
43+
echo "@echo off
44+
..\python_embeded\python.exe .\update.py ..\ComfyUI\\
45+
echo -
46+
echo This will try to update pytorch and all python dependencies, if you get an error wait for pytorch/xformers to fix their stuff
47+
echo You should not be running this anyways unless you really have to
48+
echo -
49+
echo If you just want to update normally, close this and run update_comfyui.bat instead.
50+
echo -
51+
pause
52+
..\python_embeded\python.exe -s -m pip install --upgrade torch torchvision torchaudio ${{ inputs.xformers }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2
53+
pause" > update_comfyui_and_python_dependencies.bat
54+
55+
python -m pip wheel --no-cache-dir torch torchvision torchaudio ${{ inputs.xformers }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r requirements.txt pygit2 -w ./temp_wheel_dir
56+
python -m pip install --no-cache-dir ./temp_wheel_dir/*
57+
echo installed basic
58+
ls -lah temp_wheel_dir
59+
mv temp_wheel_dir cu${{ inputs.cu }}_python_deps
60+
tar cf cu${{ inputs.cu }}_python_deps.tar cu${{ inputs.cu }}_python_deps
61+
62+
- uses: actions/cache/save@v3
63+
with:
64+
path: |
65+
cu${{ inputs.cu }}_python_deps.tar
66+
update_comfyui_and_python_dependencies.bat
67+
key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }}

.github/workflows/windows_release_nightly_pytorch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
persist-credentials: false
2121
- uses: actions/setup-python@v4
2222
with:
23-
python-version: '3.11.3'
23+
python-version: '3.11.6'
2424
- shell: bash
2525
run: |
2626
cd ..
2727
cp -r ComfyUI ComfyUI_copy
28-
curl https://www.python.org/ftp/python/3.11.3/python-3.11.3-embed-amd64.zip -o python_embeded.zip
28+
curl https://www.python.org/ftp/python/3.11.6/python-3.11.6-embed-amd64.zip -o python_embeded.zip
2929
unzip python_embeded.zip -d python_embeded
3030
cd python_embeded
3131
echo 'import site' >> ./python311._pth
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: "Windows Release packaging"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
cu:
7+
description: 'cuda version'
8+
required: true
9+
type: string
10+
default: "121"
11+
12+
python_minor:
13+
description: 'python minor version'
14+
required: true
15+
type: string
16+
default: "11"
17+
18+
python_patch:
19+
description: 'python patch version'
20+
required: true
21+
type: string
22+
default: "6"
23+
# push:
24+
# branches:
25+
# - master
26+
27+
jobs:
28+
package_comfyui:
29+
permissions:
30+
contents: "write"
31+
packages: "write"
32+
pull-requests: "read"
33+
runs-on: windows-latest
34+
steps:
35+
- uses: actions/cache/restore@v3
36+
id: cache
37+
with:
38+
path: |
39+
cu${{ inputs.cu }}_python_deps.tar
40+
update_comfyui_and_python_dependencies.bat
41+
key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }}
42+
- shell: bash
43+
run: |
44+
mv cu${{ inputs.cu }}_python_deps.tar ../
45+
mv update_comfyui_and_python_dependencies.bat ../
46+
cd ..
47+
tar xf cu${{ inputs.cu }}_python_deps.tar
48+
pwd
49+
ls
50+
51+
- uses: actions/checkout@v3
52+
with:
53+
fetch-depth: 0
54+
persist-credentials: false
55+
- shell: bash
56+
run: |
57+
cd ..
58+
cp -r ComfyUI ComfyUI_copy
59+
curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip
60+
unzip python_embeded.zip -d python_embeded
61+
cd python_embeded
62+
echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
63+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
64+
./python.exe get-pip.py
65+
./python.exe -s -m pip install ../cu${{ inputs.cu }}_python_deps/*
66+
sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth
67+
cd ..
68+
69+
git clone https://github.com/comfyanonymous/taesd
70+
cp taesd/*.pth ./ComfyUI_copy/models/vae_approx/
71+
72+
mkdir ComfyUI_windows_portable
73+
mv python_embeded ComfyUI_windows_portable
74+
mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI
75+
76+
cd ComfyUI_windows_portable
77+
78+
mkdir update
79+
cp -r ComfyUI/.ci/update_windows/* ./update/
80+
cp -r ComfyUI/.ci/windows_base_files/* ./
81+
cp ../update_comfyui_and_python_dependencies.bat ./update/
82+
83+
cd ..
84+
85+
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable
86+
mv ComfyUI_windows_portable.7z ComfyUI/new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z
87+
88+
cd ComfyUI_windows_portable
89+
python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu
90+
91+
ls
92+
93+
- name: Upload binaries to release
94+
uses: svenstaro/upload-release-action@v2
95+
with:
96+
repo_token: ${{ secrets.GITHUB_TOKEN }}
97+
file: new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z
98+
tag: "latest"
99+
overwrite: true
100+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ venv/
1414
/web/extensions/*
1515
!/web/extensions/logging.js.example
1616
!/web/extensions/core/
17+
/tests-ui/data/object_info.json

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"path-intellisense.mappings": {
3+
"../": "${workspaceFolder}/web/extensions/core"
4+
},
5+
"[python]": {
6+
"editor.defaultFormatter": "ms-python.autopep8"
7+
},
8+
"python.formatting.provider": "none"
9+
}

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ComfyUI
22
=======
3-
A powerful and modular stable diffusion GUI and backend.
3+
The most powerful and modular stable diffusion GUI and backend.
44
-----------
55
![ComfyUI Screenshot](comfyui_screenshot.png)
66

@@ -11,7 +11,7 @@ This ui will let you design and execute advanced stable diffusion pipelines usin
1111

1212
## Features
1313
- Nodes/graph/flowchart interface to experiment and create complex Stable Diffusion workflows without needing to code anything.
14-
- Fully supports SD1.x, SD2.x and SDXL
14+
- Fully supports SD1.x, SD2.x, [SDXL](https://comfyanonymous.github.io/ComfyUI_examples/sdxl/) and [Stable Video Diffusion](https://comfyanonymous.github.io/ComfyUI_examples/video/)
1515
- Asynchronous Queue system
1616
- Many optimizations: Only re-executes the parts of the workflow that changes between executions.
1717
- Command line option: ```--lowvram``` to make it work on GPUs with less than 3GB vram (enabled automatically on GPUs with low vram)
@@ -30,6 +30,8 @@ This ui will let you design and execute advanced stable diffusion pipelines usin
3030
- [unCLIP Models](https://comfyanonymous.github.io/ComfyUI_examples/unclip/)
3131
- [GLIGEN](https://comfyanonymous.github.io/ComfyUI_examples/gligen/)
3232
- [Model Merging](https://comfyanonymous.github.io/ComfyUI_examples/model_merging/)
33+
- [LCM models and Loras](https://comfyanonymous.github.io/ComfyUI_examples/lcm/)
34+
- [SDXL Turbo](https://comfyanonymous.github.io/ComfyUI_examples/sdturbo/)
3335
- Latent previews with [TAESD](#how-to-show-high-quality-previews)
3436
- Starts up very fast.
3537
- Works fully offline: will never download anything.
@@ -43,9 +45,11 @@ Workflow examples can be found on the [Examples page](https://comfyanonymous.git
4345
|---------------------------|--------------------------------------------------------------------------------------------------------------------|
4446
| Ctrl + Enter | Queue up current graph for generation |
4547
| Ctrl + Shift + Enter | Queue up current graph as first for generation |
48+
| Ctrl + Z/Ctrl + Y | Undo/Redo |
4649
| Ctrl + S | Save workflow |
4750
| Ctrl + O | Load workflow |
4851
| Ctrl + A | Select all nodes |
52+
| Alt + C | Collapse/uncollapse selected nodes |
4953
| Ctrl + M | Mute/unmute selected nodes |
5054
| Ctrl + B | Bypass selected nodes (acts like the node was removed from the graph and the wires reconnected through) |
5155
| Delete/Backspace | Delete selected nodes |
@@ -69,7 +73,7 @@ Ctrl can also be replaced with Cmd instead for macOS users
6973

7074
There is a portable standalone build for Windows that should work for running on Nvidia GPUs or for running on your CPU only on the [releases page](https://github.com/comfyanonymous/ComfyUI/releases).
7175

72-
### [Direct link to download](https://github.com/comfyanonymous/ComfyUI/releases/download/latest/ComfyUI_windows_portable_nvidia_cu118_or_cpu.7z)
76+
### [Direct link to download](https://github.com/comfyanonymous/ComfyUI/releases/download/latest/ComfyUI_windows_portable_nvidia_cu121_or_cpu.7z)
7377

7478
Simply download, extract with [7-Zip](https://7-zip.org) and run. Make sure you put your Stable Diffusion checkpoints/models (the huge ckpt/safetensors files) in: ComfyUI\models\checkpoints
7579

@@ -89,19 +93,22 @@ Put your SD checkpoints (the huge ckpt/safetensors files) in: models/checkpoints
8993

9094
Put your VAE in: models/vae
9195

96+
Note: pytorch does not support python 3.12 yet so make sure your python version is 3.11 or earlier.
97+
9298
### AMD GPUs (Linux only)
9399
AMD users can install rocm and pytorch with pip if you don't have it already installed, this is the command to install the stable version:
94100

95-
```pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.4.2```
101+
```pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6```
102+
103+
This is the command to install the nightly with ROCm 5.7 that might have some performance improvements:
96104

97-
This is the command to install the nightly with ROCm 5.6 that supports the 7000 series and might have some performance improvements:
98-
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.6```
105+
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.7```
99106

100107
### NVIDIA
101108

102-
Nvidia users should install torch and xformers using this command:
109+
Nvidia users should install pytorch using this command:
103110

104-
```pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 xformers```
111+
```pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121```
105112

106113
#### Troubleshooting
107114

@@ -187,7 +194,7 @@ To use a textual inversion concepts/embeddings in a text prompt put them in the
187194

188195
Make sure you use the regular loaders/Load Checkpoint node to load checkpoints. It will auto pick the right settings depending on your GPU.
189196

190-
You can set this command line setting to disable the upcasting to fp32 in some cross attention operations which will increase your speed. Note that this will very likely give you black images on SD2.x models. If you use xformers this option does not do anything.
197+
You can set this command line setting to disable the upcasting to fp32 in some cross attention operations which will increase your speed. Note that this will very likely give you black images on SD2.x models. If you use xformers or pytorch attention this option does not do anything.
191198

192199
```--dont-upcast-attention```
193200

0 commit comments

Comments
 (0)