Publish current ComfyUI O1Key code baseline
Replace the prior release tree with the current plugin, frontend, tests, and documentation. Document retired node IDs and the public Gitea update source.
This commit is contained in:
+31
-35
@@ -1,37 +1,33 @@
|
||||
"""
|
||||
工具模块
|
||||
包含图像处理、配置管理、文件处理等通用工具函数
|
||||
"""
|
||||
"""Shared helpers exposed through lazy imports."""
|
||||
|
||||
from .image_utils import (
|
||||
tensor_to_pil,
|
||||
pil_to_tensor,
|
||||
encode_image_to_base64,
|
||||
decode_base64_to_pil
|
||||
)
|
||||
from .config import load_config, get_api_key
|
||||
from .file_utils import (
|
||||
ImageInfo,
|
||||
load_images_from_folder,
|
||||
pair_images_indexed,
|
||||
pair_images_cartesian,
|
||||
generate_timestamp_filename,
|
||||
save_image,
|
||||
get_folder_image_count
|
||||
)
|
||||
from importlib import import_module
|
||||
|
||||
__all__ = [
|
||||
'tensor_to_pil',
|
||||
'pil_to_tensor',
|
||||
'encode_image_to_base64',
|
||||
'decode_base64_to_pil',
|
||||
'load_config',
|
||||
'get_api_key',
|
||||
'ImageInfo',
|
||||
'load_images_from_folder',
|
||||
'pair_images_indexed',
|
||||
'pair_images_cartesian',
|
||||
'generate_timestamp_filename',
|
||||
'save_image',
|
||||
'get_folder_image_count'
|
||||
]
|
||||
|
||||
_EXPORTS = {
|
||||
"tensor_to_pil": ("image_utils", "tensor_to_pil"),
|
||||
"pil_to_tensor": ("image_utils", "pil_to_tensor"),
|
||||
"encode_image_to_base64": ("image_utils", "encode_image_to_base64"),
|
||||
"decode_base64_to_pil": ("image_utils", "decode_base64_to_pil"),
|
||||
"load_config": ("config", "load_config"),
|
||||
"get_api_key": ("config", "get_api_key"),
|
||||
"ImageInfo": ("file_utils", "ImageInfo"),
|
||||
"load_images_from_folder": ("file_utils", "load_images_from_folder"),
|
||||
"pair_images_indexed": ("file_utils", "pair_images_indexed"),
|
||||
"pair_images_cartesian": ("file_utils", "pair_images_cartesian"),
|
||||
"generate_timestamp_filename": ("file_utils", "generate_timestamp_filename"),
|
||||
"save_image": ("file_utils", "save_image"),
|
||||
"get_folder_image_count": ("file_utils", "get_folder_image_count"),
|
||||
}
|
||||
|
||||
__all__ = list(_EXPORTS)
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
try:
|
||||
module_name, attribute_name = _EXPORTS[name]
|
||||
except KeyError as exc:
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from exc
|
||||
|
||||
value = getattr(import_module(f".{module_name}", __name__), attribute_name)
|
||||
globals()[name] = value
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user