Try to fix CI

This commit is contained in:
StableLlama
2026-09-11 11:18:19 +02:00
parent 1deac10f15
commit de5b1350d9
3 changed files with 44 additions and 24 deletions
+10 -1
View File
@@ -13,7 +13,16 @@ except:
NUMBER = "FLOAT,INT"
ANY = "*"
ComfyNodeABC = object
ExecutionBlocker = lambda x: x
class ExecutionBlocker:
"""Stand-in used when ComfyUI is not installed (e.g. in the test-suite).
Mirrors ``comfy_execution.graph_utils.ExecutionBlocker``: it only stores
the message, but its class name shows up in the default ``repr`` exactly
like the real one, so callers/tests can still detect a blocker.
"""
def __init__(self, message):
self.message = message
from ._dynamic_input import ContainsDynamicDict
+19 -11
View File
@@ -1270,18 +1270,26 @@ def _discover_save_formats() -> tuple[list[str], list[str]]:
return all_formats, alpha_formats
(_IMAGE_SAVE_FORMATS, _IMAGE_SAVE_ALPHA_FORMATS) = _discover_save_formats()
# Discovering the formats probes the installed Pillow/plugins, so it must not be
# required for importing this module: environments that only inspect the node
# metadata (e.g. the comfy-org/node-diff CI) have no Pillow installed. Fall back
# to the classic formats there instead of failing to load the whole node pack.
try:
(_IMAGE_SAVE_FORMATS, _IMAGE_SAVE_ALPHA_FORMATS) = _discover_save_formats()
except ModuleNotFoundError:
_IMAGE_SAVE_FORMATS = ["png", "jpg", "webp", "jxl", "bmp", "tif", "gif"]
_IMAGE_SAVE_ALPHA_FORMATS = ["png", "webp", "jxl"]
else:
# Always make sure the most common formats are present when the backend
# supports them (guards against an odd Pillow not probing its core formats).
for _token in ("png", "jpg", "webp"):
if _token in _PIL_FORMAT_BY_TOKEN and _PIL_FORMAT_BY_TOKEN[_token] and _token not in _IMAGE_SAVE_FORMATS:
_IMAGE_SAVE_FORMATS.insert(0, _token)
# Always make sure the most common formats are present when the backend supports
# them (guards against an odd Pillow not probing its own core formats).
for _token in ("png", "jpg", "webp"):
if _token in _PIL_FORMAT_BY_TOKEN and _PIL_FORMAT_BY_TOKEN[_token] and _token not in _IMAGE_SAVE_FORMATS:
_IMAGE_SAVE_FORMATS.insert(0, _token)
# Log the supported save formats once at node-load time, so users can see what
# the running Pillow/image plugins can write.
print("Basic data handling: supported image formats: " + ", ".join(_IMAGE_SAVE_FORMATS))
print("Basic data handling: supported IMAGE+MASK (alpha) formats: " + ", ".join(_IMAGE_SAVE_ALPHA_FORMATS))
# Log the supported save formats once at node-load time, so users can see
# what the running Pillow/image plugins can write.
print("Basic data handling: supported image formats: " + ", ".join(_IMAGE_SAVE_FORMATS))
print("Basic data handling: supported IMAGE+MASK (alpha) formats: " + ", ".join(_IMAGE_SAVE_ALPHA_FORMATS))
def _normalize_image_format(format: str) -> str: