Formatting/cleanup

This commit is contained in:
Margen67 2025-02-15 02:48:18 -08:00
parent 967b0b6aa6
commit 77759ef62e
19 changed files with 119 additions and 128 deletions

View File

@ -1,9 +1,10 @@
# This is the GitHub Workflow that drives full-GPU-enabled tests of pull requests to ComfyUI, when the 'Run-CI-Test' label is added
# Results are reported as checkmarks on the commits, as well as onto https://ci.comfy.org/
name: Pull Request CI Workflow Runs
on:
pull_request_target:
types: [labeled]
types: labeled
jobs:
pr-test-stable:
@ -12,19 +13,19 @@ jobs:
fail-fast: false
matrix:
os: [macos, linux, windows]
python_version: ["3.9", "3.10", "3.11", "3.12"]
cuda_version: ["12.1"]
torch_version: ["stable"]
python_version: ['3.9', '3.10', '3.11', '3.12', '3.13']
cuda_version: ['12.1']
torch_version: ['stable']
include:
- os: macos
runner_label: [self-hosted, macOS]
flags: "--use-pytorch-cross-attention"
flags: '--use-pytorch-cross-attention'
- os: linux
runner_label: [self-hosted, Linux]
flags: ""
flags: ''
- os: windows
runner_label: [self-hosted, Windows]
flags: ""
flags: ''
runs-on: ${{ matrix.runner_label }}
steps:
- name: Test Workflows
@ -35,7 +36,8 @@ jobs:
torch_version: ${{ matrix.torch_version }}
google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
comfyui_flags: ${{ matrix.flags }}
use_prior_commit: 'true'
use_prior_commit: true
comment:
if: ${{ github.event.label.name == 'Run-CI-Test' }}
runs-on: ubuntu-latest

View File

@ -6,18 +6,14 @@ jobs:
ruff:
name: Run Ruff
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: '3.x'
- name: Install Ruff
run: pip install ruff
- name: Run Ruff
run: ruff check .

View File

@ -1,4 +1,4 @@
name: "Release Stable Version"
name: Release Stable Version
on:
workflow_dispatch:
@ -11,25 +11,28 @@ on:
description: 'CUDA version'
required: true
type: string
default: "126"
default: '126'
python_minor:
description: 'Python minor version'
required: true
type: string
default: "12"
default: '12'
python_patch:
description: 'Python patch version'
required: true
type: string
default: "8"
default: '8'
defaults:
run:
shell: bash
jobs:
package_comfy_windows:
permissions:
contents: "write"
packages: "write"
pull-requests: "read"
contents: write
packages: write
pull-requests: read
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
@ -44,29 +47,26 @@ jobs:
cu${{ inputs.cu }}_python_deps.tar
update_comfyui_and_python_dependencies.bat
key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }}
- shell: bash
run: |
- run: |
mv cu${{ inputs.cu }}_python_deps.tar ../
mv update_comfyui_and_python_dependencies.bat ../
cd ..
tar xf cu${{ inputs.cu }}_python_deps.tar
pwd
ls
- shell: bash
run: |
- run: |
cd ..
cp -r ComfyUI ComfyUI_copy
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_embedded.zip
unzip python_embedded.zip -d python_embedded
cd python_embedded
echo ${{ env.MINOR_VERSION }}
echo ${{ inputs.python_minor }}
echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
curl -fLO https://bootstrap.pypa.io/get-pip.py
./python.exe get-pip.py
./python.exe -s -m pip install ../cu${{ inputs.cu }}_python_deps/*
sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth
cd ..
sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth
cd ..
git clone --depth 1 https://github.com/comfyanonymous/taesd
cp taesd/*.pth ./ComfyUI_copy/models/vae_approx/
@ -84,14 +84,13 @@ jobs:
cd ..
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable
7z a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable
mv ComfyUI_windows_portable.7z ComfyUI/ComfyUI_windows_portable_nvidia.7z
cd ComfyUI_windows_portable
python_embedded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu
ls
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:

View File

@ -1,4 +1,5 @@
name: 'Close stale issues'
name: Close stale issues
on:
schedule:
# Run daily at 430 am PT
@ -12,7 +13,7 @@ jobs:
steps:
- uses: actions/stale@v9
with:
stale-issue-message: "This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically."
stale-issue-message: 'This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically.'
days-before-stale: 30
days-before-close: 7
stale-issue-label: 'Stale'

View File

@ -1,15 +1,13 @@
name: Build package
#
# This workflow is a test of the python package build.
# Install Python dependencies across different Python versions.
#
on:
push:
paths:
- "requirements.txt"
- ".github/workflows/test-build.yml"
- 'requirements.txt'
- '.github/workflows/test-build.yml'
jobs:
build:
@ -18,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}

View File

@ -1,6 +1,7 @@
# This is the GitHub Workflow that drives automatic full-GPU-enabled tests of all new commits to the master branch of ComfyUI
# Results are reported as checkmarks on the commits, as well as onto https://ci.comfy.org/
name: Full Comfy CI Workflow Runs
on:
push:
branches:
@ -22,19 +23,19 @@ jobs:
matrix:
# os: [macos, linux, windows]
os: [macos, linux]
python_version: ["3.9", "3.10", "3.11", "3.12"]
cuda_version: ["12.1"]
torch_version: ["stable"]
python_version: ['3.9', '3.10', '3.11', '3.12', '3.13']
cuda_version: ['12.1']
torch_version: ['stable']
include:
- os: macos
runner_label: [self-hosted, macOS]
flags: "--use-pytorch-cross-attention"
flags: '--use-pytorch-cross-attention'
- os: linux
runner_label: [self-hosted, Linux]
flags: ""
flags: ''
# - os: windows
# runner_label: [self-hosted, Windows]
# flags: ""
# flags: ''
runs-on: ${{ matrix.runner_label }}
steps:
- name: Test Workflows
@ -51,13 +52,13 @@ jobs:
# fail-fast: true
# matrix:
# os: [windows]
# python_version: ["3.9", "3.10", "3.11", "3.12"]
# cuda_version: ["12.1"]
# torch_version: ["nightly"]
# python_version: ['3.9', '3.10', '3.11', '3.12', '3.13']
# cuda_version: ['12.1']
# torch_version: ['nightly']
# include:
# - os: windows
# runner_label: [self-hosted, Windows]
# flags: ""
# flags: ''
# runs-on: ${{ matrix.runner_label }}
# steps:
# - name: Test Workflows
@ -74,16 +75,16 @@ jobs:
fail-fast: false
matrix:
os: [macos, linux]
python_version: ["3.11"]
cuda_version: ["12.1"]
torch_version: ["nightly"]
python_version: ['3.11']
cuda_version: ['12.1']
torch_version: ['nightly']
include:
- os: macos
runner_label: [self-hosted, macOS]
flags: "--use-pytorch-cross-attention"
flags: '--use-pytorch-cross-attention'
- os: linux
runner_label: [self-hosted, Linux]
flags: ""
flags: ''
runs-on: ${{ matrix.runner_label }}
steps:
- name: Test Workflows

View File

@ -2,9 +2,9 @@ name: Test server launches without errors
on:
push:
branches: [ main, master ]
branches: master
pull_request:
branches: [ main, master ]
branches: master
jobs:
test:
@ -12,9 +12,6 @@ jobs:
steps:
- name: Checkout ComfyUI
uses: actions/checkout@v4
with:
repository: "comfyanonymous/ComfyUI"
path: "ComfyUI"
- uses: actions/setup-python@v5
with:
python-version: '3.9'
@ -24,22 +21,19 @@ jobs:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
pip install wait-for-it
working-directory: ComfyUI
- name: Start ComfyUI server
run: |
python main.py --cpu 2>&1 | tee console_output.log &
wait-for-it --service 127.0.0.1:8188 -t 30
working-directory: ComfyUI
- name: Check for unhandled exceptions in server log
run: |
if grep -qE "Exception|Error" console_output.log; then
echo "Unhandled exception/error found in server log."
exit 1
fi
working-directory: ComfyUI
- uses: actions/upload-artifact@v4
if: always()
with:
name: console-output
path: ComfyUI/console_output.log
path: console_output.log
retention-days: 30

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: "Frontend version to update to (e.g., 1.0.0)"
description: 'Frontend version to update to (e.g., 1.0.0)'
required: true
type: string
@ -14,7 +14,6 @@ jobs:
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout ComfyUI
uses: actions/checkout@v4
@ -47,8 +46,8 @@ jobs:
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PR_BOT_PAT }}
commit-message: "Update frontend to v${{ github.event.inputs.version }}"
title: "Frontend Update: v${{ github.event.inputs.version }}"
commit-message: Update frontend to v${{ github.event.inputs.version }}
title: 'Frontend Update: v${{ github.event.inputs.version }}'
body: |
Automated PR to update frontend content to version ${{ github.event.inputs.version }}

View File

@ -3,15 +3,14 @@ name: Update Version File
on:
pull_request:
paths:
- "pyproject.toml"
branches:
- master
- 'pyproject.toml'
branches: master
jobs:
update-version:
runs-on: ubuntu-latest
# Don't run on fork PRs
if: github.event.pull_request.head.repo.full_name == github.repository
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
permissions:
pull-requests: write
contents: write
@ -23,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: '3.11'
- name: Install dependencies
run: |

View File

@ -1,4 +1,4 @@
name: "Windows Release dependencies"
name: Windows Release dependencies
on:
workflow_dispatch:
@ -7,33 +7,37 @@ on:
description: 'xformers version'
required: false
type: string
default: ""
default: ''
extra_dependencies:
description: 'extra dependencies'
required: false
type: string
default: ""
default: ''
cu:
description: 'cuda version'
required: true
type: string
default: "126"
default: '126'
python_minor:
description: 'python minor version'
required: true
type: string
default: "12"
default: '12'
python_patch:
description: 'python patch version'
required: true
type: string
default: "8"
default: '8'
# push:
# branches:
# - master
defaults:
run:
shell: bash
jobs:
build_dependencies:
runs-on: windows-latest
@ -42,9 +46,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.${{ inputs.python_minor }}.${{ inputs.python_patch }}
- shell: bash
run: |
- run: |
echo "@echo off
call update_comfyui.bat nopause
echo -
@ -58,11 +60,10 @@ jobs:
python -m pip wheel --no-cache-dir torch torchvision torchaudio ${{ inputs.xformers }} ${{ inputs.extra_dependencies }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r requirements.txt pygit2 -w ./temp_wheel_dir
python -m pip install --no-cache-dir ./temp_wheel_dir/*
echo installed basic
echo "installed basic"
ls -lah temp_wheel_dir
mv temp_wheel_dir cu${{ inputs.cu }}_python_deps
tar cf cu${{ inputs.cu }}_python_deps.tar cu${{ inputs.cu }}_python_deps
- uses: actions/cache/save@v4
with:
path: |

View File

@ -1,4 +1,4 @@
name: "Windows Release Nightly pytorch"
name: Windows Release Nightly pytorch
on:
workflow_dispatch:
@ -7,29 +7,32 @@ on:
description: 'cuda version'
required: true
type: string
default: "126"
default: '126'
python_minor:
description: 'python minor version'
required: true
type: string
default: "13"
default: '13'
python_patch:
description: 'python patch version'
required: true
type: string
default: "1"
default: '1'
# push:
# branches:
# - master
# branches: master
defaults:
run:
shell: bash
jobs:
build:
permissions:
contents: "write"
packages: "write"
pull-requests: "read"
contents: write
packages: write
pull-requests: read
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
@ -39,15 +42,14 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.${{ inputs.python_minor }}.${{ inputs.python_patch }}
- shell: bash
run: |
- run: |
cd ..
cp -r ComfyUI ComfyUI_copy
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_embedded.zip
unzip python_embedded.zip -d python_embedded
cd python_embedded
echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
curl -fLO https://bootstrap.pypa.io/get-pip.py
./python.exe get-pip.py
python -m pip wheel torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 -w ../temp_wheel_dir
ls ../temp_wheel_dir
@ -74,18 +76,17 @@ jobs:
pause" > ./update/update_comfyui_and_python_dependencies.bat
cd ..
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable_nightly_pytorch.7z ComfyUI_windows_portable_nightly_pytorch
7z a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable_nightly_pytorch.7z ComfyUI_windows_portable_nightly_pytorch
mv ComfyUI_windows_portable_nightly_pytorch.7z ComfyUI/ComfyUI_windows_portable_nvidia_or_cpu_nightly_pytorch.7z
cd ComfyUI_windows_portable_nightly_pytorch
python_embedded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu
ls
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ComfyUI_windows_portable_nvidia_or_cpu_nightly_pytorch.7z
tag: "latest"
tag: latest
overwrite: true

View File

@ -1,4 +1,4 @@
name: "Windows Release packaging"
name: Windows Release packaging
on:
workflow_dispatch:
@ -7,29 +7,32 @@ on:
description: 'cuda version'
required: true
type: string
default: "126"
default: '126'
python_minor:
description: 'python minor version'
required: true
type: string
default: "12"
default: '12'
python_patch:
description: 'python patch version'
required: true
type: string
default: "8"
default: '8'
# push:
# branches:
# - master
# branches: master
defaults:
run:
shell: bash
jobs:
package_comfyui:
permissions:
contents: "write"
packages: "write"
pull-requests: "read"
contents: write
packages: write
pull-requests: read
runs-on: windows-latest
steps:
- uses: actions/cache/restore@v4
@ -39,8 +42,7 @@ jobs:
cu${{ inputs.cu }}_python_deps.tar
update_comfyui_and_python_dependencies.bat
key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }}
- shell: bash
run: |
- run: |
mv cu${{ inputs.cu }}_python_deps.tar ../
mv update_comfyui_and_python_dependencies.bat ../
cd ..
@ -52,15 +54,14 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- shell: bash
run: |
- run: |
cd ..
cp -r ComfyUI ComfyUI_copy
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_embedded.zip
unzip python_embedded.zip -d python_embedded
cd python_embedded
echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
curl -fLO https://bootstrap.pypa.io/get-pip.py
./python.exe get-pip.py
./python.exe -s -m pip install ../cu${{ inputs.cu }}_python_deps/*
sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth
@ -82,18 +83,17 @@ jobs:
cd ..
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable
7z a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable
mv ComfyUI_windows_portable.7z ComfyUI/new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z
cd ComfyUI_windows_portable
python_embedded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu
ls
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z
tag: "latest"
tag: latest
overwrite: true

View File

@ -11,7 +11,7 @@ stderr_interceptor = None
class LogInterceptor(io.TextIOWrapper):
def __init__(self, stream, *args, **kwargs):
def __init__(self, stream, *args, **kwargs):
buffer = stream.buffer
encoding = stream.encoding
super().__init__(buffer, *args, **kwargs, encoding=encoding, line_buffering=stream.line_buffering)

View File

@ -587,7 +587,7 @@ def get_sorted_list_via_attr(objects: list, attr: str) -> list:
sorted_list.extend(object_list)
return sorted_list
def create_transformer_options_from_hooks(model: ModelPatcher, hooks: HookGroup, transformer_options: dict[str]=None):
def create_transformer_options_from_hooks(model: ModelPatcher, hooks: HookGroup, transformer_options: dict[str]=None):
# if no hooks or is not a ModelPatcher for sampling, return empty dict
if hooks is None or model.is_clip:
return {}

View File

@ -601,10 +601,10 @@ class PixArtAlpha(supported_models_base.BASE):
}
sampling_settings = {
"beta_schedule" : "sqrt_linear",
"linear_start" : 0.0001,
"linear_end" : 0.02,
"timesteps" : 1000,
"beta_schedule": "sqrt_linear",
"linear_start": 0.0001,
"linear_end": 0.02,
"timesteps": 1000,
}
unet_extra_config = {}
@ -664,8 +664,8 @@ class HunyuanDiT1(HunyuanDiT):
unet_extra_config = {}
sampling_settings = {
"linear_start" : 0.00085,
"linear_end" : 0.03,
"linear_start": 0.00085,
"linear_end": 0.03,
}
class Flux(supported_models_base.BASE):

View File

@ -443,8 +443,8 @@ PIXART_MAP_BLOCK = {
("mlp.fc1.bias", "ff.net.0.proj.bias"),
("mlp.fc2.weight", "ff.net.2.weight"),
("mlp.fc2.bias", "ff.net.2.bias"),
("cross_attn.proj.weight" ,"attn2.to_out.0.weight"),
("cross_attn.proj.bias" ,"attn2.to_out.0.bias"),
("cross_attn.proj.weight", "attn2.to_out.0.weight"),
("cross_attn.proj.bias", "attn2.to_out.0.bias"),
}
def pixart_to_diffusers(mmdit_config, output_prefix=""):

View File

@ -8,7 +8,7 @@ class Morphology:
@classmethod
def INPUT_TYPES(s):
return {"required": {"image": ("IMAGE",),
"operation": (["erode", "dilate", "open", "close", "gradient", "bottom_hat", "top_hat"],),
"operation": (["erode", "dilate", "open", "close", "gradient", "bottom_hat", "top_hat"],),
"kernel_size": ("INT", {"default": 3, "min": 3, "max": 999, "step": 1}),
}}

View File

@ -84,7 +84,7 @@ class CacheHelper:
cache_helper = CacheHelper()
extension_mimetypes_cache = {
"webp" : "image",
"webp": "image",
}
def map_legacy(folder_name: str) -> str:

View File

@ -1955,7 +1955,7 @@ NODE_CLASS_MAPPINGS = {
"ImageBatch": ImageBatch,
"ImagePadForOutpaint": ImagePadForOutpaint,
"EmptyImage": EmptyImage,
"ConditioningAverage": ConditioningAverage ,
"ConditioningAverage": ConditioningAverage,
"ConditioningCombine": ConditioningCombine,
"ConditioningConcat": ConditioningConcat,
"ConditioningSetArea": ConditioningSetArea,
@ -2042,7 +2042,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"LatentUpscaleBy": "Upscale Latent By",
"LatentComposite": "Latent Composite",
"LatentBlend": "Latent Blend",
"LatentFromBatch" : "Latent From Batch",
"LatentFromBatch": "Latent From Batch",
"RepeatLatentBatch": "Repeat Latent Batch",
# Image
"SaveImage": "Save Image",