Skip to content

Commit 83c670a

Browse files
authored
Merge branch 'main' into qwen-lora-suport-standalone
2 parents e45f9b6 + 13b6d07 commit 83c670a

157 files changed

Lines changed: 38267 additions & 7309 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/1-bug-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ body:
88
attributes:
99
label: Checklist
1010
options:
11-
- label: 1. I have searched for related issues and FAQs (https://github.com/mit-han-lab/nunchaku/blob/main/docs/faq.md) but was unable to find a solution.
11+
- label: 1. I have searched for related issues and FAQs (https://github.com/nunchaku-tech/nunchaku/blob/main/docs/faq.md) but was unable to find a solution.
1212
- label: 2. The issue persists in the latest version.
1313
- label: 3. Please note that without environment information and a minimal reproducible example, it will be difficult for us to reproduce and address the issue, which may delay our response.
14-
- label: 4. If your report is a question rather than a bug, please submit it as a discussion at https://github.com/mit-han-lab/ComfyUI-nunchaku/discussions/new/choose. Otherwise, this issue will be closed.
14+
- label: 4. If your report is a question rather than a bug, please submit it as a discussion at https://github.com/nunchaku-tech/ComfyUI-nunchaku/discussions/new/choose. Otherwise, this issue will be closed.
1515
- label: 5. I will do my best to describe the issue in English.
1616
- type: textarea
1717
attributes:

.github/ISSUE_TEMPLATE/2-feature-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
label: Checklist
99
options:
10-
- label: 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/mit-han-lab/ComfyUI-nunchaku/discussions/new/choose. Otherwise, it will be closed.
10+
- label: 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/nunchaku-tech/ComfyUI-nunchaku/discussions/new/choose. Otherwise, it will be closed.
1111
- label: 2. I will do my best to describe the issue in English.
1212
- type: textarea
1313
attributes:

.github/pull_request_template.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Thank you for your contribution—we truly appreciate it! To help us review your pull request efficiently, please follow the guidelines below. If anything is unclear, feel free to open the PR and ask for clarification. You can also refer to our [contribution guide](https://nunchaku.tech/docs/ComfyUI-nunchaku/developer/contribution_guide.html) for more details. -->
2+
3+
## Motivation
4+
5+
<!-- Explain the purpose of this PR and the goals it aims to achieve. -->
6+
7+
## Modifications
8+
9+
<!-- Describe the changes made in this PR. -->
10+
11+
## Checklist
12+
13+
- [ ] Code is formatted using Pre-Commit hooks (run `pre-commit run --all-files`).
14+
- [ ] Relevant unit tests are added in the [`tests/workflows`](../tests/workflows) directory following the guidance in the [Contribution Guide](https://nunchaku.tech/docs/comfyui-nunchaku/developer/contribution_guide.html).
15+
- [ ] Reference images are uploaded to PR comments and URLs are added to `test_cases.json`.
16+
- [ ] Additional test data (if needed) is registered in [`test_data/inputs.yaml`](../test_data/inputs.yaml).
17+
- [ ] Additional models (if needed) are registered in [`scripts/download_models.py`](../scripts/download_models.py) and [`test_data/models.yaml`](../test_data/models.yaml).
18+
- [ ] Additional custom nodes (if needed) are added to [`.github/workflows/pr-test.yaml`](../.github/workflows/pr-test.yaml).
19+
- [ ] **For reviewers:** If you're only helping merge the main branch and haven't contributed code to this PR, please remove yourself as a co-author when merging.
20+
- [ ] Please feel free to join our [Discord](https://discord.gg/Wk6PnwX9Sm) or [WeChat](https://huggingface.co/datasets/nunchaku-tech/cdn/blob/main/nunchaku/assets/wechat.jpg) to discuss your PR.
Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,56 @@
11
name: Build ComfyUI Desktop
22
on:
33
workflow_dispatch:
4+
repository_dispatch:
5+
types: [build-desktop]
46
permissions:
57
contents: write
68
jobs:
79
build-windows:
810
name: Build ComfyUI Desktop - PyTorch ${{ matrix.pytorch_version }}
911
runs-on: windows-latest
1012
strategy:
13+
max-parallel: 1
1114
matrix:
12-
pytorch_version: ['2.7']
15+
pytorch_version: ['2.7', '2.8', '2.9']
1316
steps:
1417
- name: Check out code
1518
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.client_payload.ref || github.ref }}
21+
if: success()
22+
- name: Show latest commit
23+
run: git log -1 --oneline
24+
shell: bash
25+
- name: Setup Python 3.12
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
if: success()
30+
- name: Setup Node.js 20.18.0
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20.18.0'
34+
if: success()
1635
- name: Extract version from pyproject.toml
1736
id: get_version
1837
run: |
1938
$VERSION = (Get-Content pyproject.toml | Select-String '^version = "(.+)"').Matches.Groups[1].Value
2039
echo "version=$VERSION" >> $env:GITHUB_OUTPUT
2140
echo "Extracted ComfyUI-nunchaku version: $VERSION"
2241
shell: pwsh
42+
if: success()
2343
- name: Get latest nunchaku release version
2444
id: get_nunchaku_version
2545
run: |
26-
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/nunchaku-tech/nunchaku/releases/latest" -Headers @{ "User-Agent" = "GitHub Actions" }
46+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/nunchaku-tech/nunchaku/releases/latest" -Headers @{ "Authorization" = "Bearer $env:GITHUB_TOKEN"; "User-Agent" = "GitHub Actions" }
2747
$NUNCHAKU_VERSION = $response.tag_name -replace '^v', ''
2848
echo "nunchaku_version=$NUNCHAKU_VERSION" >> $env:GITHUB_OUTPUT
2949
echo "Latest nunchaku release: $NUNCHAKU_VERSION"
3050
shell: pwsh
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
if: success()
3154
- name: Run build script
3255
run: |
3356
cd ..
@@ -36,31 +59,45 @@ jobs:
3659
env:
3760
NUNCHAKU_VERSION: ${{ steps.get_nunchaku_version.outputs.nunchaku_version }}
3861
TORCH_VERSION: ${{ matrix.pytorch_version }}
62+
if: success()
3963
- name: List build output
4064
run: |
4165
Get-ChildItem -Path "..\desktop\dist" -ErrorAction SilentlyContinue | Format-Table Name, Length, LastWriteTime
4266
shell: pwsh
43-
if: always()
44-
- name: Find build artifacts
45-
id: find_artifacts
67+
if: success()
68+
- name: Copy and rename artifacts
4669
run: |
47-
$ARTIFACT_PATH = Get-ChildItem -Path "..\desktop\dist\Comfy-*-win.zip" | Select-Object -First 1 -ExpandProperty FullName
48-
echo "artifact_path=$ARTIFACT_PATH" >> $env:GITHUB_OUTPUT
49-
echo "Found artifact: $ARTIFACT_PATH"
50-
shell: pwsh
70+
dir ..\desktop\dist
71+
mkdir artifacts
72+
for %%f in (..\desktop\dist\*.zip) do (
73+
echo Renaming %%~nxf to ComfyUI-nunchaku-${{ steps.get_version.outputs.version }}-torch${{ matrix.pytorch_version }}-desktop-win.zip
74+
move "%%f" "artifacts\ComfyUI-nunchaku-${{ steps.get_version.outputs.version }}-torch${{ matrix.pytorch_version }}-desktop-win.zip"
75+
)
76+
for %%f in (..\desktop\dist\*.exe) do (
77+
echo Renaming %%~nxf to ComfyUI-nunchaku-${{ steps.get_version.outputs.version }}-torch${{ matrix.pytorch_version }}-desktop-win.exe
78+
move "%%f" "artifacts\ComfyUI-nunchaku-${{ steps.get_version.outputs.version }}-torch${{ matrix.pytorch_version }}-desktop-win.exe"
79+
)
80+
dir artifacts
81+
shell: cmd
5182
if: success()
5283
- name: Upload build artifacts
5384
uses: actions/upload-artifact@v4
5485
with:
55-
name: comfyui-desktop-pytorch-${{ matrix.pytorch_version }}
56-
path: ${{ steps.find_artifacts.outputs.artifact_path }}
86+
name: ComfyUI-nunchaku-${{ steps.get_version.outputs.version }}-torch${{ matrix.pytorch_version }}-desktop-win.zip
87+
path: artifacts/*.zip
5788
retention-days: 7
5889
if: success()
5990
- name: Upload Artifact to Existing Release
6091
uses: softprops/action-gh-release@v1
6192
with:
6293
tag_name: v${{ steps.get_version.outputs.version }}
63-
files: ${{ steps.find_artifacts.outputs.artifact_path }}
94+
files: artifacts/*.zip
6495
env:
6596
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6697
if: success()
98+
- name: Clean up
99+
run: |
100+
cd ..
101+
rm -rf desktop
102+
shell: cmd
103+
if: always()
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
@echo off
2+
setlocal
3+
4+
REM ==============================
5+
REM ComfyUI Desktop Build Script
6+
REM ==============================
7+
8+
REM Use environment variables if set, otherwise use defaults
9+
if not defined TORCH_VERSION set TORCH_VERSION=2.7
10+
if not defined NUNCHAKU_VERSION set NUNCHAKU_VERSION=1.0.0
11+
12+
echo Using TORCH_VERSION=%TORCH_VERSION%
13+
echo Using NUNCHAKU_VERSION=%NUNCHAKU_VERSION%
14+
15+
REM Set version-specific defaults, which is the desktop Python version
16+
set PYTHON_VERSION=3.12
17+
REM Node.js version must be complete version string instead of 20 or 20.19
18+
set NODE_VERSION=20.18.0
19+
set YARN_VERSION=4.5.0
20+
set CUDA_PIP_INDEX=cu128
21+
22+
REM Set torchaudio and torchvision versions based on TORCH_VERSION
23+
if "%TORCH_VERSION%"=="2.7" (
24+
set TORCHAUDIO_VERSION=2.7
25+
set TORCHVISION_VERSION=0.22
26+
) else if "%TORCH_VERSION%"=="2.8" (
27+
set TORCHAUDIO_VERSION=2.8
28+
set TORCHVISION_VERSION=0.23
29+
) else if "%TORCH_VERSION%"=="2.9" (
30+
set TORCHAUDIO_VERSION=2.9
31+
set TORCHVISION_VERSION=0.24
32+
) else (
33+
echo Warning: Unknown TORCH_VERSION=%TORCH_VERSION%, using default versions
34+
set TORCHAUDIO_VERSION=%TORCH_VERSION%
35+
set TORCHVISION_VERSION=0.22
36+
)
37+
38+
set PYTHON_VERSION_STR=%PYTHON_VERSION:.=%
39+
40+
REM 1. Install uv package
41+
echo Installing uv package...
42+
python -m pip install --upgrade pip || (
43+
echo ERROR: Failed to upgrade pip
44+
exit /b 1
45+
)
46+
python -m pip install uv || (
47+
echo ERROR: Failed to install uv
48+
exit /b 1
49+
)
50+
51+
REM 2. Clone ComfyUI desktop repo
52+
echo Cloning ComfyUI Desktop...
53+
git clone https://github.com/nunchaku-tech/desktop.git || (
54+
echo ERROR: Failed to clone desktop repository
55+
exit /b 1
56+
)
57+
cd desktop || (
58+
echo ERROR: Failed to enter desktop directory
59+
exit /b 1
60+
)
61+
git checkout ComfyUI-nunchaku-1.0.2 || (
62+
echo ERROR: Failed to checkout dev branch
63+
exit /b 1
64+
)
65+
git log -1 --oneline
66+
67+
REM 3. Install Yarn using corepack
68+
echo Installing yarn...
69+
call corepack enable || (
70+
echo ERROR: Failed to enable corepack
71+
exit /b 1
72+
)
73+
call corepack prepare yarn@%YARN_VERSION% --activate || (
74+
echo ERROR: Failed to prepare yarn
75+
exit /b 1
76+
)
77+
78+
REM 4. Install node modules and rebuild electron
79+
echo Rebuilding native modules...
80+
call yarn install || (
81+
echo ERROR: Failed to run yarn install
82+
exit /b 1
83+
)
84+
call npx --yes electron-rebuild || (
85+
echo ERROR: Failed to rebuild electron
86+
exit /b 1
87+
)
88+
call yarn make:assets || (
89+
echo ERROR: Failed to make assets
90+
exit /b 1
91+
)
92+
93+
REM 5. Overwrite override.txt with torch version + custom nunchaku wheel
94+
echo Writing override.txt...
95+
96+
xcopy /E /I /Y /H ..\ComfyUI-nunchaku assets\ComfyUI\custom_nodes\ComfyUI-nunchaku || (
97+
echo ERROR: Failed to copy ComfyUI-nunchaku to assets
98+
exit /b 1
99+
)
100+
101+
set NUNCHAKU_URL=https://github.com/nunchaku-tech/nunchaku/releases/download/v%NUNCHAKU_VERSION%/nunchaku-%NUNCHAKU_VERSION%+torch%TORCH_VERSION%-cp%PYTHON_VERSION_STR%-cp%PYTHON_VERSION_STR%-win_amd64.whl
102+
103+
(
104+
echo torch==%TORCH_VERSION%+%CUDA_PIP_INDEX%
105+
echo torchaudio==%TORCHAUDIO_VERSION%+%CUDA_PIP_INDEX%
106+
echo torchvision==%TORCHVISION_VERSION%+%CUDA_PIP_INDEX%
107+
echo nunchaku @ %NUNCHAKU_URL%
108+
) > assets\override.txt
109+
echo nunchaku >> assets\ComfyUI\requirements.txt
110+
111+
REM 6. Build compiled requirements with uv
112+
echo Rebuilding requirements (windows_nvidia.compiled)...
113+
assets\uv\win\uv.exe pip compile assets\ComfyUI\requirements.txt ^
114+
assets\ComfyUI\custom_nodes\ComfyUI-Manager\requirements.txt ^
115+
assets\ComfyUI\custom_nodes\ComfyUI-nunchaku\requirements.txt ^
116+
--emit-index-annotation --emit-index-url --index-strategy unsafe-best-match ^
117+
-o assets\requirements\windows_nvidia.compiled ^
118+
--override assets\override.txt ^
119+
--index-url https://pypi.org/simple ^
120+
--extra-index-url https://download.pytorch.org/whl/%CUDA_PIP_INDEX% || (
121+
echo ERROR: Failed to compile requirements with uv
122+
exit /b 1
123+
)
124+
125+
REM 7. Build for NVIDIA users on Windows
126+
echo Building ComfyUI for NVIDIA...
127+
call yarn make:nvidia || (
128+
echo ERROR: Failed to build ComfyUI for NVIDIA
129+
exit /b 1
130+
)
131+
132+
echo ========================================
133+
echo ✅ Build process completed successfully!
134+
echo ========================================
135+
136+
endlocal

.github/workflows/pr-test.yaml

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,52 +58,39 @@ jobs:
5858
source $(conda info --base)/etc/profile.d/conda.sh
5959
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
6060
which python
61-
conda install -c conda-forge gxx=11 gcc=11
61+
conda install -c conda-forge gxx=11 gcc=11 libsndfile -y
62+
cd ..
6263
rm -rf nunchaku
6364
git clone --recurse-submodules https://github.com/nunchaku-tech/nunchaku.git
6465
cd nunchaku
65-
pip install torch==2.8 torchvision==0.23 --index-url https://download.pytorch.org/whl/cu128
66-
pip install -e ".[ci]"
67-
- name: Install ComfyUI
66+
pip install uv
67+
uv pip install torch==2.8 torchvision==0.23 --index-url https://download.pytorch.org/whl/cu128
68+
uv pip install -e ".[ci]"
69+
- name: Setup ComfyUI-Nunchaku
6870
run: |
6971
source $(conda info --base)/etc/profile.d/conda.sh
7072
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
7173
which python
74+
uv pip install --torch-backend=auto -e ".[ci]"
7275
pwd
7376
cd ..
74-
rm -rf ComfyUI
75-
mkdir -p ComfyUI
76-
cd ComfyUI
77+
rm -rf test-workspace
78+
mkdir -p test-workspace
79+
cd test-workspace
7780
mkdir -p "${COMFYUI_MODELS_ROOT}"
7881
ln -s "${COMFYUI_MODELS_ROOT}" models
79-
pip install -r ../ComfyUI-nunchaku/requirements.txt
8082
ln -s ../ComfyUI-nunchaku/tests tests
81-
pip install -r tests/requirements.txt
82-
mkdir -p custom_nodes
83-
cd custom_nodes
84-
ln -s ../../ComfyUI-nunchaku
85-
git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git
86-
cd comfyui_controlnet_aux
87-
git checkout cc6b232
88-
cd ..
89-
git clone https://github.com/CY-CHENYUE/ComfyUI-InpaintEasy.git
90-
cd ComfyUI-InpaintEasy
91-
pip install -r requirements.txt
92-
git checkout d631a03
93-
cd ..
94-
cd ..
95-
python custom_nodes/ComfyUI-nunchaku/scripts/download_models.py
96-
mkdir -p input
97-
python custom_nodes/ComfyUI-nunchaku/scripts/download_inputs.py
83+
ln -s ../ComfyUI-nunchaku/test_data test_data
84+
python ../ComfyUI-nunchaku/scripts/setup_custom_nodes.py
9885
- name: Run tests
9986
run: |
10087
source $(conda info --base)/etc/profile.d/conda.sh
10188
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
10289
pwd
103-
cd ../ComfyUI
104-
pytest tests/test_workflows.py -x -vv --reruns 2 --reruns-delay 0
90+
cd ../test-workspace
91+
pytest tests/test_workflows.py -x -vv --reruns 4 --reruns-delay 0
10592
- name: clean up
10693
if: always()
10794
run: |
10895
cd ..
109-
rm -rf nunchaku ComfyUI
96+
rm -rf nunchaku test-workspace

.github/workflows/publish.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ jobs:
1414
steps:
1515
- name: Check out code
1616
uses: actions/checkout@v4
17-
- name: Publish Custom Node
18-
uses: Comfy-Org/publish-node-action@main
19-
with:
20-
personal_access_token: ${{ secrets.COMFYUI_REGISTRY_ACCESS_TOKEN }}
2117
- name: Create GitHub Release
2218
uses: softprops/action-gh-release@v1
2319
with:
2420
tag_name: ${{ github.event.inputs.release_tag }}
2521
generate_release_notes: true
2622
env:
2723
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Update project name for Comfy Registry
25+
run: |
26+
sed -i 's/name = "comfyui-nunchaku"/name = "ComfyUI-nunchaku"/' pyproject.toml
27+
echo "Updated pyproject.toml:"
28+
grep 'name = "ComfyUI-nunchaku"' pyproject.toml
29+
shell: bash
30+
- name: Publish Custom Node
31+
uses: Comfy-Org/publish-node-action@main
32+
with:
33+
personal_access_token: ${{ secrets.COMFYUI_REGISTRY_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)