Skip to content

Commit 93f20e2

Browse files
committed
Merge branch 'gempoll' into gempoll-docker
2 parents c283f07 + fc1660e commit 93f20e2

File tree

222 files changed

+566682
-64724
lines changed

Some content is hidden

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

222 files changed

+566682
-64724
lines changed

.ci/update_windows/update.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ def pull(repo, remote_name='origin', branch='master'):
2828

2929
if repo.index.conflicts is not None:
3030
for conflict in repo.index.conflicts:
31-
print('Conflicts found in:', conflict[0].path)
31+
print('Conflicts found in:', conflict[0].path) # noqa: T201
3232
raise AssertionError('Conflicts, ahhhhh!!')
3333

3434
user = repo.default_signature
3535
tree = repo.index.write_tree()
36-
commit = repo.create_commit('HEAD',
37-
user,
38-
user,
39-
'Merge!',
40-
tree,
41-
[repo.head.target, remote_master_id])
36+
repo.create_commit('HEAD',
37+
user,
38+
user,
39+
'Merge!',
40+
tree,
41+
[repo.head.target, remote_master_id])
4242
# We need to do this or git CLI will think we are still merging.
4343
repo.state_cleanup()
4444
else:
@@ -49,18 +49,18 @@ def pull(repo, remote_name='origin', branch='master'):
4949
repo = pygit2.Repository(repo_path)
5050
ident = pygit2.Signature('comfyui', 'comfy@ui')
5151
try:
52-
print("stashing current changes")
52+
print("stashing current changes") # noqa: T201
5353
repo.stash(ident)
5454
except KeyError:
55-
print("nothing to stash")
55+
print("nothing to stash") # noqa: T201
5656
backup_branch_name = 'backup_branch_{}'.format(datetime.today().strftime('%Y-%m-%d_%H_%M_%S'))
57-
print("creating backup branch: {}".format(backup_branch_name))
57+
print("creating backup branch: {}".format(backup_branch_name)) # noqa: T201
5858
try:
5959
repo.branches.local.create(backup_branch_name, repo.head.peel())
6060
except:
6161
pass
6262

63-
print("checking out master branch")
63+
print("checking out master branch") # noqa: T201
6464
branch = repo.lookup_branch('master')
6565
if branch is None:
6666
ref = repo.lookup_reference('refs/remotes/origin/master')
@@ -72,7 +72,7 @@ def pull(repo, remote_name='origin', branch='master'):
7272
ref = repo.lookup_reference(branch.name)
7373
repo.checkout(ref)
7474

75-
print("pulling latest changes")
75+
print("pulling latest changes") # noqa: T201
7676
pull(repo)
7777

7878
if "--stable" in sys.argv:
@@ -94,7 +94,7 @@ def latest_tag(repo):
9494
if latest_tag is not None:
9595
repo.checkout(latest_tag)
9696

97-
print("Done!")
97+
print("Done!") # noqa: T201
9898

9999
self_update = True
100100
if len(sys.argv) > 2:
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Python Linting
33
on: [push, pull_request]
44

55
jobs:
6-
pylint:
7-
name: Run Pylint
6+
ruff:
7+
name: Run Ruff
88
runs-on: ubuntu-latest
99

1010
steps:
@@ -16,8 +16,8 @@ jobs:
1616
with:
1717
python-version: 3.x
1818

19-
- name: Install Pylint
20-
run: pip install pylint
19+
- name: Install Ruff
20+
run: pip install ruff
2121

22-
- name: Run Pylint
23-
run: pylint --rcfile=.pylintrc $(find . -type f -name "*.py")
22+
- name: Run Ruff
23+
run: ruff check .

.github/workflows/test-ci.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [macos, linux, windows]
23+
# os: [macos, linux, windows]
24+
os: [macos, linux]
2425
python_version: ["3.9", "3.10", "3.11", "3.12"]
2526
cuda_version: ["12.1"]
2627
torch_version: ["stable"]
@@ -31,9 +32,9 @@ jobs:
3132
- os: linux
3233
runner_label: [self-hosted, Linux]
3334
flags: ""
34-
- os: windows
35-
runner_label: [self-hosted, Windows]
36-
flags: ""
35+
# - os: windows
36+
# runner_label: [self-hosted, Windows]
37+
# flags: ""
3738
runs-on: ${{ matrix.runner_label }}
3839
steps:
3940
- name: Test Workflows
@@ -45,28 +46,28 @@ jobs:
4546
google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
4647
comfyui_flags: ${{ matrix.flags }}
4748

48-
test-win-nightly:
49-
strategy:
50-
fail-fast: true
51-
matrix:
52-
os: [windows]
53-
python_version: ["3.9", "3.10", "3.11", "3.12"]
54-
cuda_version: ["12.1"]
55-
torch_version: ["nightly"]
56-
include:
57-
- os: windows
58-
runner_label: [self-hosted, Windows]
59-
flags: ""
60-
runs-on: ${{ matrix.runner_label }}
61-
steps:
62-
- name: Test Workflows
63-
uses: comfy-org/comfy-action@main
64-
with:
65-
os: ${{ matrix.os }}
66-
python_version: ${{ matrix.python_version }}
67-
torch_version: ${{ matrix.torch_version }}
68-
google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
69-
comfyui_flags: ${{ matrix.flags }}
49+
# test-win-nightly:
50+
# strategy:
51+
# fail-fast: true
52+
# matrix:
53+
# os: [windows]
54+
# python_version: ["3.9", "3.10", "3.11", "3.12"]
55+
# cuda_version: ["12.1"]
56+
# torch_version: ["nightly"]
57+
# include:
58+
# - os: windows
59+
# runner_label: [self-hosted, Windows]
60+
# flags: ""
61+
# runs-on: ${{ matrix.runner_label }}
62+
# steps:
63+
# - name: Test Workflows
64+
# uses: comfy-org/comfy-action@main
65+
# with:
66+
# os: ${{ matrix.os }}
67+
# python_version: ${{ matrix.python_version }}
68+
# torch_version: ${{ matrix.torch_version }}
69+
# google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
70+
# comfyui_flags: ${{ matrix.flags }}
7071

7172
test-unix-nightly:
7273
strategy:

.github/workflows/test-launch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
path: "ComfyUI"
1818
- uses: actions/setup-python@v4
1919
with:
20-
python-version: '3.8'
20+
python-version: '3.9'
2121
- name: Install requirements
2222
run: |
2323
python -m pip install --upgrade pip
@@ -28,7 +28,7 @@ jobs:
2828
- name: Start ComfyUI server
2929
run: |
3030
python main.py --cpu 2>&1 | tee console_output.log &
31-
wait-for-it --service 127.0.0.1:8188 -t 600
31+
wait-for-it --service 127.0.0.1:8188 -t 30
3232
working-directory: ComfyUI
3333
- name: Check for unhandled exceptions in server log
3434
run: |

.pylintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

CODEOWNERS

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
* @comfyanonymous
1+
# Admins
2+
* @comfyanonymous
3+
4+
# Note: Github teams syntax cannot be used here as the repo is not owned by Comfy-Org.
5+
# Inlined the team members for now.
6+
7+
# Maintainers
8+
*.md @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
9+
/tests/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
10+
/tests-unit/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
11+
/notebooks/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
12+
/script_examples/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
13+
/.github/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
14+
15+
# Python web server
16+
/api_server/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
17+
/app/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
18+
19+
# Frontend assets
20+
/web/ @huchenlei @webfiltered @pythongosssss
21+
22+
# Extra nodes
23+
/comfy_extras/ @yoland68 @robinjhuang @huchenlei @pythongosssss @ltdrdata @Kosinkadink

README.md

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,21 @@ This ui will let you design and execute advanced stable diffusion pipelines usin
3838

3939
## Features
4040
- Nodes/graph/flowchart interface to experiment and create complex Stable Diffusion workflows without needing to code anything.
41-
- Fully supports SD1.x, SD2.x, [SDXL](https://comfyanonymous.github.io/ComfyUI_examples/sdxl/), [Stable Video Diffusion](https://comfyanonymous.github.io/ComfyUI_examples/video/), [Stable Cascade](https://comfyanonymous.github.io/ComfyUI_examples/stable_cascade/), [SD3](https://comfyanonymous.github.io/ComfyUI_examples/sd3/) and [Stable Audio](https://comfyanonymous.github.io/ComfyUI_examples/audio/)
42-
- [LTX-Video](https://comfyanonymous.github.io/ComfyUI_examples/ltxv/)
43-
- [Flux](https://comfyanonymous.github.io/ComfyUI_examples/flux/)
44-
- [Mochi](https://comfyanonymous.github.io/ComfyUI_examples/mochi/)
41+
- Image Models
42+
- SD1.x, SD2.x,
43+
- [SDXL](https://comfyanonymous.github.io/ComfyUI_examples/sdxl/), [SDXL Turbo](https://comfyanonymous.github.io/ComfyUI_examples/sdturbo/)
44+
- [Stable Cascade](https://comfyanonymous.github.io/ComfyUI_examples/stable_cascade/)
45+
- [SD3 and SD3.5](https://comfyanonymous.github.io/ComfyUI_examples/sd3/)
46+
- Pixart Alpha and Sigma
47+
- [AuraFlow](https://comfyanonymous.github.io/ComfyUI_examples/aura_flow/)
48+
- [HunyuanDiT](https://comfyanonymous.github.io/ComfyUI_examples/hunyuan_dit/)
49+
- [Flux](https://comfyanonymous.github.io/ComfyUI_examples/flux/)
50+
- Video Models
51+
- [Stable Video Diffusion](https://comfyanonymous.github.io/ComfyUI_examples/video/)
52+
- [Mochi](https://comfyanonymous.github.io/ComfyUI_examples/mochi/)
53+
- [LTX-Video](https://comfyanonymous.github.io/ComfyUI_examples/ltxv/)
54+
- [Hunyuan Video](https://comfyanonymous.github.io/ComfyUI_examples/hunyuan_video/)
55+
- [Stable Audio](https://comfyanonymous.github.io/ComfyUI_examples/audio/)
4556
- Asynchronous Queue system
4657
- Many optimizations: Only re-executes the parts of the workflow that changes between executions.
4758
- Smart memory management: can automatically run models on GPUs with as low as 1GB vram.
@@ -61,9 +72,6 @@ This ui will let you design and execute advanced stable diffusion pipelines usin
6172
- [GLIGEN](https://comfyanonymous.github.io/ComfyUI_examples/gligen/)
6273
- [Model Merging](https://comfyanonymous.github.io/ComfyUI_examples/model_merging/)
6374
- [LCM models and Loras](https://comfyanonymous.github.io/ComfyUI_examples/lcm/)
64-
- [SDXL Turbo](https://comfyanonymous.github.io/ComfyUI_examples/sdturbo/)
65-
- [AuraFlow](https://comfyanonymous.github.io/ComfyUI_examples/aura_flow/)
66-
- [HunyuanDiT](https://comfyanonymous.github.io/ComfyUI_examples/hunyuan_dit/)
6775
- Latent previews with [TAESD](#how-to-show-high-quality-previews)
6876
- Starts up very fast.
6977
- Works fully offline: will never download anything.
@@ -101,6 +109,8 @@ Workflow examples can be found on the [Examples page](https://comfyanonymous.git
101109
| `Q` | Toggle visibility of the queue |
102110
| `H` | Toggle visibility of history |
103111
| `R` | Refresh graph |
112+
| `F` | Show/Hide menu |
113+
| `.` | Fit view to selection (Whole graph when nothing is selected) |
104114
| Double-Click LMB | Open node quick search palette |
105115
| `Shift` + Drag | Move multiple wires at once |
106116
| `Ctrl` + `Alt` + LMB | Disconnect all wires from clicked slot |
@@ -145,7 +155,31 @@ AMD users can install rocm and pytorch with pip if you don't have it already ins
145155

146156
This is the command to install the nightly with ROCm 6.2 which might have some performance improvements:
147157

148-
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2```
158+
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2.4```
159+
160+
### Intel GPUs (Windows and Linux)
161+
162+
(Option 1) Intel Arc GPU users can install native PyTorch with torch.xpu support using pip (currently available in PyTorch nightly builds). More information can be found [here](https://pytorch.org/docs/main/notes/get_start_xpu.html)
163+
164+
1. To install PyTorch nightly, use the following command:
165+
166+
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/xpu```
167+
168+
2. Launch ComfyUI by running `python main.py`
169+
170+
171+
(Option 2) Alternatively, Intel GPUs supported by Intel Extension for PyTorch (IPEX) can leverage IPEX for improved performance.
172+
173+
1. For Intel® Arc™ A-Series Graphics utilizing IPEX, create a conda environment and use the commands below:
174+
175+
```
176+
conda install libuv
177+
pip install torch==2.3.1.post0+cxx11.abi torchvision==0.18.1.post0+cxx11.abi torchaudio==2.3.1.post0+cxx11.abi intel-extension-for-pytorch==2.3.110.post0+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/cn/
178+
```
179+
180+
For other supported Intel GPUs with IPEX, visit [Installation](https://intel.github.io/intel-extension-for-pytorch/index.html#installation?platform=gpu) for more information.
181+
182+
Additional discussion and help can be found [here](https://github.com/comfyanonymous/ComfyUI/discussions/476).
149183

150184
### NVIDIA
151185

@@ -155,7 +189,7 @@ Nvidia users should install stable pytorch using this command:
155189

156190
This is the command to install pytorch nightly instead which might have performance improvements:
157191

158-
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu124```
192+
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu126```
159193

160194
#### Troubleshooting
161195

@@ -175,17 +209,6 @@ After this you should have everything installed and can proceed to running Comfy
175209

176210
### Others:
177211

178-
#### Intel GPUs
179-
180-
Intel GPU support is available for all Intel GPUs supported by Intel's Extension for Pytorch (IPEX) with the support requirements listed in the [Installation](https://intel.github.io/intel-extension-for-pytorch/index.html#installation?platform=gpu) page. Choose your platform and method of install and follow the instructions. The steps are as follows:
181-
182-
1. Start by installing the drivers or kernel listed or newer in the Installation page of IPEX linked above for Windows and Linux if needed.
183-
1. Follow the instructions to install [Intel's oneAPI Basekit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html) for your platform.
184-
1. Install the packages for IPEX using the instructions provided in the Installation page for your platform.
185-
1. Follow the [ComfyUI manual installation](#manual-install-windows-linux) instructions for Windows and Linux and run ComfyUI normally as described above after everything is installed.
186-
187-
Additional discussion and help can be found [here](https://github.com/comfyanonymous/ComfyUI/discussions/476).
188-
189212
#### Apple Mac silicon
190213

191214
You can install ComfyUI in Apple Mac silicon (M1 or M2) with any recent macOS version.
@@ -201,6 +224,16 @@ You can install ComfyUI in Apple Mac silicon (M1 or M2) with any recent macOS ve
201224

202225
```pip install torch-directml``` Then you can launch ComfyUI with: ```python main.py --directml```
203226

227+
#### Ascend NPUs
228+
229+
For models compatible with Ascend Extension for PyTorch (torch_npu). To get started, ensure your environment meets the prerequisites outlined on the [installation](https://ascend.github.io/docs/sources/ascend/quick_install.html) page. Here's a step-by-step guide tailored to your platform and installation method:
230+
231+
1. Begin by installing the recommended or newer kernel version for Linux as specified in the Installation page of torch-npu, if necessary.
232+
2. Proceed with the installation of Ascend Basekit, which includes the driver, firmware, and CANN, following the instructions provided for your specific platform.
233+
3. Next, install the necessary packages for torch-npu by adhering to the platform-specific instructions on the [Installation](https://ascend.github.io/docs/sources/pytorch/install.html#pytorch) page.
234+
4. Finally, adhere to the [ComfyUI manual installation](#manual-install-windows-linux) guide for Linux. Once all components are installed, you can run ComfyUI as described earlier.
235+
236+
204237
# Running
205238

206239
```python main.py```
@@ -213,6 +246,14 @@ For 6700, 6600 and maybe other RDNA2 or older: ```HSA_OVERRIDE_GFX_VERSION=10.3.
213246

214247
For AMD 7600 and maybe other RDNA3 cards: ```HSA_OVERRIDE_GFX_VERSION=11.0.0 python main.py```
215248

249+
### AMD ROCm Tips
250+
251+
You can enable experimental memory efficient attention on pytorch 2.5 in ComfyUI on RDNA3 and potentially other AMD GPUs using this command:
252+
253+
```TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 python main.py --use-pytorch-cross-attention```
254+
255+
You can also try setting this env variable `PYTORCH_TUNABLEOP_ENABLED=1` which might speed things up at the cost of a very slow initial run.
256+
216257
# Notes
217258

218259
Only parts of the graph that have an output with all the correct inputs will be executed.
@@ -298,4 +339,3 @@ This will use a snapshot of the legacy frontend preserved in the [ComfyUI Legacy
298339
### Which GPU should I buy for this?
299340

300341
[See this page for some recommendations](https://github.com/comfyanonymous/ComfyUI/wiki/Which-GPU-should-I-buy-for-ComfyUI)
301-

api_server/routes/internal/internal_routes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class InternalRoutes:
1010
The top level web router for internal routes: /internal/*
1111
The endpoints here should NOT be depended upon. It is for ComfyUI frontend use only.
1212
Check README.md for more information.
13-
1413
'''
1514

1615
def __init__(self, prompt_server):
@@ -41,7 +40,7 @@ async def get_logs(request):
4140
return web.json_response("".join([(l["t"] + " - " + l["m"]) for l in app.logger.get_logs()]))
4241

4342
@self.routes.get('/logs/raw')
44-
async def get_logs(request):
43+
async def get_raw_logs(request):
4544
self.terminal_service.update_size()
4645
return web.json_response({
4746
"entries": list(app.logger.get_logs()),

api_server/services/file_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def list_files(self, directory_key: str) -> List[FileSystemItem]:
1010
if directory_key not in self.allowed_directories:
1111
raise ValueError("Invalid directory key")
1212
directory_path: str = self.allowed_directories[directory_key]
13-
return self.file_system_ops.walk_directory(directory_path)
13+
return self.file_system_ops.walk_directory(directory_path)

0 commit comments

Comments
 (0)