Compare commits

...

6 Commits

Author SHA1 Message Date
Victor
957fa759e4
Merge bcd1b1c11e into 38d0493825 2026-01-05 10:10:50 +08:00
comfyanonymous
38d0493825
Fix case where upscale model wouldn't be moved to cpu. (#11633)
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
2026-01-04 19:13:50 -05:00
Victor
bcd1b1c11e
Merge branch 'comfyanonymous:master' into updater-proxy 2025-10-28 15:00:11 +08:00
Victor Wong
29142227e3 Merge branch 'master' into updater-proxy 2025-01-06 21:41:06 +08:00
Victor Wong
37f38828f1 Add new line at end of file 2025-01-06 21:40:32 +08:00
Victor Wong
6a4064fd7e Allow setting http proxy in updater 2025-01-03 20:41:20 +08:00
4 changed files with 32 additions and 18 deletions

View File

@ -5,10 +5,10 @@ import os
import shutil
import filecmp
def pull(repo, remote_name='origin', branch='master'):
def pull(repo, remote_name='origin', branch='master', proxy=None):
for remote in repo.remotes:
if remote.name == remote_name:
remote.fetch()
remote.fetch(proxy=proxy)
remote_master_id = repo.lookup_reference('refs/remotes/origin/%s' % (branch)).target
merge_result, _ = repo.merge_analysis(remote_master_id)
# Up to date, do nothing
@ -46,6 +46,14 @@ def pull(repo, remote_name='origin', branch='master'):
pygit2.option(pygit2.GIT_OPT_SET_OWNER_VALIDATION, 0)
repo_path = str(sys.argv[1])
proxy = None
if '--proxy' in sys.argv:
proxy_index = sys.argv.index('--proxy')
if proxy_index + 1 < len(sys.argv):
proxy = sys.argv[proxy_index + 1]
if len(proxy)<=0:
proxy = None
repo = pygit2.Repository(repo_path)
ident = pygit2.Signature('comfyui', 'comfy@ui')
try:
@ -90,7 +98,7 @@ else:
repo.checkout(ref)
print("pulling latest changes") # noqa: T201
pull(repo)
pull(repo, proxy=proxy)
if "--stable" in sys.argv:
def latest_tag(repo):

View File

@ -1,8 +1,10 @@
@echo off
..\python_embeded\python.exe .\update.py ..\ComfyUI\
:: Set the http proxy here like `set proxy="http://127.0.0.1:888/"`. No spacebar allowed.
set proxy=""
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --proxy %proxy%
if exist update_new.py (
move /y update_new.py update.py
echo Running updater again since it got updated.
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --skip_self_update
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --skip_self_update --proxy %proxy%
)
if "%~1"=="" pause

View File

@ -1,8 +1,10 @@
@echo off
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --stable
:: Set the http proxy here like `set proxy="http://127.0.0.1:888/"`. No spacebar allowed.
set proxy=""
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --proxy %proxy% --stable
if exist update_new.py (
move /y update_new.py update.py
echo Running updater again since it got updated.
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --skip_self_update --stable
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --skip_self_update --proxy %proxy% --stable
)
if "%~1"=="" pause

View File

@ -78,18 +78,20 @@ class ImageUpscaleWithModel(io.ComfyNode):
overlap = 32
oom = True
while oom:
try:
steps = in_img.shape[0] * comfy.utils.get_tiled_scale_steps(in_img.shape[3], in_img.shape[2], tile_x=tile, tile_y=tile, overlap=overlap)
pbar = comfy.utils.ProgressBar(steps)
s = comfy.utils.tiled_scale(in_img, lambda a: upscale_model(a), tile_x=tile, tile_y=tile, overlap=overlap, upscale_amount=upscale_model.scale, pbar=pbar)
oom = False
except model_management.OOM_EXCEPTION as e:
tile //= 2
if tile < 128:
raise e
try:
while oom:
try:
steps = in_img.shape[0] * comfy.utils.get_tiled_scale_steps(in_img.shape[3], in_img.shape[2], tile_x=tile, tile_y=tile, overlap=overlap)
pbar = comfy.utils.ProgressBar(steps)
s = comfy.utils.tiled_scale(in_img, lambda a: upscale_model(a), tile_x=tile, tile_y=tile, overlap=overlap, upscale_amount=upscale_model.scale, pbar=pbar)
oom = False
except model_management.OOM_EXCEPTION as e:
tile //= 2
if tile < 128:
raise e
finally:
upscale_model.to("cpu")
upscale_model.to("cpu")
s = torch.clamp(s.movedim(-3,-1), min=0, max=1.0)
return io.NodeOutput(s)