From da6a4eba5307d69bf8cfa90df11ad58892dfc818 Mon Sep 17 00:00:00 2001 From: "eric183.macpro" Date: Sun, 10 Aug 2025 10:11:58 +0800 Subject: [PATCH] add i8n support --- locales/zh-CN.json | 15 +++++++ nodes/image_processing_nodes.py | 12 +++--- pyproject.toml | 73 ++++----------------------------- 3 files changed, 29 insertions(+), 71 deletions(-) create mode 100644 locales/zh-CN.json diff --git a/locales/zh-CN.json b/locales/zh-CN.json new file mode 100644 index 0000000..3b6bd1d --- /dev/null +++ b/locales/zh-CN.json @@ -0,0 +1,15 @@ +{ + "ComfyUI-Only": { + "nodes": { + "Workflow Image Loader (File)": "Workflow图片文件加载器", + "Workflow Image Loader (Image)": "Workflow图片加载器", + "Workflow JSON Parser": "Workflow JSON解析器", + "Load Latent (Advanced)": "高级Latent加载器" + }, + "properties": { + "Optional: Manually input workflow JSON if the image lacks workflow information.": "可选:手动输入workflow JSON,如果图片中没有workflow信息", + "Manual workflow JSON is required as the IMAGE type does not contain original metadata.": "必须手动输入workflow JSON,因为IMAGE类型不包含原始图片元数据", + "Paste ComfyUI workflow JSON here": "粘贴ComfyUI workflow JSON" + } + } +} diff --git a/nodes/image_processing_nodes.py b/nodes/image_processing_nodes.py index 5541e50..fa82cc1 100644 --- a/nodes/image_processing_nodes.py +++ b/nodes/image_processing_nodes.py @@ -40,7 +40,7 @@ class WorkflowImageFileLoader: "workflow_json": ("STRING", { "multiline": True, "default": "", - "placeholder": "可选:手动输入workflow JSON,如果图片中没有workflow信息" + "placeholder": "Optional: Manually input workflow JSON if the image lacks workflow information." }), } } @@ -261,7 +261,7 @@ class WorkflowImageLoader: "workflow_json": ("STRING", { "multiline": True, "default": "", - "placeholder": "必须手动输入workflow JSON,因为IMAGE类型不包含原始图片元数据" + "placeholder": "Manual workflow JSON is required as the IMAGE type does not contain original metadata." }), } } @@ -409,7 +409,7 @@ class WorkflowJSONParser: "workflow_json": ("STRING", { "multiline": True, "default": "", - "placeholder": "粘贴ComfyUI workflow JSON" + "placeholder": "Paste ComfyUI workflow JSON here" }), } } @@ -552,7 +552,7 @@ NODE_CLASS_MAPPINGS = { } NODE_DISPLAY_NAME_MAPPINGS = { - "WorkflowImageFileLoader": "Workflow图片文件加载器", - "WorkflowImageLoader": "Workflow图片加载器", - "WorkflowJSONParser": "Workflow JSON解析器", + "WorkflowImageFileLoader": "Workflow Image Loader (File)", + "WorkflowImageLoader": "Workflow Image Loader (Image)", + "WorkflowJSONParser": "Workflow JSON Parser", } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ba0a6c3..07545e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,73 +1,16 @@ -# 项目构建配置 -# 用于将此包作为独立库发布 - [build-system] -requires = ["setuptools>=61.0", "wheel"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] name = "comfyui-only" -version = "1.0.0" -description = "ComfyUI自定义节点集合,提供图像处理、文本工具和模型包装功能" -readme = "README.md" -license = {text = "MIT"} -authors = [ - {name = "ComfyUI-Only Contributors"} -] -maintainers = [ - {name = "ComfyUI-Only Contributors"} -] -keywords = ["comfyui", "stable-diffusion", "ai", "image-processing", "nodes"] -classifiers = [ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Multimedia :: Graphics", -] -requires-python = ">=3.8" -dependencies = [ - "torch>=1.13.0", - "torchvision>=0.14.0", - "numpy>=1.21.0", - "pillow>=9.0.0", - "opencv-python>=4.5.0", - "tqdm>=4.64.0", -] - -[project.optional-dependencies] -dev = [ - "pytest>=7.0", - "black>=22.0", - "flake8>=5.0", - "mypy>=0.991", -] -full = [ - "transformers>=4.20.0", - "diffusers>=0.10.0", - "accelerate>=0.15.0", -] +version = "2.1.1" +description = "A collection of custom nodes for ComfyUI, providing advanced file loading and workflow parsing features." [project.urls] -Homepage = "https://github.com/your-username/ComfyUI-Only" -Repository = "https://github.com/your-username/ComfyUI-Only" -Issues = "https://github.com/your-username/ComfyUI-Only/issues" +Repository = "https://github.com/eric183/ComfyUI-Only" +# Issues = "https://github.com/your-username/ComfyUI-Only/issues" -[tool.setuptools.packages.find] -where = ["."] -include = ["nodes*", "utils*", "assets*"] - -[tool.black] -line-length = 88 -target-version = ['py38'] - -[tool.mypy] -python_version = "3.8" -warn_return_any = true -warn_unused_configs = true -disallow_untyped_defs = true \ No newline at end of file +[tool.comfyui] +custom_nodes = "ComfyUI-Only" +i18n = "ComfyUI-Only" \ No newline at end of file