From e84bf5f025ffbfe84656ed808b69df3c54142a18 Mon Sep 17 00:00:00 2001 From: doctorpangloss <@hiddenswitch.com> Date: Fri, 22 Aug 2025 18:29:12 -0700 Subject: [PATCH] Fix downloads and tests on Linux --- comfy/model_downloader.py | 11 ++++++++--- comfy_extras/nodes/nodes_custom_sampler.py | 3 ++- tests/conftest.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/comfy/model_downloader.py b/comfy/model_downloader.py index 329941159..9241617db 100644 --- a/comfy/model_downloader.py +++ b/comfy/model_downloader.py @@ -13,8 +13,9 @@ from os.path import join from pathlib import Path from typing import List, Optional, Final, Set +import requests import tqdm -from huggingface_hub import dump_environment_info +from huggingface_hub import dump_environment_info, try_to_load_from_cache from huggingface_hub import hf_hub_download, scan_cache_dir, snapshot_download, HfFileSystem, CacheNotFound from huggingface_hub.utils import GatedRepoError, LocalEntryNotFoundError from requests import Session @@ -143,6 +144,9 @@ def get_or_download(folder_name: str, filename: str, known_files: Optional[List[ revision=known_file.revision, local_dir=hf_destination_dir if args.force_hf_local_dir_mode else None, ) + except requests.exceptions.HTTPError as exc_info: + if exc_info.response.status_code == 401: + raise GatedRepoError(f"{known_file.repo_id}/{known_file.filename}", response=exc_info.response) except IOError as exc_info: logger.error(f"cannot reach huggingface {known_file.repo_id}/{known_file.filename}", exc_info=exc_info) except Exception as exc_info: @@ -305,7 +309,7 @@ KNOWN_CHECKPOINTS: Final[KnownDownloadables] = KnownDownloadables([ HuggingFile("stabilityai/stable-diffusion-3-medium", "sd3_medium_incl_clips_t5xxlfp8.safetensors"), HuggingFile("fal/AuraFlow", "aura_flow_0.1.safetensors"), # stable audio, # uses names from https://comfyanonymous.github.io/ComfyUI_examples/audio/ - HuggingFile("stabilityai/stable-audio-open-1.0", "model.safetensors", save_with_filename="stable_audio_open_1.0.safetensors"), + HuggingFile("Comfy-Org/stable-audio-open-1.0_repackaged", "stable-audio-open-1.0.safetensors", alternate_filenames="stable_audio_open_1.0.safetensors"), # hunyuandit HuggingFile("comfyanonymous/hunyuan_dit_comfyui", "hunyuan_dit_1.0.safetensors"), HuggingFile("comfyanonymous/hunyuan_dit_comfyui", "hunyuan_dit_1.1.safetensors"), @@ -502,7 +506,8 @@ KNOWN_APPROX_VAES: Final[KnownDownloadables] = KnownDownloadables([ KNOWN_VAES: Final[KnownDownloadables] = KnownDownloadables([ HuggingFile("stabilityai/sdxl-vae", "sdxl_vae.safetensors"), HuggingFile("stabilityai/sd-vae-ft-mse-original", "vae-ft-mse-840000-ema-pruned.safetensors"), - HuggingFile("black-forest-labs/FLUX.1-schnell", "ae.safetensors"), + # this is the flux VAE + HuggingFile("Comfy-Org/HiDream-I1_ComfyUI", "split_files/vae/ae.safetensors"), HuggingFile("Comfy-Org/mochi_preview_repackaged", "split_files/vae/mochi_vae.safetensors"), HuggingFile("Comfy-Org/HunyuanVideo_repackaged", "split_files/vae/hunyuan_video_vae_bf16.safetensors"), HuggingFile("comfyanonymous/cosmos_1.0_text_encoder_and_VAE_ComfyUI", "vae/cosmos_cv8x8x8_1.0.safetensors"), diff --git a/comfy_extras/nodes/nodes_custom_sampler.py b/comfy_extras/nodes/nodes_custom_sampler.py index fc6665d6d..c0794de83 100644 --- a/comfy_extras/nodes/nodes_custom_sampler.py +++ b/comfy_extras/nodes/nodes_custom_sampler.py @@ -755,7 +755,8 @@ class DualCFGGuider: "negative": ("CONDITIONING", ), "cfg_conds": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01}), "cfg_cond2_negative": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01}), - "style": (["regular", "nested"],), + }, "optional": { + "style": (["regular", "nested"], {"default": "regular"}), } } diff --git a/tests/conftest.py b/tests/conftest.py index 0d78a3613..3de217d40 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -149,7 +149,7 @@ def comfy_background_server(tmp_path_factory) -> Generator[tuple[Configuration, def comfy_background_server_from_config(configuration): - server_process = multiprocessing.Process(target=run_server, args=(configuration,)) + server_process = multiprocessing.get_context('spawn').Process(target=run_server, args=(configuration,)) server_process.start() # wait for http url to be ready success = False