From 9fb77d5360a8351d97bb6f142e9e0840c4da96a6 Mon Sep 17 00:00:00 2001 From: leefer Date: Fri, 30 Oct 2026 03:44:25 +0800 Subject: [PATCH] HEL-892: pin AudioCrop and GuHai split reference contracts Co-authored-by: multica-agent --- .../scripts/audit_reference_conversion.py | 68 +- .../comfyui/serialization_reference.py | 89 +- .../src/calliope/comfyui/ui2api.py | 11 +- .../tests/test_audio_separation_reference.py | 5 +- .../tests/test_crop_split_reference.py | 379 +++++++ .../tests/test_media_reference.py | 10 +- .../crop-split-reference/contract.json | 158 +++ docs/hel-892/crop-split-reference/crop.py | 77 ++ .../crop-split-reference/guhai-tree.json | 1 + .../crop-split-reference/guhai__README.md | 1 + .../crop-split-reference/guhai____init__.py | 49 + .../guhai__extension.json | 37 + .../guhai__nodes__自动分割图像.py | 172 ++++ .../guhai__web__js__BOOLEAN.js | 230 +++++ .../guhai__web__js__GoohaiNote.js | 930 ++++++++++++++++++ .../guhai__web__js__colorWidget.js | 126 +++ ...guhai__web__js__goohai_universal_slider.js | 615 ++++++++++++ .../guhai__web__js__id_photo_clothing.js | 755 ++++++++++++++ .../guhai__web__js__nodes pass.js | 908 +++++++++++++++++ .../hel-892/crop-split-reference/sources.json | 360 +++++++ .../crop-split-reference/useBooleanWidget.ts | 31 + .../crop-split-reference/useStringWidget.ts | 137 +++ .../crop-split-reference/verified-facts.json | 19 + 23 files changed, 5143 insertions(+), 25 deletions(-) create mode 100644 calliope-backend/tests/test_crop_split_reference.py create mode 100644 docs/hel-892/crop-split-reference/contract.json create mode 100644 docs/hel-892/crop-split-reference/crop.py create mode 100644 docs/hel-892/crop-split-reference/guhai-tree.json create mode 100644 docs/hel-892/crop-split-reference/guhai__README.md create mode 100644 docs/hel-892/crop-split-reference/guhai____init__.py create mode 100644 docs/hel-892/crop-split-reference/guhai__extension.json create mode 100644 docs/hel-892/crop-split-reference/guhai__nodes__自动分割图像.py create mode 100644 docs/hel-892/crop-split-reference/guhai__web__js__BOOLEAN.js create mode 100644 docs/hel-892/crop-split-reference/guhai__web__js__GoohaiNote.js create mode 100644 docs/hel-892/crop-split-reference/guhai__web__js__colorWidget.js create mode 100644 docs/hel-892/crop-split-reference/guhai__web__js__goohai_universal_slider.js create mode 100644 docs/hel-892/crop-split-reference/guhai__web__js__id_photo_clothing.js create mode 100644 docs/hel-892/crop-split-reference/guhai__web__js__nodes pass.js create mode 100644 docs/hel-892/crop-split-reference/sources.json create mode 100644 docs/hel-892/crop-split-reference/useBooleanWidget.ts create mode 100644 docs/hel-892/crop-split-reference/useStringWidget.ts create mode 100644 docs/hel-892/crop-split-reference/verified-facts.json diff --git a/calliope-backend/scripts/audit_reference_conversion.py b/calliope-backend/scripts/audit_reference_conversion.py index c8092e47..9f5c2a72 100644 --- a/calliope-backend/scripts/audit_reference_conversion.py +++ b/calliope-backend/scripts/audit_reference_conversion.py @@ -25,6 +25,7 @@ from calliope.comfyui.serialization_reference import ( ASR_PROFILE, AUX_PROFILE, CASE04_PROFILE, + CROP_SPLIT_PROFILES, MEDIA_PROFILES, MP3_PROFILE, PREVIEW_PROFILE, @@ -289,6 +290,7 @@ REFERENCE_PROFILES = ( ASR_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE, + *CROP_SPLIT_PROFILES, ) @@ -305,7 +307,7 @@ def canonical_sha(value): ).hexdigest() -def node_inventory(source): +def node_inventory(source, *, include_aux=False): rows = [] graphs = [("", source)] + [ (f"/definitions/subgraphs/{i}", graph) @@ -319,7 +321,8 @@ def node_inventory(source): "pointer": f"{prefix}/nodes/{i}", "node_id": str(node.get("id")), "type": node.get("type"), - "provider": props.get("cnr_id"), + "provider": props.get("cnr_id") + or (props.get("aux_id") if include_aux else None), "version": props.get("ver"), "mode": node.get("mode", 0), "widget_count": len(node.get("widgets_values", [])), @@ -380,6 +383,16 @@ def media_field_evidence(source, prompt, profile): "SaveAudioMP3": ("filename_prefix", "quality"), "PreviewAudio": (), "AudioSeparation": ("chunk_fade_shape", "chunk_length", "chunk_overlap"), + "AudioCrop": ("start_time", "end_time"), + "GuHaiAutoImageSplit": ( + "保存目录", + "水平张数", + "垂直张数", + "移除画布边缘", + "移除描边", + "文件名前缀", + "保存格式", + ), "LoadImage": ("image",), "PreviewImage": (), "LayerUtility: ImageReel": ( @@ -432,7 +445,9 @@ def media_field_evidence(source, prompt, profile): "source_pointer": pointer, "rule": rule, "profile": profile, - "contract_manifest": "separation-reference/contract.json" + "contract_manifest": "crop-split-reference/contract.json" + if profile in CROP_SPLIT_PROFILES + else "separation-reference/contract.json" if profile == SEPARATION_PROFILE else "media-reference/contract.json", } @@ -494,26 +509,55 @@ def profile_attempt(source, profile): "separation-reference/sources.json", *assumptions["reference_sources"], ] + if profile in CROP_SPLIT_PROFILES: + assumptions["crop_split_reference"] = { + "selected_profile": profile, + "node_contracts": "crop-split-reference/contract.json", + "unmodified_plugin_and_frontend": True, + "target_node_version_and_UE_match": "unknown", + "registry_commit_binding": "unknown", + } + assumptions["reference_sources"] = [ + "crop-split-reference/sources.json", + "separation-reference/sources.json", + *assumptions["reference_sources"], + ] base = {"profile": profile, "assumptions": assumptions} + if profile in CROP_SPLIT_PROFILES: + base["source_declarations"] = [ + { + "pointer": f"/nodes/{i}", + **{k: (n.get("properties") or {}).get(k) for k in ("cnr_id", "aux_id", "ver")}, + } + for i, n in enumerate(source.get("nodes", [])) + ] + base["verified_reference_facts"] = "crop-split-reference/verified-facts.json" declared_frontend = (source.get("extra") or {}).get("frontendVersion") assumptions["source_frontend_declaration"] = declared_frontend assumptions["missing_frontend_policy"] = ( "explicit_media_reference_assumption" - if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE) + if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES) else "explicit_legacy_reference_assumption" if profile in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE) else "requires_explicit_declaration" ) assumptions["missing_node_declarations"] = [ n["pointer"] - for n in node_inventory(source) + for n in node_inventory(source, include_aux=profile in CROP_SPLIT_PROFILES) if n["type"] not in ("Note", "MarkdownNote", "Reroute", "PrimitiveNode") and (n["provider"] is None or n["version"] is None) ] if declared_frontend != expected and not ( declared_frontend is None and profile - in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE) + in ( + PROFILE, + AUX_PROFILE, + PRIMITIVE_PROFILE, + *MEDIA_PROFILES, + SEPARATION_PROFILE, + *CROP_SPLIT_PROFILES, + ) ): return { **base, @@ -550,7 +594,7 @@ def profile_attempt(source, profile): {"field_evidence": asr_field_evidence(source, result.prompt)} if profile == ASR_PROFILE else {"field_evidence": media_field_evidence(source, result.prompt, profile)} - if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE) + if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES) else {} ), } @@ -627,7 +671,12 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES, *, baseline_profiles= if attempt["status"] != "rejected": continue for issue in attempt["issues"]: - matches = [n for n in inventory if n["node_id"] == issue.get("node_id")] + gap_inventory = ( + node_inventory(source, include_aux=True) + if attempt["profile"] in CROP_SPLIT_PROFILES + else inventory + ) + matches = [n for n in gap_inventory if n["node_id"] == issue.get("node_id")] for node in matches or [{}]: key = ( node.get("type"), @@ -649,7 +698,7 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES, *, baseline_profiles= for cohort in ("without_companion", "with_companion") } if baseline_profiles is None: - baseline_profiles = tuple(p for p in profiles if p != SEPARATION_PROFILE) + baseline_profiles = tuple(p for p in profiles if p not in CROP_SPLIT_PROFILES) old_complete = { row["source_path"] for row in rows @@ -704,6 +753,7 @@ def main(): ASR_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE, + *CROP_SPLIT_PROFILES, PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE, diff --git a/calliope-backend/src/calliope/comfyui/serialization_reference.py b/calliope-backend/src/calliope/comfyui/serialization_reference.py index eae18dce..afd2ea52 100644 --- a/calliope-backend/src/calliope/comfyui/serialization_reference.py +++ b/calliope-backend/src/calliope/comfyui/serialization_reference.py @@ -18,6 +18,10 @@ REEL_PROFILE = "comfy-frontend-1.37.11-layerstyle-mixed-core-0.4.0-reference" MEDIA_PROFILES = (MP3_PROFILE, REEL_PROFILE) SEPARATION_PROFILE = "comfy-frontend-1.37.11-audio-separation-1.4.0-core-mixed-reference" +CROP_PROFILE = "comfy-frontend-1.37.11-audio-crop-1.4.0-core-0.3.68-reference" +SPLIT_PROFILE = "comfy-frontend-1.37.11-guhai-885cac3d-core-0.21.1-reference" +CROP_SPLIT_PROFILES = (CROP_PROFILE, SPLIT_PROFILE) + ASR_PROFILE = "comfy-frontend-1.37.11-asr-b037d7be-reference" PROFILE = "comfy-frontend-1.37.11-core-reference" AUX_PROFILE = "comfy-frontend-1.37.11-controlnet-aux-e8b689a-reference" @@ -88,7 +92,7 @@ def reference_definitions(profile: str = PROFILE) -> dict[str, Any]: "output": outputs, } - if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE): + if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES): return media_definitions(profile) if profile == ASR_PROFILE: definitions = reference_definitions(PREVIEW_PROFILE) @@ -162,7 +166,7 @@ def reference_definitions(profile: str = PROFILE) -> dict[str, Any]: def serialize_reference_widgets(node: dict[str, Any], profile: str = PROFILE) -> dict[str, Any]: """Apply only the pinned identity serializers; reject any extra/missing value.""" - if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE): + if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES): return serialize_media_node(node, profile) if profile == ASR_PROFILE: if any(k in node for k in ("widgets", "widgets_values_named", "serializeValue")): @@ -1039,6 +1043,16 @@ _MEDIA_LAYOUTS = { "LoadAudio": (("audio", str),), "SaveAudioMP3": (("filename_prefix", str), ("quality", str)), "PreviewAudio": (), + "AudioCrop": (("start_time", str), ("end_time", str)), + "GuHaiAutoImageSplit": ( + ("保存目录", str), + ("水平张数", int), + ("垂直张数", int), + ("移除画布边缘", bool), + ("移除描边", int), + ("文件名前缀", str), + ("保存格式", str), + ), "AudioSeparation": ( ("chunk_fade_shape", str), ("chunk_length", float), @@ -1073,6 +1087,32 @@ def media_definitions(profile): "output": outputs, } + if profile == SPLIT_PROFILE: + definitions = reference_definitions(PROFILE) + return { + "LoadImage": definitions["LoadImage"], + "PreviewImage": definitions["PreviewImage"], + "GuHaiAutoImageSplit": spec( + { + "图像": "IMAGE", + "保存目录": "STRING", + "水平张数": "INT", + "垂直张数": "INT", + "移除画布边缘": "BOOLEAN", + "移除描边": "INT", + "文件名前缀": "STRING", + "保存格式": "COMBO", + }, + ["IMAGE"], + ), + } + if profile == CROP_PROFILE: + definitions = media_definitions(SEPARATION_PROFILE) + del definitions["SaveAudioMP3"] + definitions["AudioCrop"] = spec( + {"audio": "AUDIO", "start_time": "STRING", "end_time": "STRING"}, ["AUDIO"] + ) + return definitions if profile == SEPARATION_PROFILE: definitions = media_definitions(MP3_PROFILE) definitions["PreviewAudio"] = spec({"audio": "AUDIO"}, [], {"audioUI": "AUDIO_UI"}) @@ -1132,7 +1172,7 @@ def serialize_media_node(node, profile): raise ValueError("节点类型/模式不在媒体固定参考契约内") if any(k in node for k in ("widgets", "widgets_values_named", "serializeValue")): raise ValueError("媒体参考不支持自定义控件/serializer覆盖") - if profile == SEPARATION_PROFILE: + if profile in (SEPARATION_PROFILE, *CROP_SPLIT_PROFILES): if type(node.get("mode", 0)) is not int: raise ValueError("音频分离参考模式必须为整数0") ue = props.get("ue_properties") or {} @@ -1145,9 +1185,21 @@ def serialize_media_node(node, profile): type(output["slot_index"]) is not int or output["slot_index"] != slot ): raise ValueError("音频分离输出槽索引冲突") + if profile in CROP_SPLIT_PROFILES: + output_names = { + "AudioCrop": ["AUDIO"], + "LoadAudio": ["AUDIO"], + "PreviewAudio": [], + "AudioSeparation": ["Bass", "Drums", "Other", "Vocals"], + "LoadImage": ["IMAGE", "MASK"], + "PreviewImage": [], + "GuHaiAutoImageSplit": ["分割图像"], + }[ct] + if [s.get("name") for s in node.get("outputs", [])] != output_names: + raise ValueError("源输出槽/名称与固定参考契约不符") provider = ( "audio-separation-nodes-comfyui" - if ct == "AudioSeparation" + if ct in ("AudioSeparation", "AudioCrop") else ("comfyui_layerstyle" if ct.startswith("LayerUtility:") else "comfy-core") ) version = ( @@ -1156,8 +1208,13 @@ def serialize_media_node(node, profile): "PreviewAudio": "0.3.68", "SaveAudioMP3": "0.3.71", "AudioSeparation": "1.4.0", + "AudioCrop": "1.4.0", }[ct] - if profile == SEPARATION_PROFILE + if profile in (SEPARATION_PROFILE, CROP_PROFILE) + else "885cac3dd323d26a77b69ae904a9a344f0dee7d0" + if ct == "GuHaiAutoImageSplit" + else "0.21.1" + if profile == SPLIT_PROFILE else _REEL_VERSION if ct == "LayerUtility: ImageReel" else _COMPOSIT_VERSION @@ -1166,10 +1223,18 @@ def serialize_media_node(node, profile): if profile == MP3_PROFILE else "0.4.0" ) + if ct == "GuHaiAutoImageSplit": + if props.get("aux_id") != "goohai/Goohaitools-comfyui" or props.get("cnr_id") is not None: + raise ValueError("GuHai要求精确aux_id且无未经证明的cnr_id") + provider_key, provider = "aux_id", "goohai/Goohaitools-comfyui" + else: + provider_key = "cnr_id" + if profile in CROP_SPLIT_PROFILES and props.get("aux_id") is not None: + raise ValueError("参考节点含未证明的额外提供方声明") # Audio has neither declaration; allow absence only in this labeled profile. if any( props.get(k) != v and not (profile == MP3_PROFILE and props.get(k) is None) - for k, v in (("cnr_id", provider), ("ver", version)) + for k, v in ((provider_key, provider), ("ver", version)) ): raise ValueError("媒体节点提供方/版本与固定参考冲突") layout = _MEDIA_LAYOUTS[ct] @@ -1202,6 +1267,14 @@ def serialize_media_node(node, profile): "exponential", ): raise ValueError("AudioSeparation chunk_fade_shape静态枚举不符") + if ct == "GuHaiAutoImageSplit": + # The plugin declares only minimums. 2048 is the pinned frontend's + # default UI maximum, not a plugin/server bound. Never clamp/round. + for name, low in (("水平张数", 1), ("垂直张数", 1), ("移除描边", 0)): + if not low <= result[name] <= 2048: + raise ValueError(f"{name}超出固定参考UI边界") + if result["保存格式"] not in ("PNG", "JPG"): + raise ValueError("GuHai保存格式静态枚举不符") if ct == "SaveAudioMP3" and result["quality"] not in ("V0", "128k", "320k"): raise ValueError("MP3 quality静态枚举不符") if ct == "LayerUtility: ImageReelComposit" and result["color_theme"] not in ("light", "dark"): @@ -1227,7 +1300,9 @@ def serialize_media_node(node, profile): sockets = node.get("inputs", []) if len(sockets) != len(slots) or {s.get("name") for s in sockets} != set(slots): raise ValueError("媒体输入槽缺失/重复/额外") - if profile == SEPARATION_PROFILE and [s.get("name") for s in sockets] != list(slots): + if profile in (SEPARATION_PROFILE, *CROP_SPLIT_PROFILES) and [ + s.get("name") for s in sockets + ] != list(slots): raise ValueError("音频分离参考输入/控件构造顺序不符") for socket in sockets: name = socket["name"] diff --git a/calliope-backend/src/calliope/comfyui/ui2api.py b/calliope-backend/src/calliope/comfyui/ui2api.py index 93b421a2..af4228ad 100644 --- a/calliope-backend/src/calliope/comfyui/ui2api.py +++ b/calliope-backend/src/calliope/comfyui/ui2api.py @@ -17,6 +17,7 @@ from .serialization_reference import ( ASR_PROFILE, AUX_PROFILE, CASE04_PROFILE, + CROP_SPLIT_PROFILES, MEDIA_PROFILES, PREVIEW_PROFILE, PRIMITIVE_PROFILE, @@ -63,6 +64,7 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion: ASR_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE, + *CROP_SPLIT_PROFILES, AUX_PROFILE, PRIMITIVE_PROFILE, PREVIEW_PROFILE, @@ -126,11 +128,11 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion: and (source.get("extra") or {}).get("frontendVersion") != "1.37.11" ): raise ValueError("PreviewAny 需要显式1.37.11前端声明") - if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE) and any( + if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES) and any( node.get("type") == "Reroute" for node in source.get("nodes", []) ): raise ValueError("媒体最小参考仅覆盖直接连线,不扩展虚拟节点") - if profile == SEPARATION_PROFILE and any( + if profile in (SEPARATION_PROFILE, *CROP_SPLIT_PROFILES) and any( (source.get("extra") or {}).get(k) for k in ("ue_links", "links_added_by_ue") ): raise ValueError("音频分离参考不覆盖UE附加连线") @@ -145,7 +147,7 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion: except (ValueError, TypeError, KeyError, AttributeError, IndexError) as exc: return Conversion(None, [{"code": "invalid_reference_contract", "message": str(exc)}], True) result.reference_only = True - if profile in (ASR_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE): + if profile in (ASR_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES): result.serialization_stage = "restored_saved_state_before_queue_hooks" return result @@ -226,7 +228,7 @@ def _convert( for lid in links: try: resolve_reference_link(nodes, links, lid) - if reference_profile in (*MEDIA_PROFILES, SEPARATION_PROFILE): + if reference_profile in (*MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES): link = links[lid] upstream = nodes[str(link[1])]["outputs"][link[2]] downstream = nodes[str(link[3])]["inputs"][link[4]] @@ -284,6 +286,7 @@ def _convert( ASR_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE, + *CROP_SPLIT_PROFILES, ) and ct == "LoadAudio" ): diff --git a/calliope-backend/tests/test_audio_separation_reference.py b/calliope-backend/tests/test_audio_separation_reference.py index f912c239..99879b21 100644 --- a/calliope-backend/tests/test_audio_separation_reference.py +++ b/calliope-backend/tests/test_audio_separation_reference.py @@ -359,9 +359,10 @@ def test_old_mp3_profile_rejects_real_graph_and_new_profile_rejects_old_core(): def test_library_actual_delta_keeps_every_old_attempt_and_all_six_golden_comparisons(): previous = json.loads((REPO / "docs/hel-892/media-evidence/library.json").read_bytes()) - baseline = tuple(p for p in audit.REFERENCE_PROFILES if p != SEPARATION_PROFILE) + profiles = tuple(p for p in audit.REFERENCE_PROFILES if p not in audit.CROP_SPLIT_PROFILES) + baseline = tuple(p for p in profiles if p != SEPARATION_PROFILE) old = audit.audit_library(REPO, baseline) - current = audit.audit_library(REPO) + current = audit.audit_library(REPO, profiles, baseline_profiles=baseline) for historical, before, after in zip(previous["cases"], old["cases"], current["cases"]): assert historical["source_path"] == before["source_path"] == after["source_path"] assert historical["attempts"] == before["attempts"] == after["attempts"][:-1] diff --git a/calliope-backend/tests/test_crop_split_reference.py b/calliope-backend/tests/test_crop_split_reference.py new file mode 100644 index 00000000..ef9fa0f5 --- /dev/null +++ b/calliope-backend/tests/test_crop_split_reference.py @@ -0,0 +1,379 @@ +"""Read pinned source AST/bytes; synthetic mutations never execute upstream plugins.""" + +from __future__ import annotations + +import ast +import copy +import hashlib +import json +from pathlib import Path + +import pytest +from scripts import audit_reference_conversion as audit + +from calliope.comfyui.serialization_reference import ( + CROP_PROFILE, + CROP_SPLIT_PROFILES, + SEPARATION_PROFILE, + SPLIT_PROFILE, + serialize_reference_widgets, +) +from calliope.comfyui.ui2api import convert, convert_reference + +REPO = Path(__file__).resolve().parents[2] +SOURCES = REPO / "docs/hel-892/crop-split-reference" +PREFIX = "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/" +CROP = PREFIX + "音频人声分离.json" +SPLIT = PREFIX + "图像分割-多宫格分割.json" +LAYOUTS = { + "AudioCrop": ["start_time", "end_time"], + "GuHaiAutoImageSplit": [ + "保存目录", + "水平张数", + "垂直张数", + "移除画布边缘", + "移除描边", + "文件名前缀", + "保存格式", + ], + "AudioSeparation": ["chunk_fade_shape", "chunk_length", "chunk_overlap"], + "LoadAudio": ["audio"], + "PreviewAudio": [], + "LoadImage": ["image"], + "PreviewImage": [], +} + + +def graph(profile): + return json.loads((REPO / (CROP if profile == CROP_PROFILE else SPLIT)).read_bytes()) + + +def node(source, nid): + return next(n for n in source["nodes"] if n["id"] == nid) + + +def synthetic_split(): + # ONLY this synthetic fixture removes the unexplained source PreviewImage + # output. The original remains unchanged/rejected in all library audits. + source = graph(SPLIT_PROFILE) + node(source, 3)["outputs"] = [] + return source + + +def schema_and_class(filename, name): + tree = ast.parse((SOURCES / filename).read_bytes()) + cls = next(n for n in tree.body if isinstance(n, ast.ClassDef) and n.name == name) + method = next(n for n in cls.body if isinstance(n, ast.FunctionDef) and n.name == "INPUT_TYPES") + schema = ast.literal_eval(next(n.value for n in ast.walk(method) if isinstance(n, ast.Return))) + return tree, cls, schema + + +def test_pinned_ast_schemas_and_registration_no_plugin_import(): + _, crop, schema = schema_and_class("crop.py", "AudioCrop") + assert list(schema["required"]) == ["audio", "start_time", "end_time"] + assert schema["required"]["start_time"] == ("STRING", {"default": "0:00"}) + assert schema["required"]["end_time"] == ("STRING", {"default": "1:00"}) + tree, split, schema = schema_and_class("guhai__nodes__自动分割图像.py", "GuHaiAutoImageSplit") + assert list(schema["required"]) == ["图像", *LAYOUTS["GuHaiAutoImageSplit"]] + assert schema["required"]["水平张数"] == ("INT", {"default": 4, "min": 1}) + assert schema["required"]["垂直张数"] == ("INT", {"default": 2, "min": 1}) + assert schema["required"]["移除描边"] == ("INT", {"default": 0, "min": 0}) + assert schema["required"]["保存格式"] == (["PNG", "JPG"], {"default": "PNG"}) + mapping = next( + n.value + for n in tree.body + if isinstance(n, ast.Assign) + and any(isinstance(t, ast.Name) and t.id == "NODE_CLASS_MAPPINGS" for t in n.targets) + ) + assert [(k.value, v.id) for k, v in zip(mapping.keys, mapping.values)] == [ + ("GuHaiAutoImageSplit", "GuHaiAutoImageSplit") + ] + for cls in (crop, split): + returns = next( + n.value + for n in cls.body + if isinstance(n, ast.Assign) + and any(isinstance(t, ast.Name) and t.id == "RETURN_TYPES" for t in n.targets) + ) + assert ast.literal_eval(returns) == (("AUDIO",) if cls is crop else ("IMAGE",)) + + +def independently_check(source, attempt): + prompt = attempt["candidate_prompt"] + assert set(prompt) == {str(n["id"]) for n in source["nodes"]} + for n in source["nodes"]: + actual = prompt[str(n["id"])] + expected = dict(zip(LAYOUTS[n["type"]], n["widgets_values"])) + if n["type"] in ("LoadAudio", "PreviewAudio"): + expected["audioUI"] = "" + for socket in n["inputs"]: + if socket["link"] is not None: + link = next(link for link in source["links"] if link[0] == socket["link"]) + expected[socket["name"]] = [str(link[1]), link[2]] + assert actual == { + "class_type": n["type"], + "inputs": expected, + "_meta": {"title": n.get("title") or n["type"]}, + } + assert {k: type(v) for k, v in expected.items()} == { + k: type(v) for k, v in actual["inputs"].items() + } + for field in attempt["field_evidence"]: + pointer = field["source_pointer"] + if pointer is None: + assert field["field"] == "audioUI" and field["value"] == "" + continue + value = source + for part in pointer.split("/")[1:]: + value = value[int(part)] if isinstance(value, list) else value[part] + if pointer.startswith("/links/"): + value = [str(value[1]), value[2]] + assert type(value) is type(field["value"]) and value == field["value"] + raw = json.dumps( + prompt, ensure_ascii=False, sort_keys=True, separators=(",", ":"), allow_nan=False + ).encode() + assert attempt["candidate_sha256"] == hashlib.sha256(raw).hexdigest() + + +def test_actual_crop_candidate_every_field_type_pointer_and_final_nonzero_slot(): + source = graph(CROP_PROFILE) + original = copy.deepcopy(source) + attempt = audit.profile_attempt(source, CROP_PROFILE) + assert attempt["status"] == "complete_reference_candidate" + independently_check(source, attempt) + assert len(attempt["field_evidence"]) == 11 + assert attempt["candidate_prompt"]["11"]["inputs"]["audio"] == ["18", 0] + assert attempt["candidate_prompt"]["15"]["inputs"]["audio"] == ["11", 3] + assert attempt["assumptions"]["source_frontend_declaration"] is None + assert source == original and convert(source).prompt is None + assert convert_reference(source, SEPARATION_PROFILE).prompt is None + + +def test_real_split_keeps_unexplained_preview_output_and_whole_graph_closed(): + source = graph(SPLIT_PROFILE) + original = copy.deepcopy(source) + assert serialize_reference_widgets(node(source, 2), SPLIT_PROFILE) == dict( + zip(LAYOUTS["GuHaiAutoImageSplit"], node(source, 2)["widgets_values"]) + ) + attempt = audit.profile_attempt(source, SPLIT_PROFILE) + assert attempt["status"] == "rejected" and "candidate_prompt" not in attempt + assert any(i["node_id"] == "3" and "输出槽" in i["message"] for i in attempt["issues"]) + assert convert_reference(source, SPLIT_PROFILE).prompt is None + assert source == original and convert(source).prompt is None + + +@pytest.mark.parametrize( + "start,end", + [ + ("12", "60"), + ("0:01", "0:59"), + ("-1", "0"), + ("0:00", "0:00"), + ("1:90", "999:00"), + (" 2 ", "+30"), + ], +) +def test_crop_saved_strings_propagate_without_time_parse_clamp_or_round(start, end): + source = graph(CROP_PROFILE) + node(source, 18)["widgets_values"] = [start, end] + prompt = convert_reference(source, CROP_PROFILE).prompt + assert prompt["18"]["inputs"]["start_time"] == start + assert prompt["18"]["inputs"]["end_time"] == end + + +@pytest.mark.parametrize( + "bad", [True, False, None, 0, 1.25, float("nan"), float("inf"), [], {}, "%date%", "{1|2}"] +) +@pytest.mark.parametrize("index", [0, 1]) +def test_crop_rejects_nonstring_or_dynamic_value_whole_graph(index, bad): + source = graph(CROP_PROFILE) + node(source, 18)["widgets_values"][index] = bad + assert convert_reference(source, CROP_PROFILE).prompt is None + + +@pytest.mark.parametrize("fmt", ["PNG", "JPG"]) +@pytest.mark.parametrize("counts,trim,edge", [((1, 2), 0, False), ((2048, 2048), 2048, True)]) +def test_synthetic_split_full_contract_unicode_and_values_propagate(fmt, counts, trim, edge): + source = synthetic_split() + node(source, 2)["widgets_values"] = ["目录/子目录", *counts, edge, trim, "新 前缀_", fmt] + attempt = audit.profile_attempt(source, SPLIT_PROFILE) + assert attempt["status"] == "complete_reference_candidate" + independently_check(source, attempt) + actual = attempt["candidate_prompt"]["2"]["inputs"] + assert actual["图像"] == ["1", 0] + assert actual["保存目录"] == "目录/子目录" and actual["保存格式"] == fmt + # Serialized path is just data. No directories/files/rendering were executed. + + +@pytest.mark.parametrize( + "index,bad", + [ + (0, None), + (0, "%date%"), + (1, True), + (1, 0), + (1, 2049), + (1, 2.0), + (2, -1), + (2, False), + (2, float("inf")), + (3, 1), + (3, None), + (4, -1), + (4, True), + (4, 2049), + (5, []), + (5, "{x}"), + (6, "png"), + (6, "JPEG"), + ], +) +def test_synthetic_split_bad_types_enums_and_ui_bounds_fail_closed(index, bad): + source = synthetic_split() + node(source, 2)["widgets_values"][index] = bad + assert convert_reference(source, SPLIT_PROFILE).prompt is None + + +@pytest.mark.parametrize("profile", CROP_SPLIT_PROFILES) +@pytest.mark.parametrize( + "mutation", + [ + "version", + "provider", + "extra_provider", + "missing_provider", + "widget_extra", + "widget_missing", + "widget_binding", + "socket_type", + "socket_order", + "output_index", + "output_extra", + "output_name", + "slot", + "bool_slot", + "reciprocal", + "link_type", + "mode", + "bool_mode", + "serializer", + "named", + "ue_widget", + "ue_link", + "frontend", + "unknown_node", + "dynamic", + ], +) +def test_strict_contract_mutations_close_all_nodes(profile, mutation): + source = graph(profile) if profile == CROP_PROFILE else synthetic_split() + target = node(source, 18 if profile == CROP_PROFILE else 2) + props = target["properties"] + provider_key = "cnr_id" if profile == CROP_PROFILE else "aux_id" + if mutation == "version": + props["ver"] = "0.11.0" + elif mutation == "provider": + props[provider_key] = "different/provider" + elif mutation == "extra_provider": + props["aux_id" if profile == CROP_PROFILE else "cnr_id"] = "other" + elif mutation == "missing_provider": + del props[provider_key] + elif mutation == "widget_extra": + target["widgets_values"].append(0) + elif mutation == "widget_missing": + target["widgets_values"].pop() + elif mutation == "widget_binding": + target["inputs"][1]["widget"] = {"name": "wrong"} + elif mutation == "socket_type": + target["inputs"][1]["type"] = "FLOAT" + elif mutation == "socket_order": + target["inputs"][1:3] = target["inputs"][1:3][::-1] + elif mutation == "output_index": + target["outputs"][0]["slot_index"] = 1 + elif mutation == "output_extra": + target["outputs"].append(copy.deepcopy(target["outputs"][0])) + elif mutation == "output_name": + target["outputs"][0]["name"] = "other" + elif mutation == "slot": + source["links"][0][2] = 9 + elif mutation == "bool_slot": + source["links"][0][2] = False + elif mutation == "reciprocal": + target["inputs"][0]["link"] = None + elif mutation == "link_type": + source["links"][0][5] = "wrong" + elif mutation == "mode": + target["mode"] = 2 + elif mutation == "bool_mode": + target["mode"] = False + elif mutation == "serializer": + props["serializeValue"] = "override" + elif mutation == "named": + target["widgets_values_named"] = {} + elif mutation == "ue_widget": + props["ue_properties"]["widget_ue_connectable"] = {"x": True} + elif mutation == "ue_link": + source["extra"]["ue_links"] = [[1]] + elif mutation == "frontend": + source["extra"]["frontendVersion"] = "1.53.6" + elif mutation == "unknown_node": + target["type"] = "unknown" + elif mutation == "dynamic": + target["widgets_values"][0] = "{a|b}" + result = convert_reference(source, profile) + assert result.prompt is None and result.issues + + +@pytest.mark.parametrize("profile", CROP_SPLIT_PROFILES) +def test_two_disjoint_instances_preserve_nodes_links_and_values(profile): + source = graph(profile) if profile == CROP_PROFILE else synthetic_split() + second = copy.deepcopy(source) + for n in second["nodes"]: + n["id"] += 100 + for s in n["inputs"]: + if s.get("link") is not None: + s["link"] += 100 + for s in n["outputs"]: + if s.get("links"): + s["links"] = [x + 100 for x in s["links"]] + for link in second["links"]: + for i in (0, 1, 3): + link[i] += 100 + target = node(second, 118 if profile == CROP_PROFILE else 102) + target["widgets_values"][0] = "15" if profile == CROP_PROFILE else "不同目录" + source["nodes"].extend(second["nodes"]) + source["links"].extend(second["links"]) + result = convert_reference(source, profile) + assert result.prompt is not None + independently_check(source, audit.profile_attempt(source, profile)) + assert len(result.prompt) == len(source["nodes"]) + + +def test_all_old_fourteen_profiles_attempts_gaps_and_six_differences_unchanged(): + profiles = tuple(p for p in audit.REFERENCE_PROFILES if p not in CROP_SPLIT_PROFILES) + historical = json.loads((REPO / "docs/hel-892/separation-evidence/library.json").read_bytes()) + baseline = audit.audit_library(REPO, profiles) + current = audit.audit_library(REPO) + assert baseline["gap_groups"] == historical["gap_groups"] + assert len(profiles) == 14 and len(audit.REFERENCE_PROFILES) == 16 + assert current["coverage_delta"]["baseline_profiles"] == list(profiles) + assert current["coverage_delta"]["new_complete_paths"] == [CROP] + assert len(current["coverage_delta"]["current_complete_paths"]) == 8 + for old, before, after in zip(historical["cases"], baseline["cases"], current["cases"]): + assert old["attempts"] == before["attempts"] == after["attempts"][:-2] + assert old.get("comparisons") == before.get("comparisons") + assert old.get("comparisons") == [ + c for c in after.get("comparisons", []) if c["profile"] in profiles + ] or (old.get("comparisons") is None and "comparisons" not in after) + if after["source_path"] in (CROP, SPLIT): + assert after["comparison_status"] == "comparison_unavailable" + assert not after["production_prompt_available"] and not after["execution_verified"] + + def unavailable(r): + return { + x["source_path"] + for x in r["cases"] + if all(a["status"] == "not_applicable" for a in x["attempts"]) + } + + assert unavailable(baseline) == unavailable(current) and len(unavailable(current)) == 98 diff --git a/calliope-backend/tests/test_media_reference.py b/calliope-backend/tests/test_media_reference.py index c90efb3d..21f8baf7 100644 --- a/calliope-backend/tests/test_media_reference.py +++ b/calliope-backend/tests/test_media_reference.py @@ -255,16 +255,20 @@ def test_library_actual_delta_keeps_old_candidates_and_no_golden_claim(): tuple( p for p in audit.REFERENCE_PROFILES - if p not in MEDIA_PROFILES and p != audit.SEPARATION_PROFILE + if p not in (*MEDIA_PROFILES, audit.SEPARATION_PROFILE, *audit.CROP_SPLIT_PROFILES) ), ) current = audit.audit_library( REPO, - tuple(p for p in audit.REFERENCE_PROFILES if p != audit.SEPARATION_PROFILE), + tuple( + p + for p in audit.REFERENCE_PROFILES + if p not in (audit.SEPARATION_PROFILE, *audit.CROP_SPLIT_PROFILES) + ), baseline_profiles=tuple( p for p in audit.REFERENCE_PROFILES - if p not in MEDIA_PROFILES and p != audit.SEPARATION_PROFILE + if p not in (*MEDIA_PROFILES, audit.SEPARATION_PROFILE, *audit.CROP_SPLIT_PROFILES) ), ) assert ( diff --git a/docs/hel-892/crop-split-reference/contract.json b/docs/hel-892/crop-split-reference/contract.json new file mode 100644 index 00000000..998f5bde --- /dev/null +++ b/docs/hel-892/crop-split-reference/contract.json @@ -0,0 +1,158 @@ +{ + "authority": "public_reference_only_not_object_info", + "source_manifests": [ + "crop-split-reference/sources.json", + "separation-reference/sources.json", + "serialization-evidence/sources.json" + ], + "frontend": { + "selected_version": "1.37.11", + "commit": "4bf6a1960028cc5cda57d48f9fb01a74dfaade43", + "source_declaration": null, + "selection": "explicit reference assumption only", + "unmodified_widgets_and_extensions": "assumed", + "UE_match": "unknown", + "target_match": "unknown" + }, + "facts_file": "verified-facts.json", + "contracts": { + "AudioCrop": { + "fixed_original": "crop.py", + "definition_lines": [ + 7, + 77 + ], + "schema": { + "required": { + "audio": [ + "AUDIO" + ], + "start_time": [ + "STRING", + { + "default": "0:00" + } + ], + "end_time": [ + "STRING", + { + "default": "1:00" + } + ] + } + }, + "widget_layout": [ + "start_time", + "end_time" + ], + "return_types": [ + "AUDIO" + ], + "saved_values_policy": "identity only; no queue hooks, callback, plugin execution or file operations", + "interpretation": { + "time_type": "STRING, not FLOAT/INT", + "defaults": [ + "0:00", + "1:00" + ], + "units_basis": "source main: minutes*60+seconds; no colon prepends 00:; both parts int()", + "special_behavior": "negative frames clamp to 0; >=length clamp to length-1; start>end raises; equal may yield empty slice; end excluded; retains sample_rate", + "range": "no numeric min/max declared; 0..2048 inapplicable to these STRING widgets", + "runtime_unknown": "syntax/content parsing and sample length not executed/validated; preserved strings do not imply executable audio" + } + }, + "GuHaiAutoImageSplit": { + "fixed_original": "guhai__nodes__自动分割图像.py", + "definition_lines": [ + 54, + 163 + ], + "schema": { + "required": { + "图像": [ + "IMAGE" + ], + "保存目录": [ + "STRING", + { + "default": "output" + } + ], + "水平张数": [ + "INT", + { + "default": 4, + "min": 1 + } + ], + "垂直张数": [ + "INT", + { + "default": 2, + "min": 1 + } + ], + "移除画布边缘": [ + "BOOLEAN", + { + "default": true + } + ], + "移除描边": [ + "INT", + { + "default": 0, + "min": 0 + } + ], + "文件名前缀": [ + "STRING", + { + "default": "孤海图像分割_" + } + ], + "保存格式": [ + [ + "PNG", + "JPG" + ], + { + "default": "PNG" + } + ] + } + }, + "widget_layout": [ + "保存目录", + "水平张数", + "垂直张数", + "移除画布边缘", + "移除描边", + "文件名前缀", + "保存格式" + ], + "return_types": [ + "IMAGE" + ], + "saved_values_policy": "identity only; no queue hooks, callback, plugin execution or file operations", + "interpretation": { + "provider": "aux_id=goohai/Goohaitools-comfyui; cnr_id absent; ver=885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "numeric_bounds": "plugin minima 1/1/0; selected frontend useIntWidget default max2048; profile subset only, no callback rounding", + "algorithm": "uses 图像[0]; optional four-corner median background threshold30 edge scan; integer floor grid; rows outer/columns inner; optional per-tile min(trim,w//2-1,h//2-1) crop", + "saving": "joins output directory and 保存目录; creates directory; numbered prefix from existing files; blank prefix falls back only at plugin execution; PNG or JPG/JPEG quality95", + "returns": "one IMAGE slot with torch.cat tiles batch; writes files as side effect, no UI/history descriptor in this node", + "paths": "literal parameters only; existence/permissions/fonts/resources/actual UE unknown, no paths executed", + "actual_graph_blocker": { + "node": "3 PreviewImage@comfy-core0.21.1", + "source_pointer": "/nodes/0/outputs", + "source_types": [ + "IMAGE" + ], + "fixed_core_types": [], + "fixed_definition": "serialization-evidence/corev0.21.1__nodes.py:1608-1680; inherits SaveImage.RETURN_TYPES=()", + "policy": "prompt=None for whole actual graph; no dropping the unexplained output; synthetic fixture separate" + } + } + } + } +} diff --git a/docs/hel-892/crop-split-reference/crop.py b/docs/hel-892/crop-split-reference/crop.py new file mode 100644 index 00000000..9f9e8554 --- /dev/null +++ b/docs/hel-892/crop-split-reference/crop.py @@ -0,0 +1,77 @@ +import torch + +from typing import Tuple +from ._types import AUDIO + + +class AudioCrop: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "audio": ("AUDIO",), + "start_time": ( + "STRING", + { + "default": "0:00", + }, + ), + "end_time": ( + "STRING", + { + "default": "1:00", + }, + ), + }, + } + + FUNCTION = "main" + RETURN_TYPES = ("AUDIO",) + CATEGORY = "audio" + DESCRIPTION = "Crop (trim) audio to a specific start and end time." + + def main( + self, + audio: AUDIO, + start_time: str = "0:00", + end_time: str = "1:00", + ) -> Tuple[AUDIO]: + + waveform: torch.Tensor = audio["waveform"] + sample_rate: int = audio["sample_rate"] + + # Assume that no ":" in input means that the user is trying to specify seconds + if ":" not in start_time: + start_time = f"00:{start_time}" + if ":" not in end_time: + end_time = f"00:{end_time}" + + start_seconds_time = 60 * int(start_time.split(":")[0]) + int( + start_time.split(":")[1] + ) + start_frame = start_seconds_time * sample_rate + if start_frame >= waveform.shape[-1]: + start_frame = waveform.shape[-1] - 1 + + end_seconds_time = 60 * int(end_time.split(":")[0]) + int( + end_time.split(":")[1] + ) + end_frame = end_seconds_time * sample_rate + if end_frame >= waveform.shape[-1]: + end_frame = waveform.shape[-1] - 1 + if start_frame < 0: + start_frame = 0 + if end_frame < 0: + end_frame = 0 + + if start_frame > end_frame: + raise ValueError( + "AudioCrop: Start time must be less than end time and be within the audio length." + ) + + return ( + { + "waveform": waveform[..., start_frame:end_frame], + "sample_rate": sample_rate, + }, + ) diff --git a/docs/hel-892/crop-split-reference/guhai-tree.json b/docs/hel-892/crop-split-reference/guhai-tree.json new file mode 100644 index 00000000..e9b99e6e --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai-tree.json @@ -0,0 +1 @@ +{"sha":"885cac3dd323d26a77b69ae904a9a344f0dee7d0","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/885cac3dd323d26a77b69ae904a9a344f0dee7d0","tree":[{"path":".gitignore","mode":"100644","type":"blob","sha":"49b2e91681082dbb8e98e7d4bc6bfd0570941f09","size":34,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/49b2e91681082dbb8e98e7d4bc6bfd0570941f09"},{"path":"README.md","mode":"100644","type":"blob","sha":"594ccd15cd1ac6a2f77f300e1300eb7e48adf410","size":60,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/594ccd15cd1ac6a2f77f300e1300eb7e48adf410"},{"path":"__init__.py","mode":"100644","type":"blob","sha":"d335c5f40f24a221373c92fe67e74e9c15104a21","size":1582,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d335c5f40f24a221373c92fe67e74e9c15104a21"},{"path":"extension.json","mode":"100644","type":"blob","sha":"591788233b87c52b6e27841185e0b6ee402ee63e","size":933,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/591788233b87c52b6e27841185e0b6ee402ee63e"},{"path":"fonts","mode":"040000","type":"tree","sha":"cf71c83c1fe781e8cc256f27a713ce2efe9399a5","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/cf71c83c1fe781e8cc256f27a713ce2efe9399a5"},{"path":"fonts/Capture it.ttf","mode":"100644","type":"blob","sha":"add12b9bc99e42e10834589929895d44f0cc0828","size":703400,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/add12b9bc99e42e10834589929895d44f0cc0828"},{"path":"fonts/FZCCHJW.TTF","mode":"100644","type":"blob","sha":"e9fa0c4386ccbccd479a2f6b51ca02f3084bb153","size":1847656,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e9fa0c4386ccbccd479a2f6b51ca02f3084bb153"},{"path":"fonts/OCR-B 10 BT.ttf","mode":"100644","type":"blob","sha":"5c8d5bf1ecb6ccfb22fd8cb64d6c21e94a09d31e","size":20632,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5c8d5bf1ecb6ccfb22fd8cb64d6c21e94a09d31e"},{"path":"fonts/font.ttf","mode":"100644","type":"blob","sha":"4fafa9ed8fc04b047a6528ccae85a280fb2c273a","size":24536,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4fafa9ed8fc04b047a6528ccae85a280fb2c273a"},{"path":"fonts/wsis721.ttf","mode":"100644","type":"blob","sha":"e8c92dc0bf0960d363f1bb898b00fb34d3465c9c","size":40872,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e8c92dc0bf0960d363f1bb898b00fb34d3465c9c"},{"path":"fonts/华文细黑.ttf","mode":"100644","type":"blob","sha":"c448cbeb3d9cb795b502a567282c705b7b9b6f4c","size":9761920,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/c448cbeb3d9cb795b502a567282c705b7b9b6f4c"},{"path":"fonts/楷体.ttf","mode":"100644","type":"blob","sha":"d7c3b902d893e9206d03d38641f9c5abfcf9aef8","size":11787328,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d7c3b902d893e9206d03d38641f9c5abfcf9aef8"},{"path":"fonts/苹方特粗.ttf","mode":"100644","type":"blob","sha":"f4cf7884bc2906ae83b48c76317ac59fb74a5541","size":10898528,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f4cf7884bc2906ae83b48c76317ac59fb74a5541"},{"path":"fonts/苹方粗体.ttf","mode":"100644","type":"blob","sha":"accaf1f0014c85574e5f35c9570e7377507ae6d4","size":10923212,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/accaf1f0014c85574e5f35c9570e7377507ae6d4"},{"path":"fonts/黑体.ttf","mode":"100644","type":"blob","sha":"5bd4687e7212775e23bea569f08fdd1cd7395dc3","size":9753388,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5bd4687e7212775e23bea569f08fdd1cd7395dc3"},{"path":"image","mode":"040000","type":"tree","sha":"5015db0346caeb76040ed7e8aaaa47c45320fa8e","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/5015db0346caeb76040ed7e8aaaa47c45320fa8e"},{"path":"image/ID_Photo","mode":"040000","type":"tree","sha":"cacdbf2c8903659226ac528e0996471c01991025","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/cacdbf2c8903659226ac528e0996471c01991025"},{"path":"image/ID_Photo/1. 服装_女士","mode":"040000","type":"tree","sha":"a899d7829aa22f0246bd8088f114618ae3c552d1","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/a899d7829aa22f0246bd8088f114618ae3c552d1"},{"path":"image/ID_Photo/1. 服装_女士/01.西装-藏青学院风西装,暗紫色镶边,内搭白衬衫,配藏青红条纹徽章领带,元气减龄日系校园风.jpg","mode":"100644","type":"blob","sha":"7f14dc61b48d21e5b622f97b9fa5f5ba4922156d","size":27276,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/7f14dc61b48d21e5b622f97b9fa5f5ba4922156d"},{"path":"image/ID_Photo/1. 服装_女士/02.西装-藏青色(偏蓝紫调)平驳领西装,内搭白尖领衬衫,搭配酒红藏青条纹带徽章的学院风领结;.jpg","mode":"100644","type":"blob","sha":"801504dda8a24aa2c6890c22daa63871a8a7a694","size":27231,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/801504dda8a24aa2c6890c22daa63871a8a7a694"},{"path":"image/ID_Photo/1. 服装_女士/03.西装-藏青镶金边平驳领学院风西装,翻驳领高领口剪裁,带校徽徽章;内搭白尖领衬衫,领口完全被西装翻领包裹,搭配藏青红条纹领带,减龄学院风;.jpg","mode":"100644","type":"blob","sha":"c734a114d5b244e8268b58b5df1ba42ab8a83d0e","size":34103,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/c734a114d5b244e8268b58b5df1ba42ab8a83d0e"},{"path":"image/ID_Photo/1. 服装_女士/04.西装-灰色修身平驳领西装,内搭白衬衫配黑领带,干练正式的职业通勤风.jpg","mode":"100644","type":"blob","sha":"be87e745bf16cf55e2c07406f101b3317fa260f7","size":31070,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/be87e745bf16cf55e2c07406f101b3317fa260f7"},{"path":"image/ID_Photo/1. 服装_女士/05.西装-深灰色廓形西装外套,垫肩泡泡袖,内搭粉色短款打底,轻熟通勤风,颈间搭配金银双色锁骨链。.jpg","mode":"100644","type":"blob","sha":"348a72d09ad3333adb37c0c8b7be86849e2a1749","size":26709,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/348a72d09ad3333adb37c0c8b7be86849e2a1749"},{"path":"image/ID_Photo/1. 服装_女士/06.西装-米色西装外套搭配白色尖领衬衫,外系深棕红蓝格纹大蝴蝶结领结,经典翻领设计,正装风格。.jpg","mode":"100644","type":"blob","sha":"87b8d8facea9eb3ae420daa8e6560d23a17e5890","size":26388,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/87b8d8facea9eb3ae420daa8e6560d23a17e5890"},{"path":"image/ID_Photo/1. 服装_女士/07.西装-墨绿细条纹西装,内搭白衬衫配格纹领带,复古学院通勤风.jpg","mode":"100644","type":"blob","sha":"7a8b021d167f68a331f676764a8ef8507b54f657","size":33620,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/7a8b021d167f68a331f676764a8ef8507b54f657"},{"path":"image/ID_Photo/1. 服装_女士/08.西装-黑色平驳领西装外套,V 领剪裁,无打底,露出锁骨,利落修身,干练的职业通勤风.jpg","mode":"100644","type":"blob","sha":"ec2940895d335465119da754ae58b721accf860a","size":23153,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ec2940895d335465119da754ae58b721accf860a"},{"path":"image/ID_Photo/1. 服装_女士/09.西装-白色干练西装,内搭蓝调印花丝巾,正式又带知性气质的职场风.jpg","mode":"100644","type":"blob","sha":"1be3a11cb21669a2d5131932eee25b542802c17b","size":35570,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1be3a11cb21669a2d5131932eee25b542802c17b"},{"path":"image/ID_Photo/1. 服装_女士/10.西装-豆沙粉纹理V领西装外套,双排扣设计,无打底,露出锁骨,温柔知性的轻熟通勤风。.jpg","mode":"100644","type":"blob","sha":"a0c50252dfa0401a7c43d2d22da520d51c859099","size":35096,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a0c50252dfa0401a7c43d2d22da520d51c859099"},{"path":"image/ID_Photo/1. 服装_女士/11.西装-浅蓝高领裁剪 V 领西装马甲,内搭白色T恤打底,简约干净的日系温柔风.jpg","mode":"100644","type":"blob","sha":"45e354b1fb5d74f753c655675702b39575e5c634","size":32468,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/45e354b1fb5d74f753c655675702b39575e5c634"},{"path":"image/ID_Photo/1. 服装_女士/12.马甲-高明度焦糖色学院风西装马甲,内搭白衬衫,搭配短款蓝紫格纹小领带,带金属徽章装饰,复古又精致;.jpg","mode":"100644","type":"blob","sha":"f825c02d3d41904fb59bfcabe0c29f9cdfefae63","size":33235,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f825c02d3d41904fb59bfcabe0c29f9cdfefae63"},{"path":"image/ID_Photo/1. 服装_女士/13.马甲-酒红色 V 领麻花针织毛衣,内搭白衬衫,搭配藏青酒红条纹徽章学院风领结;.jpg","mode":"100644","type":"blob","sha":"4ba75d20f3c918da1aca6a32a3cc7af5ac6d4f2b","size":30432,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4ba75d20f3c918da1aca6a32a3cc7af5ac6d4f2b"},{"path":"image/ID_Photo/1. 服装_女士/14.马甲-米白细黑边 V 领针织背心,内搭白衬衫,配粉白格纹领结,清新学院风;.jpg","mode":"100644","type":"blob","sha":"af39078aa49c08efcf1410be26126f0404f0d556","size":29871,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/af39078aa49c08efcf1410be26126f0404f0d556"},{"path":"image/ID_Photo/1. 服装_女士/15.衬衫-黑色超长尖领平肩泡泡袖衬衫,搭配黑白格纹领带,极具设计感,利落又带点甜酷学院风;.jpg","mode":"100644","type":"blob","sha":"dbc8d87eee69c893329001691bb763383b07bf51","size":28767,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/dbc8d87eee69c893329001691bb763383b07bf51"},{"path":"image/ID_Photo/1. 服装_女士/16.衬衫-黑色缎面质感 V 领翻领衬衫,单排银色纽扣,简约垂坠通勤款;.jpg","mode":"100644","type":"blob","sha":"fb47744dd556d723eadd04a806192fdc8e37590b","size":25665,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/fb47744dd556d723eadd04a806192fdc8e37590b"},{"path":"image/ID_Photo/1. 服装_女士/17.衬衫-克莱因蓝宽松衬衫,搭配黑白棋盘格领带,天鹅颈,直角肩,是酷飒个性的学院休闲风;.jpg","mode":"100644","type":"blob","sha":"41e9ca3fd5e03759f63fd058ed6df3b1d60f0e58","size":30859,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/41e9ca3fd5e03759f63fd058ed6df3b1d60f0e58"},{"path":"image/ID_Photo/1. 服装_女士/18.衬衫-焦糖色粗麻布外套,明线翻领,金属纽扣装饰,直角垫肩,简约复古的休闲工装风;.jpg","mode":"100644","type":"blob","sha":"8e5545c6ff993a7e22983508305fe5f5a75b2bb3","size":28777,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8e5545c6ff993a7e22983508305fe5f5a75b2bb3"},{"path":"image/ID_Photo/1. 服装_女士/19.T恤-对称的黑色大圆领长袖 T 恤,低领,简约修身,百搭日常休闲风,艺考证件照装.jpg","mode":"100644","type":"blob","sha":"941897199abd31f9f9c59d9b94b589a29d7854fc","size":33080,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/941897199abd31f9f9c59d9b94b589a29d7854fc"},{"path":"image/ID_Photo/1. 服装_女士/20.减龄-亮黄色针织背心,内搭带大蕾丝荷叶领的白衬衫,甜美温柔的少女风;.jpg","mode":"100644","type":"blob","sha":"cd500017968e9c19b3f46454a807918bc49c9ab8","size":32763,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/cd500017968e9c19b3f46454a807918bc49c9ab8"},{"path":"image/ID_Photo/1. 服装_女士/21.减龄-绿白条纹一字肩露肩衬衫,带可调细吊带,清新温柔的韩系休闲风;.jpg","mode":"100644","type":"blob","sha":"a54102da6a369fbdffefa18bd888d5b1b583f028","size":30288,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a54102da6a369fbdffefa18bd888d5b1b583f028"},{"path":"image/ID_Photo/1. 服装_女士/22.减龄-米白色肌理感大翻尖领上衣,领口拼接棕金编织与刺绣装饰,带同色系打结饰带,精致优雅,是轻熟温柔的知性风。.jpg","mode":"100644","type":"blob","sha":"d75f2d27fb3b22acbf0fa9dfa8ef7f02601720a2","size":30647,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d75f2d27fb3b22acbf0fa9dfa8ef7f02601720a2"},{"path":"image/ID_Photo/1. 服装_女士/23.减龄-浅薄荷蓝雪纺上衣,带超大白色翻领蕾丝边,紧身款,清新甜美的韩系少女风.jpg","mode":"100644","type":"blob","sha":"82e4503cbd214e0517077d98a3f16b0ac1e649f9","size":31473,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/82e4503cbd214e0517077d98a3f16b0ac1e649f9"},{"path":"image/ID_Photo/1. 服装_女士/24.减龄-浅薄荷绿娃娃领针织开衫,带白蕾丝边,清新温柔的韩系少女风.jpg","mode":"100644","type":"blob","sha":"b19d794563287f0c81d2f93391ced30c83a53e7f","size":30938,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/b19d794563287f0c81d2f93391ced30c83a53e7f"},{"path":"image/ID_Photo/1. 服装_女士/25.减龄-深棕领黑底水手服,领部带棕黄条纹与刺绣,搭配同色领结,直角肩,日系学院风;.jpg","mode":"100644","type":"blob","sha":"b739ccbf7207bd2835dcb02a2b5d6f1bf22cefd5","size":34191,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/b739ccbf7207bd2835dcb02a2b5d6f1bf22cefd5"},{"path":"image/ID_Photo/1. 服装_女士/26.白衬衫-纯白尖领衬衫,门襟带同色纽扣,搭配酒红 + 米白 + 藏青条纹撞色领结,是清爽元气的日系学院风,.jpg","mode":"100644","type":"blob","sha":"c9956b121e684989384ec9555dcc5b8f005784bf","size":37346,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/c9956b121e684989384ec9555dcc5b8f005784bf"},{"path":"image/ID_Photo/1. 服装_女士/27.白衬衫-纯白尖领衬衫,领口带银色细链镶边装饰,搭配蓝棕打结细条饰带,清新元气,学院风。.jpg","mode":"100644","type":"blob","sha":"84488b892aeb32066d690f6f8d749ac096ef859d","size":38001,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/84488b892aeb32066d690f6f8d749ac096ef859d"},{"path":"image/ID_Photo/1. 服装_女士/28.白衬衫-纯白基础款尖领纯棉衬衫,门襟带同色纽扣,面料干净挺括,无多余装饰,是简约清爽的学院通勤风.jpg","mode":"100644","type":"blob","sha":"8598cf53cbcf85e414e8d4479666c45e66280148","size":35387,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8598cf53cbcf85e414e8d4479666c45e66280148"},{"path":"image/ID_Photo/1. 服装_女士/29.轻熟风-黑色一字肩上衣,双层翻折领口设计,面料贴身显瘦,短袖剪裁,露出锁骨,简约大方,是气质温柔的轻熟风.jpg","mode":"100644","type":"blob","sha":"fae3f8bed945707f5e6a12f1d15f9c63a58f0000","size":35732,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/fae3f8bed945707f5e6a12f1d15f9c63a58f0000"},{"path":"image/ID_Photo/1. 服装_女士/30.小清新-青白搭配的格纹小香风拼接上衣,搭配白色大翻领V形尖领泡泡袖,白色袖子,露出锁骨,清新减龄,甜美学院风.jpg","mode":"100644","type":"blob","sha":"e83b169853d3be206218e5d079e3cfbb7a4d5140","size":41732,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e83b169853d3be206218e5d079e3cfbb7a4d5140"},{"path":"image/ID_Photo/1. 服装_女士/31.主持人-白色肌理感平驳领西装,内搭雾霾蓝一字肩针织打底,剪裁利落柔和,露出锁骨,是知性温柔的轻熟通勤风.jpg","mode":"100644","type":"blob","sha":"81004ccef74cad32abd142a6e3d6a8a201c1650e","size":36810,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/81004ccef74cad32abd142a6e3d6a8a201c1650e"},{"path":"image/ID_Photo/1. 服装_女士/32.职业装-经典黑色平驳领西装外套,内搭白色尖领 V 字门襟衬衫,衬衫领子外翻在西装之上,剪裁利落,是干练正式的职业通勤风.jpg","mode":"100644","type":"blob","sha":"619969ec1ccefeea4bf986946db61235a13be763","size":37930,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/619969ec1ccefeea4bf986946db61235a13be763"},{"path":"image/ID_Photo/1. 服装_女士/33.西装-经典黑色平驳领西装外套,内搭白色衬衫,搭配红色领带,是干练正式的职业通勤风.jpg","mode":"100644","type":"blob","sha":"09ab6c7c4b6680b242765e643481e5e171a619ff","size":38978,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/09ab6c7c4b6680b242765e643481e5e171a619ff"},{"path":"image/ID_Photo/1. 服装_女士/34.白衬衫-经典纯棉白衬衫,搭配红色领带,整洁利落.jpg","mode":"100644","type":"blob","sha":"360cfdd78419617d7cbff0ef9357f7d2f0b5728e","size":40375,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/360cfdd78419617d7cbff0ef9357f7d2f0b5728e"},{"path":"image/ID_Photo/1. 服装_女士/35.职业装-黑色平驳领西装外套,内搭白尖领衬衫,搭配黑色哑光领带,剪裁挺括利落,是正式干练的职业通勤风.jpg","mode":"100644","type":"blob","sha":"4cdc890dd82860af5a42843e9fc4605965ed410b","size":37677,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4cdc890dd82860af5a42843e9fc4605965ed410b"},{"path":"image/ID_Photo/1. 服装_女士/36.黑衬衫-黑色双层娃娃领尖领衬衫,领口带白色波浪线包边,门襟配黑色纽扣与丝绒系带,温柔又减龄,是清新甜美的日系学院风。.jpg","mode":"100644","type":"blob","sha":"4d56d9b8084eee151d407bf38d0d9a72023581e4","size":37890,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4d56d9b8084eee151d407bf38d0d9a72023581e4"},{"path":"image/ID_Photo/1. 服装_女士/37.学院风-白色 V 领针织背心,藏青条纹包边,内搭白衬衫,搭配镶钻黑底金边领结,精致学院风,元气减龄。.jpg","mode":"100644","type":"blob","sha":"7aba80549bf0149b24be7e5894adf5a55b0a81dd","size":44333,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/7aba80549bf0149b24be7e5894adf5a55b0a81dd"},{"path":"image/ID_Photo/1. 服装_女士/38.韩系少女-浅绿白竖条纹方领泡泡袖,领口与袖口带夸张的荷叶边,前襟装饰同面料蝴蝶结,清新俏皮,是甜美减龄的韩系少女风.jpg","mode":"100644","type":"blob","sha":"0edb7803f1196832bf80e15f0f9c86fbe6df6ab9","size":45085,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0edb7803f1196832bf80e15f0f9c86fbe6df6ab9"},{"path":"image/ID_Photo/1. 服装_女士/39.日系-米杏色 V 领针织背心,带深棕条纹包边与猫咪刺绣,内搭白衬衫,搭配棕格纹领结,元气减龄,是清新日系学院风.jpg","mode":"100644","type":"blob","sha":"a3253cc6271f84cb5b24823fa95d008b86b8b29f","size":45472,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a3253cc6271f84cb5b24823fa95d008b86b8b29f"},{"path":"image/ID_Photo/1. 服装_女士/40.衬衫-雾霾蓝缎面尖领衬衫,面料垂坠有光泽,搭配12厘米蓝棕超短装饰小领带,是温柔知性的轻熟通勤风.jpg","mode":"100644","type":"blob","sha":"8dc616681521538a068ef683437dc05cec5e1f1b","size":44637,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8dc616681521538a068ef683437dc05cec5e1f1b"},{"path":"image/ID_Photo/1. 服装_女士/41.蓝衬衫-浅蓝色竖条纹衬衫,尖领设计,门襟配钻石纽扣,左胸带心形刺绣标,清爽简约,是干净利落的学院通勤风.jpg","mode":"100644","type":"blob","sha":"2c1c7c38c2b7e9084bfca0d053030805fef43b72","size":44392,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/2c1c7c38c2b7e9084bfca0d053030805fef43b72"},{"path":"image/ID_Photo/1. 服装_女士/42.衬衫-红色(带极细的暗竖纹)低尖领长袖衬衫,配同色系扁平领带,领带中央有三颗金属圆形纽扣直接缝在表面,肩部泡泡袖,硕大的乳房,纤细的腰.jpg","mode":"100644","type":"blob","sha":"5fc200f4f00aa400ce30393cd1f1c25583ecf3d9","size":27670,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5fc200f4f00aa400ce30393cd1f1c25583ecf3d9"},{"path":"image/ID_Photo/2. 服装_男士","mode":"040000","type":"tree","sha":"91439cc017c646b9efcffa8bac5b9ec41b2ddae3","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/91439cc017c646b9efcffa8bac5b9ec41b2ddae3"},{"path":"image/ID_Photo/2. 服装_男士/01.衬衫-浅焦糖色尖领衬衫,面料顺滑简约,搭配深棕颗粒针织领带,领带上方有白色横条,色调温暖柔和,是温柔轻熟的休闲通勤风。.jpg","mode":"100644","type":"blob","sha":"bc77723c8e06f7bf8bc13c123b52d01a6627cc28","size":45100,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/bc77723c8e06f7bf8bc13c123b52d01a6627cc28"},{"path":"image/ID_Photo/2. 服装_男士/02.背心-浅黄绿色 V 领针织背心,波浪下摆带品牌标,内搭米白衬衫,搭配蓝黄条纹领带,清新减龄,是元气日系学院风。.jpg","mode":"100644","type":"blob","sha":"6d80d0008b68f5d246f0cccb7a7bdb5a2b91aac4","size":48607,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/6d80d0008b68f5d246f0cccb7a7bdb5a2b91aac4"},{"path":"image/ID_Photo/2. 服装_男士/03.西装-灰绿色学院风西装,单扣平驳领,左胸配精致校徽徽章,内搭白衬衫 + 棕蓝条纹领带,清新减龄,是元气日系学院风。.jpg","mode":"100644","type":"blob","sha":"a46c37978e6b2b17c894962bdf31dd05b748aa4b","size":45385,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a46c37978e6b2b17c894962bdf31dd05b748aa4b"},{"path":"image/ID_Photo/2. 服装_男士/04.正装-雾霾蓝灯芯绒平驳领西装,左胸饰金色麦穗胸针,内搭白色尖领衬衫,搭配黑色领带,领带上有银质五角星图案,复古质感,是雅痞轻熟的商务休闲风。.jpg","mode":"100644","type":"blob","sha":"7d6000d9fb8289d86f6ce5c113bda16df86e02d1","size":51622,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/7d6000d9fb8289d86f6ce5c113bda16df86e02d1"},{"path":"image/ID_Photo/2. 服装_男士/05.西装-孔雀蓝人字纹粗花呢西装,单扣平驳领剪裁,内搭黑色高领打底配银链,复古质感,是雅痞轻熟的休闲通勤风.jpg","mode":"100644","type":"blob","sha":"6fda213fc68b0f0167d1c9130aa3ca4c8cb71db1","size":49908,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/6fda213fc68b0f0167d1c9130aa3ca4c8cb71db1"},{"path":"image/ID_Photo/2. 服装_男士/06.西装-浅蓝灰细条纹平驳领西装,内搭白色尖领衬衫,搭配蓝色细格纹领带,剪裁利落,是清爽干练的商务通勤风.jpg","mode":"100644","type":"blob","sha":"f6255c3a41233d1523fa45a49f0680cc9775ede3","size":45157,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f6255c3a41233d1523fa45a49f0680cc9775ede3"},{"path":"image/ID_Photo/2. 服装_男士/07.商务-浅灰蓝色细条纹平驳领西装三件套(外套 + 同色系马甲),内搭蓝白竖条纹尖领衬衫,搭配深蓝色佩斯利花纹领带,胸袋处点缀同色系口袋巾;商务正装风。.jpg","mode":"100644","type":"blob","sha":"1bb218876c5add3ed15f3b45b0eb549ec9d71176","size":58390,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1bb218876c5add3ed15f3b45b0eb549ec9d71176"},{"path":"image/ID_Photo/2. 服装_男士/08.西装-深灰暗格纹平驳领西装,左胸点缀红白格袋巾,内搭白衬衫与黑白格纹领带,剪裁利落,是正式干练的商务通勤风。.jpg","mode":"100644","type":"blob","sha":"ef8f73e84afaab0dcb62ec34db1381209ce8a3e6","size":45979,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ef8f73e84afaab0dcb62ec34db1381209ce8a3e6"},{"path":"image/ID_Photo/2. 服装_男士/09.正装-藏青色明线装饰西装,左胸饰银色六芒星胸针,内搭白色尖领衬衫,搭配黑色细格纹领带,剪裁利落,是清新减龄的日系学院风正装。.jpg","mode":"100644","type":"blob","sha":"276f36b92a289db339408ad16b422b33b571c308","size":51190,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/276f36b92a289db339408ad16b422b33b571c308"},{"path":"image/ID_Photo/2. 服装_男士/10.正装-淡紫咖色平驳领西装外套搭配同色系单扣马甲,内搭黑色尖领衬衫,配灰底白点领带,剪裁利落,是兼具正式感与轻熟雅痞感的商务休闲风。.jpg","mode":"100644","type":"blob","sha":"917b2e7d52d7e322c832f69649b46f5b6ca10403","size":47095,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/917b2e7d52d7e322c832f69649b46f5b6ca10403"},{"path":"image/ID_Photo/2. 服装_男士/11.正装-酒红色学院风西装,采用白色明线镶边设计,左胸口袋印有 “ROWING CLUB” 主题刺绣;内搭白色尖领衬衫,配同色系酒红底白条纹领带(带有徽章与品牌字母印花).jpg","mode":"100644","type":"blob","sha":"9808a364e2ea1e6685c62a9752f2bab9452265ef","size":64497,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9808a364e2ea1e6685c62a9752f2bab9452265ef"},{"path":"image/ID_Photo/2. 服装_男士/12.正装-炭灰色纹理平驳领西装,内搭白色尖领衬衫,搭配蓝底金色佩斯利花纹领带,剪裁利落大气,兼具正式感与复古质感,是干练稳重的商务通勤风。.jpg","mode":"100644","type":"blob","sha":"dc447462999713fcdcf950972d853626f756e67d","size":54600,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/dc447462999713fcdcf950972d853626f756e67d"},{"path":"image/ID_Photo/2. 服装_男士/13.职业装-深灰蓝纹理平驳领西装,内搭白蓝细格纹衬衫,搭配深紫纯色领带,剪裁利落,是正式干练的商务通勤风。.jpg","mode":"100644","type":"blob","sha":"af610d6b1a6955ae521b0c04f625152be4c90590","size":49113,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/af610d6b1a6955ae521b0c04f625152be4c90590"},{"path":"image/ID_Photo/2. 服装_男士/14.正装-白色平驳领西装,白色双排扣,左胸饰黑色缎面口袋巾,内搭黑色立领衬衫,剪裁利落大气,黑白撞色搭配精致高级,是干练优雅的轻熟正装风。.jpg","mode":"100644","type":"blob","sha":"655c704e652f0397aa9e02f128b21cb6d5c77c11","size":52031,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/655c704e652f0397aa9e02f128b21cb6d5c77c11"},{"path":"image/ID_Photo/2. 服装_男士/15.学院风-深灰色 V 领单扣针织开衫,内搭白色尖领衬衫,搭配灰蓝菱格纹带皇冠图案领带,整体是温柔元气的日系学院风。.jpg","mode":"100644","type":"blob","sha":"8907cd550beea8cd28663fbc552ec7252a787331","size":53599,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8907cd550beea8cd28663fbc552ec7252a787331"},{"path":"image/ID_Photo/2. 服装_男士/16.正装-藏青格纹平驳领西装,左胸饰银色胸针,内搭白色尖领衬衫,搭配灰蓝斜纹领带,剪裁利落,是正式干练的商务职业装。.jpg","mode":"100644","type":"blob","sha":"51a2847615be11fb249404188c942d7bf1ae3ca0","size":50826,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/51a2847615be11fb249404188c942d7bf1ae3ca0"},{"path":"image/ID_Photo/2. 服装_男士/17.正装-藏青色平驳领西装,内搭白色尖领衬衫,搭配酒红藏青条纹带徽章领带,剪裁利落,兼具正式感与学院气质,是干练商务学院风。.jpg","mode":"100644","type":"blob","sha":"f6fa06c86c67ec985376e12c0830f0e75362b23e","size":51327,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f6fa06c86c67ec985376e12c0830f0e75362b23e"},{"path":"image/ID_Photo/2. 服装_男士/18.正装-浅卡其色平驳领西装三件套(外套 + 同色系马甲),内搭浅蓝色尖领衬衫,搭配蓝底黄色圆形斑点领带,面料细腻剪裁合身,整体是温柔清爽的轻熟商务正装风.jpg","mode":"100644","type":"blob","sha":"05cd22e1f6c95e5c16d9541d23c252c811a231ec","size":58032,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/05cd22e1f6c95e5c16d9541d23c252c811a231ec"},{"path":"image/ID_Photo/2. 服装_男士/19.西装-深灰细条纹平驳领西装,内搭白色尖领衬衫,搭配蓝白斜纹领带,剪裁挺括利落,是正式干练的商务通勤风.jpg","mode":"100644","type":"blob","sha":"23937b050128c3ebe798b3396413a442764e3f7a","size":43870,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/23937b050128c3ebe798b3396413a442764e3f7a"},{"path":"image/ID_Photo/2. 服装_男士/20.正装-经典黑色平驳领西装外套,内搭白色衬衫,搭配红色领带,是干练正式的职业通勤风.jpg","mode":"100644","type":"blob","sha":"c84e12d4391fec23b3379335014fda3437f60fd9","size":63231,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/c84e12d4391fec23b3379335014fda3437f60fd9"},{"path":"image/ID_Photo/2. 服装_男士/21.西装-低饱和橄榄绿平驳领西装,哑光纹理面料,剪裁利落简约,内搭白色尖领衬衫(第一颗扣子打开),整体清新柔和,是温柔轻熟的休闲通勤风,清爽不刻板。.jpg","mode":"100644","type":"blob","sha":"5db681f01dccef83c6b0573aceaeb52a1e1e2e31","size":46330,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5db681f01dccef83c6b0573aceaeb52a1e1e2e31"},{"path":"image/ID_Photo/2. 服装_男士/22.西装-淡紫灰底黑绿格纹粗花呢西装,平驳领剪裁,内搭白色高领针织衫,复古质感,是轻熟英伦风,休闲又不失格调.jpg","mode":"100644","type":"blob","sha":"15c1bce5a9e861dc6a475c0c460c8d2ee191866f","size":45469,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/15c1bce5a9e861dc6a475c0c460c8d2ee191866f"},{"path":"image/ID_Photo/2. 服装_男士/23.衬衫-浅绿白格纹尖领衬衫(胸前带口袋),采用敞开穿着的方式,露出内搭的白色圆领基础 T 恤,搭配银色细链条项链;版型宽松清爽,整体是清新干净的日系休闲风。.jpg","mode":"100644","type":"blob","sha":"a966740ba61efbc2212db2e14c96f5556f81d589","size":58833,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a966740ba61efbc2212db2e14c96f5556f81d589"},{"path":"image/ID_Photo/2. 服装_男士/24.衬衫-浅紫色短袖尖领衬衫,左胸带口袋,搭配灰底白格纹领带,版型宽松清爽,整体是清新减龄的日系学院风,干净柔和,适配证件照的元气质感。.jpg","mode":"100644","type":"blob","sha":"4efaf48be7d4e6d0e277a0f4a13213036696d2ac","size":51065,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4efaf48be7d4e6d0e277a0f4a13213036696d2ac"},{"path":"image/ID_Photo/2. 服装_男士/25.马甲-黑色立领工装马甲(带大口袋、单排扣设计),内搭白色尖领衬衫,搭配金色底蓝菱格纹领带,版型利落清爽,兼具学院感与工装质感,是元气减龄的日系学院风。.jpg","mode":"100644","type":"blob","sha":"e840ad3d68460656148f73dc41b0a9a97eb8dfe6","size":55139,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e840ad3d68460656148f73dc41b0a9a97eb8dfe6"},{"path":"image/ID_Photo/2. 服装_男士/26.马甲-浅紫偏蓝色圆领针织马甲,叠穿白色基础 T 恤,搭配银色古巴链项链,整体是温柔清新的韩系休闲风,自带少年感。.jpg","mode":"100644","type":"blob","sha":"5687ee1a734347acc6651d08bca3c8d03307ce8a","size":51233,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5687ee1a734347acc6651d08bca3c8d03307ce8a"},{"path":"image/ID_Photo/2. 服装_男士/27.毛衣-西瓜红(带白杂点)圆领针织毛衣,叠穿白色尖领衬衫并搭配黑色领带;毛衣带亮片,版型宽松柔和,整体是温暖又兼具正式感的学院风穿搭。.jpg","mode":"100644","type":"blob","sha":"ed2fa58eb0c33db15f86d50f3bc0fec212da50ec","size":60480,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ed2fa58eb0c33db15f86d50f3bc0fec212da50ec"},{"path":"image/ID_Photo/2. 服装_男士/28.毛衣-青绿色圆领针织毛衣,采用立体斜向交叉编织纹理(菱格肌理),版型宽松柔和,清新的韩系休闲风.jpg","mode":"100644","type":"blob","sha":"83d08ce2151da76951217333ccb1fc1cfdd106d3","size":62301,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/83d08ce2151da76951217333ccb1fc1cfdd106d3"},{"path":"image/ID_Photo/2. 服装_男士/29.白衬衫-纯白基础款尖领纯棉衬衫,门襟带同色纽扣,面料干净挺括,无多余装饰,是简约清爽的学院通勤风.jpg","mode":"100644","type":"blob","sha":"56f7e3861b883e9194e286e9796859919d5fa2fa","size":61130,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/56f7e3861b883e9194e286e9796859919d5fa2fa"},{"path":"image/ID_Photo/2. 服装_男士/30.白衬衫-经典纯棉白衬衫,搭配红色领带,整洁利落.jpg","mode":"100644","type":"blob","sha":"8bb3d9caf13878333beea7df76a48a02712ceafd","size":62117,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8bb3d9caf13878333beea7df76a48a02712ceafd"},{"path":"image/ID_Photo/2. 服装_男士/31.衬衫-纯白色尖领衬衫,版型简约利落,搭配黄白格纹领带,整体是清爽元气的日系学院风穿搭,干净减龄.jpg","mode":"100644","type":"blob","sha":"95ad169f820b4ab3ad825d9346502e4b343aeeb7","size":59249,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/95ad169f820b4ab3ad825d9346502e4b343aeeb7"},{"path":"image/ID_Photo/2. 服装_男士/32.衬衫-浅蓝色细纹理尖领衬衫,胸前带口袋,第一颗扣子敞开,垂坠感面料清爽柔软,整体干净大方,是清新简约的休闲风,适配证件照的清爽质感。.jpg","mode":"100644","type":"blob","sha":"829a3b096a0bb4623bfbe8dc235352f453bc97ce","size":51684,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/829a3b096a0bb4623bfbe8dc235352f453bc97ce"},{"path":"image/ID_Photo/2. 服装_男士/33.衬衫-藏青色古巴领衬衫,印有热带绿植(龟背叶、棕榈叶)与橙子印花,采用敞开穿着的方式,未系扣,露出内搭的白色圆领基础 T 恤;整体是清新松弛的度假休闲风.jpg","mode":"100644","type":"blob","sha":"9ca4ef01f92b8c0a4952358df3366021e1f211ce","size":66005,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9ca4ef01f92b8c0a4952358df3366021e1f211ce"},{"path":"image/ID_Photo/2. 服装_男士/34.休闲-黑色尖领衬衫,采用白色明线撞色设计(领口、门襟、肩部线条清晰勾勒),左胸印有 “Urban Culture” 白色文字印花,搭配透明质感纽扣;清爽利落的街头休闲风。.jpg","mode":"100644","type":"blob","sha":"f2cfecc3b1c9a44f84c830c5dcf8ae194acd87f9","size":57394,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f2cfecc3b1c9a44f84c830c5dcf8ae194acd87f9"},{"path":"image/ID_Photo/2. 服装_男士/35.正装-炭黑色细纹理平驳领西装,内搭黑色圆领基础 T 恤,剪裁利落简约,整体是沉稳干练的轻商务休闲风。.jpg","mode":"100644","type":"blob","sha":"fcf3877b4db5fb8509217861be5603b3653b1124","size":51379,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/fcf3877b4db5fb8509217861be5603b3653b1124"},{"path":"image/ID_Photo/2. 服装_男士/36.中山装-黑色立领中山装式上衣,门襟饰金属包边纽扣,内搭白衬衫,剪裁利落挺括,是兼具复古感与正式感的新中式正装风.jpg","mode":"100644","type":"blob","sha":"5d25ac717ea81133588cc1f636249a293056ac37","size":40778,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5d25ac717ea81133588cc1f636249a293056ac37"},{"path":"image/ID_Photo/2. 服装_男士/37.T恤-白色圆领 T 恤,采用藏青色撞色领口设计,版型简约利落,整体是清爽干净的休闲风,自带少年感,适配证件照的清新质感。.jpg","mode":"100644","type":"blob","sha":"15fc2dbf43a05a4d22e34d7ed5a215ef8290d690","size":58254,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/15fc2dbf43a05a4d22e34d7ed5a215ef8290d690"},{"path":"image/ID_Photo/2. 服装_男士/38.T恤-黑色 U 型领基础 T 恤,面料柔软简约无装饰,剪裁利落干净,是极简百搭的休闲风,低调清爽,适配证件照的简约质感。.jpg","mode":"100644","type":"blob","sha":"fa267bd8b92f502b9d2d58dda1b18b05e186499a","size":45581,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/fa267bd8b92f502b9d2d58dda1b18b05e186499a"},{"path":"image/ID_Photo/2. 服装_男士/39.韩系-黑色圆领针织马甲,叠穿深灰色细条纹尖领衬衫,搭配银色双吊坠项链,整体是清爽少年感的韩系学院风,简约干净,适配证件照的元气质感。.jpg","mode":"100644","type":"blob","sha":"68118278a59b5827a32ac211a5485c6321489bc7","size":56281,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/68118278a59b5827a32ac211a5485c6321489bc7"},{"path":"image/ID_Photo/2. 服装_男士/40.学院风-藏青 V 领针织背心,领口和袖口带白边麻花织纹,内搭白衬衫,搭配蓝白条纹领带,清爽减龄,是元气清新的日系学院风。.jpg","mode":"100644","type":"blob","sha":"c151b0f86b2cb47664340ddc6ff67a5bce9fe276","size":48034,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/c151b0f86b2cb47664340ddc6ff67a5bce9fe276"},{"path":"image/ID_Photo/3. 服装_女童","mode":"040000","type":"tree","sha":"0c9119076b1e71a3b2039563d40bff15d08ff5fa","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/0c9119076b1e71a3b2039563d40bff15d08ff5fa"},{"path":"image/ID_Photo/3. 服装_女童/01-儿童甜美风上衣,白色网纱长袖带细小波点、透视质感;领口白色木耳荷叶边;衣身白色小香风粗花呢面料,带金色细闪,前襟白色珍珠扣;白色肩带装饰金色纱质蝴蝶结.jpg","mode":"100644","type":"blob","sha":"ee418926dbb497d57f245425189f1ac7cd6b4aaf","size":88430,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ee418926dbb497d57f245425189f1ac7cd6b4aaf"},{"path":"image/ID_Photo/3. 服装_女童/02-白色水手领上衣,领口带蓝色细条纹镶边,胸前佩戴粉色格纹大蝴蝶结,儿童学院风水手服款式,清新甜美风格.jpg","mode":"100644","type":"blob","sha":"25f2669ffc7c51672c91f6c062d9c00b29c52636","size":87002,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/25f2669ffc7c51672c91f6c062d9c00b29c52636"},{"path":"image/ID_Photo/3. 服装_女童/03-白色学院风儿童上衣,藏青色大翻领配白色细镶边,搭配同色藏青领带(领带下部带两道白色 V 形条纹),前襟双排金色圆形纽扣,左胸装饰小熊刺绣徽章,泡泡长袖设计。.jpg","mode":"100644","type":"blob","sha":"15293e75fcb2af4d0813ab333495c3ec09543ae2","size":91948,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/15293e75fcb2af4d0813ab333495c3ec09543ae2"},{"path":"image/ID_Photo/3. 服装_女童/04-宝蓝色学院风西装,双排扣配金色纽扣,口袋带白边装饰,内搭白衬衫,搭配蓝白格纹大蝴蝶结领结,精致学院校服款式.jpg","mode":"100644","type":"blob","sha":"bf906585991d894baadb1876d3ed98f7f335a46c","size":85476,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/bf906585991d894baadb1876d3ed98f7f335a46c"},{"path":"image/ID_Photo/3. 服装_女童/05-酒红色儿童学院风西装外套,内搭白色尖领衬衫,领口系酒红与墨绿交织的格纹蝴蝶结领结,格纹带有浅色线条装饰,蝴蝶结衬于外套这之上,整体为利落的校服款式,面料挺括有型.jpg","mode":"100644","type":"blob","sha":"4882aff47d498fdf36752c1941856a08f5865409","size":91770,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4882aff47d498fdf36752c1941856a08f5865409"},{"path":"image/ID_Photo/3. 服装_女童/06-浅灰色儿童针织开衫,奶白色彼得潘娃娃领,领部装饰同色系大蝴蝶结,前襟米白色圆形纽扣,肩部两侧立体波浪荷叶边木耳卷边,甜美学院风,软萌小公主款式.jpg","mode":"100644","type":"blob","sha":"dd3ff06512868db15d818249326f19d4de915668","size":81807,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/dd3ff06512868db15d818249326f19d4de915668"},{"path":"image/ID_Photo/3. 服装_女童/07-蕾丝超大翻领白色衬衫,翻领超过肩膀,搭配格纹领结,领结上贴着一只极小的小熊,整体是清新甜美的学院风,温柔可爱,适配儿童证件照造型.jpg","mode":"100644","type":"blob","sha":"4b146e9bc5c4f9a88c0d3516031e4d90d87c95da","size":79653,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4b146e9bc5c4f9a88c0d3516031e4d90d87c95da"},{"path":"image/ID_Photo/3. 服装_女童/08-白色短袖 Polo 衫,藏青红格纹翻领,胸前带校徽,搭配同款格纹百褶裙,衣领上有向日葵装饰品,学院风儿童校服。.jpg","mode":"100644","type":"blob","sha":"0ef8f9fb50857dd5d132a6f3e07185b0174bbf2a","size":80775,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0ef8f9fb50857dd5d132a6f3e07185b0174bbf2a"},{"path":"image/ID_Photo/3. 服装_女童/09-白色尖翻领衬衫,巨型泡泡短袖,前襟纽扣设计;领口搭配黑色交叉式领结,领结中央镶嵌带珍珠的金色圆形装饰,精致学院风儿童服饰.jpg","mode":"100644","type":"blob","sha":"1974366c76385e06d1caa180ea48cca8c6237943","size":85901,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1974366c76385e06d1caa180ea48cca8c6237943"},{"path":"image/ID_Photo/3. 服装_女童/10-白色竖坑条纹理短袖上衣,彼得潘娃娃领,搭配12厘米黑白细条纹徽章超短小领带装饰,带松弛感的简约学院风儿童服饰.jpg","mode":"100644","type":"blob","sha":"90d7e7a45076edfdf2a70777f804e04eba6764c9","size":85872,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/90d7e7a45076edfdf2a70777f804e04eba6764c9"},{"path":"image/ID_Photo/3. 服装_女童/11-藏蓝色儿童学院风西装外套,白色驳领,左右衣领装饰白色星星刺绣,单排金色纽扣,内搭白色尖领衬衫,搭配藏蓝色领带,面料挺括,清爽正式的校服款式.jpg","mode":"100644","type":"blob","sha":"efc0488916b416527142caab7d3bb6afcc4d79a1","size":93319,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/efc0488916b416527142caab7d3bb6afcc4d79a1"},{"path":"image/ID_Photo/3. 服装_女童/12-粉色儿童针织毛衣,主体纯色,袖子与领口为粉灰条纹,领口装饰同条纹的大蝴蝶结,带垂坠飘带,整体温柔学院风,针织纹理清晰.jpg","mode":"100644","type":"blob","sha":"e2772251d69cbd4187ced34cd6aa1c4eb51de41d","size":86804,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e2772251d69cbd4187ced34cd6aa1c4eb51de41d"},{"path":"image/ID_Photo/3. 服装_女童/13-儿童小香风外套,白黑混色丝线粗花呢面料,带白色蕾丝镶边的大翻领,前襟薄荷绿圆形纽扣,精致优雅风格.jpg","mode":"100644","type":"blob","sha":"e702574d752a3b969b4895c4c6573d056dc8eb16","size":85710,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e702574d752a3b969b4895c4c6573d056dc8eb16"},{"path":"image/ID_Photo/3. 服装_女童/14-藏青色儿童水手服上衣,交叉式水手领配白色宽镶边,短袖袖口带同色镶边,前襟双排扣设计,纽扣含黑白两色,经典学院风水手服款式,面料挺括.jpg","mode":"100644","type":"blob","sha":"e62609cef9d143a6b2c3bb77d7fce54d4bcffe3b","size":88227,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e62609cef9d143a6b2c3bb77d7fce54d4bcffe3b"},{"path":"image/ID_Photo/3. 服装_女童/15-清新学院风的儿童证件照穿搭:白色翻领衬衫外搭灰色 V 领针织背心,搭配酒红色星星条纹领结,整体干净利落,兼具活泼感与正式感,适配证件照造型.jpg","mode":"100644","type":"blob","sha":"c7076bc693f85d234dc93d5468fe90425d95ef57","size":79405,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/c7076bc693f85d234dc93d5468fe90425d95ef57"},{"path":"image/ID_Photo/3. 服装_女童/16-红色儿童短袖上衣,同色系暗条纹,喇叭袖口,面料带细闪光泽感,圆领设计,左胸装饰同色立体蝴蝶结,整体简约甜美,风格喜庆温柔.jpg","mode":"100644","type":"blob","sha":"b18a485efed3222bfd908ff59a80ef5e0a506958","size":91187,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/b18a485efed3222bfd908ff59a80ef5e0a506958"},{"path":"image/ID_Photo/3. 服装_女童/17-白色翻领衬衫,前襟带细褶设计,搭配深蓝色缎面领带,左胸佩戴带有金色刺绣、徽章及链条装饰的学院风胸针,儿童学院风制服.jpg","mode":"100644","type":"blob","sha":"d6ffb53858ea0bdcf4d61b1053fde29220cc09d8","size":83061,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d6ffb53858ea0bdcf4d61b1053fde29220cc09d8"},{"path":"image/ID_Photo/3. 服装_女童/18-白色娃娃领衬衫,外搭深绿色 V 领针织背心,V 领带白色细边,左胸有校徽,搭配绿格纹双层蝴蝶结领结,领结带白色线条与刺绣,学院风儿童校服.jpg","mode":"100644","type":"blob","sha":"9f11f45203fcd64edf1c5856d5c119c06f14b825","size":89029,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9f11f45203fcd64edf1c5856d5c119c06f14b825"},{"path":"image/ID_Photo/3. 服装_女童/19-浅米色学院风制服西装,酒红色撞色镶边,内搭白色衬衫,搭配酒红格纹蝴蝶结领结,精致学院风校服款式.jpg","mode":"100644","type":"blob","sha":"1b77ec3ad0c932ba9e2f0b8f68554553cc9053ab","size":84272,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1b77ec3ad0c932ba9e2f0b8f68554553cc9053ab"},{"path":"image/ID_Photo/3. 服装_女童/20-粉色针织儿童毛衣,灰色圆领设计,领口装饰同色系针织糖果形领结,领结边缘带粉色包边,整体温柔学院风,面料细腻有针织纹理.jpg","mode":"100644","type":"blob","sha":"e3c4d1ebea15bb71e660a9de8ab22baf36df9417","size":86203,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e3c4d1ebea15bb71e660a9de8ab22baf36df9417"},{"path":"image/ID_Photo/3. 服装_女童/21-藏蓝色儿童学院风连衣裙,大翻领配白色麦穗刺绣镶边,翻领超过肩膀,60度锐角尖领,前襟排扣设计,简约大方,证件照风格.jpg","mode":"100644","type":"blob","sha":"564bf1ec79b57c0fb7e34a67ae0c4d65592c3b8e","size":80233,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/564bf1ec79b57c0fb7e34a67ae0c4d65592c3b8e"},{"path":"image/ID_Photo/3. 服装_女童/22-白色翻领衬衫,外搭藏青色 V 领针织背心,领口带白条纹镶边,左胸有皇冠校徽,搭配格纹蝴蝶结领结,儿童学院风制服.jpg","mode":"100644","type":"blob","sha":"30ae2ad380245c61fa5d2f5e38614eff18d1e6f6","size":86029,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/30ae2ad380245c61fa5d2f5e38614eff18d1e6f6"},{"path":"image/ID_Photo/3. 服装_女童/23-白色尖翻领儿童衬衫,前襟带竖条细褶,领口系红色缎面细丝带,打成松散蝴蝶结,带自然垂坠飘带,简约学院风服饰。.jpg","mode":"100644","type":"blob","sha":"cf17b39237473da05be3dd67c184735714ea9427","size":87058,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/cf17b39237473da05be3dd67c184735714ea9427"},{"path":"image/ID_Photo/3. 服装_女童/24-藏蓝色儿童连衣裙,搭配镂空蕾丝大翻领与珍珠纽扣,泡泡袖设计,甜美学院风,精致可爱,适配证件照造型.jpg","mode":"100644","type":"blob","sha":"28bad1313cb1dabb9c43d8c9fddf54d18a8b5f9c","size":78607,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/28bad1313cb1dabb9c43d8c9fddf54d18a8b5f9c"},{"path":"image/ID_Photo/4. 服装_男童","mode":"040000","type":"tree","sha":"f590effec94774b73c9d912333d3da753c1583c0","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/f590effec94774b73c9d912333d3da753c1583c0"},{"path":"image/ID_Photo/4. 服装_男童/01-浅米色学院风西装外套,酒红色撞色镶边,内搭白衬衫,搭配灰蓝格纹领带,极细的领带打结,版型利落笔挺,清爽英伦校园风.jpg","mode":"100644","type":"blob","sha":"0ac4706cb63eff26a35c2683ec9eadd636cc0eae","size":29920,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0ac4706cb63eff26a35c2683ec9eadd636cc0eae"},{"path":"image/ID_Photo/4. 服装_男童/02-浅麻灰色学院风针织背心,藏青白条纹 V 领镶边,左胸黑底金狮校徽,内搭白衬衫,配深绿条纹领带,清爽日系校园风童装.jpg","mode":"100644","type":"blob","sha":"92414226376634abbbf953b9edb94f37148341f1","size":30426,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/92414226376634abbbf953b9edb94f37148341f1"},{"path":"image/ID_Photo/4. 服装_男童/03-深灰格纹学院风西装外套,清晰的黑白穿插格纹线条,搭配白衬衫 + 藏青条纹领带,版型利落,清爽英伦风童装.jpg","mode":"100644","type":"blob","sha":"f83088473f160a4223fb0b4ee86b0dbef248458a","size":28922,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f83088473f160a4223fb0b4ee86b0dbef248458a"},{"path":"image/ID_Photo/4. 服装_男童/04-白色学院风尖领衬衫,左胸口袋饰有皇冠校徽刺绣,搭配藏青棕白格纹免打领带,清爽减龄日系校园风.jpg","mode":"100644","type":"blob","sha":"d8866c2c38767962c721f7dad4004ade6356f334","size":28286,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d8866c2c38767962c721f7dad4004ade6356f334"},{"path":"image/ID_Photo/4. 服装_男童/05-白色学院风短袖衬衫,胸部有一条藏青横线条装饰,左胸绣有 “summer” 字样,搭配藏青免打领带,清爽简约日系校园风.jpg","mode":"100644","type":"blob","sha":"8a3b0c911a8489ef32b2cbf4ddea2162a642823a","size":27388,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8a3b0c911a8489ef32b2cbf4ddea2162a642823a"},{"path":"image/ID_Photo/4. 服装_男童/06-藏青学院风西装外套,左胸金盾形校徽,内搭白衬衫 + 灰黑格纹领带,版型笔挺,清爽英伦校园风.jpg","mode":"100644","type":"blob","sha":"075bda85856b0139ef4105de906df0d8a1cc78a1","size":28001,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/075bda85856b0139ef4105de906df0d8a1cc78a1"},{"path":"image/ID_Photo/4. 服装_男童/07-白底字母印花休闲衬衫,满印 “DIFFERENT”“GIVE YOU A STYLE” 字样,绿色小标点缀,简约潮酷日常风.jpg","mode":"100644","type":"blob","sha":"dc37d974e4191c5ca86068f52d5a9916f18f556f","size":29763,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/dc37d974e4191c5ca86068f52d5a9916f18f556f"},{"path":"image/ID_Photo/4. 服装_男童/08-浅棕(黑白红细线格纹)学院风西装马甲,V领剪裁,内搭白衬衫,搭配缎面棕色糖果形平角领结(非蝴蝶结),版型利落笔挺,清爽英伦校园风童装.jpg","mode":"100644","type":"blob","sha":"901987cbed13025ce6935356940d4fb33c9a879c","size":31648,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/901987cbed13025ce6935356940d4fb33c9a879c"},{"path":"image/ID_Photo/4. 服装_男童/09-浅灰人字纹学院风双排扣西装外套,搭配浅蓝色衬衫与藏青格纹领带,口袋饰有印花方巾,版型利落笔挺,清爽英伦校园风。.jpg","mode":"100644","type":"blob","sha":"d7364285cc3f65f5de67f03ada3b0e3f731fc3bd","size":29226,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d7364285cc3f65f5de67f03ada3b0e3f731fc3bd"},{"path":"image/ID_Photo/4. 服装_男童/10-豆沙红学院风西装外套,采用斜纹精纺西装面料,搭配白色衬衫与黑黄条纹领带,版型利落笔挺,复古英伦校园风。.jpg","mode":"100644","type":"blob","sha":"3d2b5e928a8370921f8eefa0beea2d0299807043","size":29381,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/3d2b5e928a8370921f8eefa0beea2d0299807043"},{"path":"image/ID_Photo/4. 服装_男童/11-白棕竖条纹学院风短袖衬衫,棕色镶边翻领,袖口撞色设计,搭配同色系12厘米免打儿童小领带,清爽复古日系校园风童装.jpg","mode":"100644","type":"blob","sha":"793bf760e26017fe5b8d6e1667015d817581556e","size":30138,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/793bf760e26017fe5b8d6e1667015d817581556e"},{"path":"image/ID_Photo/4. 服装_男童/12-宝蓝色学院风针织圆领背心,白边圆领,胸前小熊轮廓刺绣与英文印花,内搭尖领白衬衫,领子外翻在圆领背心之上,清爽减龄日系校园风.jpg","mode":"100644","type":"blob","sha":"ab985bac1bffb149c59b580e35d0bb1986e67c6f","size":30153,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ab985bac1bffb149c59b580e35d0bb1986e67c6f"},{"path":"image/ID_Photo/4. 服装_男童/13-藏蓝色儿童学院风西装外套,白色驳领,单排金色纽扣,内搭白色尖领衬衫,搭配装饰一颗白色星星刺绣的藏蓝色领带,面料挺括,清爽正式的校服款式.jpg","mode":"100644","type":"blob","sha":"2a2562279d5e18bb53265018a7d7fd1918631832","size":29797,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/2a2562279d5e18bb53265018a7d7fd1918631832"},{"path":"image/ID_Photo/4. 服装_男童/14-藏青细条纹学院风双排扣西装,白扣设计,内搭哑光纯棉白衬衫,搭配蓝白条纹领带,版型利落笔挺,清爽英伦校园风.jpg","mode":"100644","type":"blob","sha":"42b2d32cd99669315e8409888dcd552dd3ddc62e","size":28905,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/42b2d32cd99669315e8409888dcd552dd3ddc62e"},{"path":"image/ID_Photo/4. 服装_男童/15-白色纯棉学院风翻领衬衫,左胸小狗刺绣,搭配藏青格纹糖果形平角领结(非蝴蝶结),版型清爽利落,简约干净的日系校园风.jpg","mode":"100644","type":"blob","sha":"b3b6a98b5a895d51082a338b437ef73ef63a4ee6","size":28357,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/b3b6a98b5a895d51082a338b437ef73ef63a4ee6"},{"path":"image/ID_Photo/4. 服装_男童/16-米白色学院风绞花针织开衫,左胸靠上有小熊刺绣,配白衬衫 + 灰格纹领结,纽扣为棕色,版型利落无溜肩,软萌日系校园风男童装.jpg","mode":"100644","type":"blob","sha":"05006e8e9b476bd0540ca4e0aa1806e91d9ea723","size":30300,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/05006e8e9b476bd0540ca4e0aa1806e91d9ea723"},{"path":"image/ID_Photo/4. 服装_男童/17-草绿色学院风针织背心,V领镶米黄条纹,左胸苹果刺绣,内搭白衬衫,配酒红格纹领带,元气减龄日系校园风。.jpg","mode":"100644","type":"blob","sha":"2de75a3a20d3471e11dc3411694bdbd31c44334f","size":30610,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/2de75a3a20d3471e11dc3411694bdbd31c44334f"},{"path":"image/ID_Photo/4. 服装_男童/18-白色学院风衬衫带淡蓝色细线暗条纹,搭配藏青背带与藏青糖果形状平角领结,金属质感纽扣,清爽复古日系校园风.jpg","mode":"100644","type":"blob","sha":"b9d3bc3f62227bdcb14d3fba956444aa8c289131","size":30475,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/b9d3bc3f62227bdcb14d3fba956444aa8c289131"},{"path":"image/ID_Photo/4. 服装_男童/19-穿着经典纯棉白衬衫,剪裁合身利落,直角肩.jpg","mode":"100644","type":"blob","sha":"7e6cde32f0753f0555b64f05f7f19ff163441ddc","size":27125,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/7e6cde32f0753f0555b64f05f7f19ff163441ddc"},{"path":"image/ID_Photo/4. 服装_男童/20-藏青学院风针织 V 领背心,白边条纹镶边的领口和袖口,左胸圆形校徽刺绣,内搭浅蓝色衬衫,搭配蓝白条纹领带,清爽减龄日系校园风。.jpg","mode":"100644","type":"blob","sha":"1da73963172a109438b1fd5d0e70562dad4faab9","size":30247,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1da73963172a109438b1fd5d0e70562dad4faab9"},{"path":"image/ID_Photo/4. 服装_男童/21-灰调学院风格纹双排扣西装外套,搭配同格纹平角领结,内搭白衬衫,版型利落笔挺,清爽英伦校园风.jpg","mode":"100644","type":"blob","sha":"72c244987784c394293641617aea371c4d79434e","size":27410,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/72c244987784c394293641617aea371c4d79434e"},{"path":"image/ID_Photo/4. 服装_男童/22-酒红暗纹提花衬衫搭配灰色波点精纺西装马甲,马甲 V 领剪裁,装饰有玫瑰胸针与链条配饰,搭配藏青缎面平角领结,复古优雅英伦风.jpg","mode":"100644","type":"blob","sha":"9a3a9a524325f572e27db6e54625062020a65dc2","size":29181,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9a3a9a524325f572e27db6e54625062020a65dc2"},{"path":"image/ID_Photo/4. 服装_男童/23-酒红格纹学院风西装马甲,精纺毛呢材质,V 领单扣设计,搭配白色压褶衬衫,红色波点缎面领结点缀,复古英伦校园风.jpg","mode":"100644","type":"blob","sha":"a60ca6d007ec1d1042929ce61fecf3c4b3e80801","size":29989,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a60ca6d007ec1d1042929ce61fecf3c4b3e80801"},{"path":"image/ID_Photo/4. 服装_男童/24-米白色学院风西装外套,采用撞色白边翻领设计,内搭姜黄色衬衫,搭配藏青条纹印花领带,版型利落笔挺,清爽英伦校园风。.jpg","mode":"100644","type":"blob","sha":"03dd2dda9a20babfba9608e7c02888f9e388f2ba","size":29039,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/03dd2dda9a20babfba9608e7c02888f9e388f2ba"},{"path":"image/ID_Photo/4. 服装_男童/25-藏青学院风西装三件套,单排扣设计,内搭白衬衫与同色马甲,搭配酒红镶边宝石领结,版型利落笔挺,优雅英伦校园风.jpg","mode":"100644","type":"blob","sha":"cbcead61cc64118c54057bd1d79d121a16cab49f","size":29094,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/cbcead61cc64118c54057bd1d79d121a16cab49f"},{"path":"image/ID_Photo/4. 服装_男童/26-卡其色经典格纹长袖衬衫,黑+白+红撞色格纹,尖领 + 银色按扣门襟,版型合身,英伦学院风童装.jpg","mode":"100644","type":"blob","sha":"0ea76a3b5693d5f1de5e592ef4532500709dc609","size":31118,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0ea76a3b5693d5f1de5e592ef4532500709dc609"},{"path":"image/ID_Photo/4. 服装_男童/27-黑色学院风高领裁剪西装马甲,内搭大翻领白衬衫,衬衫衣领外翻于马甲之外,搭配藏青儿童领带,版型利落笔挺,清爽英伦校园风童装。.jpg","mode":"100644","type":"blob","sha":"032817627dc9633d38860bf54a4533bfcd3c026d","size":27727,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/032817627dc9633d38860bf54a4533bfcd3c026d"},{"path":"image/ID_Photo/4. 服装_男童/28-蓝黄竖条纹学院风短袖衬衫,搭配藏青背带与橙色折纸形平角领结,左胸口袋设计,元气减龄日系校园风.jpg","mode":"100644","type":"blob","sha":"72d7feb2e3e76f73a82fac515a18edc2c6e8bbb0","size":33199,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/72d7feb2e3e76f73a82fac515a18edc2c6e8bbb0"},{"path":"image/ID_Photo/4. 服装_男童/29-天蓝色学院风长袖衬衫,左胸刺绣徽章,搭配黑色缎面糖果形平角领结(非蝴蝶结),白色纽扣,清爽干净的日系校园风男童装.jpg","mode":"100644","type":"blob","sha":"8117b5ef24c34fc4bc6d9da1ad0fa8c4e840d44a","size":28702,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8117b5ef24c34fc4bc6d9da1ad0fa8c4e840d44a"},{"path":"image/ID_Photo/4. 服装_男童/30-深绿色学院风高领西装外套,圆角驳领,领边饰绿白细滚边,内搭白衬衫,搭配藏青条纹徽章领带,版型利落,清新英伦校园风.jpg","mode":"100644","type":"blob","sha":"cecc1c3d21c61a3df1ece1a9bf8e01806b59a0c3","size":26902,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/cecc1c3d21c61a3df1ece1a9bf8e01806b59a0c3"},{"path":"image/ID_Photo/4. 服装_男童/31-蓝白格纹学院风短袖衬衫,同色系侧袋,搭配12厘米浅蓝灰狐狸刺绣松散型小领带,清爽减龄日系校园风.jpg","mode":"100644","type":"blob","sha":"d9fddcaa57aa77a1457fe92c42331d4c93d99628","size":35228,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d9fddcaa57aa77a1457fe92c42331d4c93d99628"},{"path":"image/ID_Photo/4. 服装_男童/32-炭灰色学院风针织 V 领背心,内搭纯棉矩形窄领白衬衫,搭配藏青粉条纹徽章小领带,版型利落修身,清爽减龄日系校园风童装.jpg","mode":"100644","type":"blob","sha":"a7322bf29eb8686621a64609af58ca91c950ad46","size":27203,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a7322bf29eb8686621a64609af58ca91c950ad46"},{"path":"image/ID_Photo/5. 服装_老年","mode":"040000","type":"tree","sha":"88050b48819c2915b0ea67ece9030fc0525925ff","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/88050b48819c2915b0ea67ece9030fc0525925ff"},{"path":"image/ID_Photo/5. 服装_老年/01.女-尖领衬衫,印有蓝橙双色波点与细线条组成的几何图案,翻领设计简约大方,整体风格朴素日常,适配证件照的正式感。.jpg","mode":"100644","type":"blob","sha":"a75545b8f8915331c82aa0c32a40a5ff5b3c8b84","size":77615,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a75545b8f8915331c82aa0c32a40a5ff5b3c8b84"},{"path":"image/ID_Photo/5. 服装_老年/02.女-酒红色丝绒立领外套,前襟点缀精致的金色卷草纹刺绣,丝滑面料自带华贵质感;内搭黑色半高领针织衫,衣身带有浅调花卉暗纹刺绣,低调雅致;尽显成熟知性的优雅气质。.jpg","mode":"100644","type":"blob","sha":"2cc310aed28b5059fb3607b9750356bb6aadf022","size":68695,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/2cc310aed28b5059fb3607b9750356bb6aadf022"},{"path":"image/ID_Photo/5. 服装_老年/03.女-深紫红色翻领拉链针织开衫,采用提花工艺,衣身呈现暗红、黑色交织的菱形波浪纹肌理;门襟与翻领为纯深紫红色罗纹针织,搭配带仿钻装饰吊坠的金属拉链,版型宽松厚实。.jpg","mode":"100644","type":"blob","sha":"3fb74a9a319c218f7a5ad509cf08456efed95698","size":70238,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/3fb74a9a319c218f7a5ad509cf08456efed95698"},{"path":"image/ID_Photo/5. 服装_老年/04.女-豆沙红调针织开衫,翻领边缘带有柔和的波浪形花边,前襟以同色系圆形纽扣开合;衣身两侧对称装饰浅粉色玫瑰花卉刺绣,搭配深绿色叶片与卷草纹,点缀小巧装饰,刺绣细腻温婉。.jpg","mode":"100644","type":"blob","sha":"a4e82dac92b3e51e20faef5d3949dea5892bf224","size":70343,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a4e82dac92b3e51e20faef5d3949dea5892bf224"},{"path":"image/ID_Photo/5. 服装_老年/05.女-深酒红立领针织开衫,衣身浅粉花卉提花,搭配复古金属扣,端庄大气,是温婉典雅的中老年中式风格外套.jpg","mode":"100644","type":"blob","sha":"1dc6f1cb1c91e0e75cd18ed0ea343c4824e89054","size":72329,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1dc6f1cb1c91e0e75cd18ed0ea343c4824e89054"},{"path":"image/ID_Photo/5. 服装_老年/06.女-黑色翻领外套,领口饰有蓝色蕾丝花纹,边缘点缀白色水钻,设计精致典雅,整体沉稳大方,尽显成熟端庄气质,适配正式场合穿搭.jpg","mode":"100644","type":"blob","sha":"744e45e5c59d83673f4898d60d264c89a337a912","size":67937,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/744e45e5c59d83673f4898d60d264c89a337a912"},{"path":"image/ID_Photo/5. 服装_老年/07.女-红色翻领针织衫,采用单排扣设计,面料细腻柔和,款式简约大方,色调温暖喜庆,整体端庄得体,适配中老年证件照的正式风格.jpg","mode":"100644","type":"blob","sha":"0ca6f26f647e59d3b9d51523ea6777a6dadda3b8","size":68140,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0ca6f26f647e59d3b9d51523ea6777a6dadda3b8"},{"path":"image/ID_Photo/5. 服装_老年/08.女-大红色中式唐装外套,面料带光泽质感,翻领饰有回纹提花,采用传统一字盘扣闭合;衣身及袖口点缀精致金线花卉刺绣,内搭黑色高领针织衫。尽显传统喜庆的中式正装风格。.jpg","mode":"100644","type":"blob","sha":"ab086bbad009299a7526b5408d3bc051be62bc95","size":73399,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ab086bbad009299a7526b5408d3bc051be62bc95"},{"path":"image/ID_Photo/5. 服装_老年/09.女-紫蓝红交织的混色粗花呢立领外套,门襟饰黑色细滚边,搭配金属包边圆形纽扣,左胸点缀黑色莲花刺绣,细节精致。面料厚实有质感,风格端庄典雅,兼具中式韵味。.jpg","mode":"100644","type":"blob","sha":"439d7a1ff6126ef82d776cea9f0b6f6636e3f6d3","size":77333,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/439d7a1ff6126ef82d776cea9f0b6f6636e3f6d3"},{"path":"image/ID_Photo/5. 服装_老年/10.女-墨绿调无袖旗袍,采用传统立领、斜襟盘扣设计,边缘饰白边滚条,衣身绣淡粉牡丹与枝叶,温婉典雅,尽显东方古典韵味,端庄大气的老年装.jpg","mode":"100644","type":"blob","sha":"073957637d22fbb44aa2c487579dd5c765784631","size":75373,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/073957637d22fbb44aa2c487579dd5c765784631"},{"path":"image/ID_Photo/5. 服装_老年/11.女-清代风格清汉女袄衣,米白色提花面料,搭配青绿色镶边立领,采用斜襟、宽袖版型。衣身、领口及袖口饰有大面积蓝白牡丹花卉刺绣,色调如青花瓷般清雅。.jpg","mode":"100644","type":"blob","sha":"4c6d7ea1253e87a899ae6bbbe0dac4f4e8263588","size":81390,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4c6d7ea1253e87a899ae6bbbe0dac4f4e8263588"},{"path":"image/ID_Photo/5. 服装_老年/12.女-黑色改良旗袍长袖,采用经典立领与斜襟设计,搭配黑色盘扣,斜襟处垂有带珠饰的流苏挂饰,增添细节韵味。面料为哑光质感,版型利落修身,兼具中式典雅与现代简约风格.jpg","mode":"100644","type":"blob","sha":"ea8ff16b5fbeb13dfa71822cd94fad412de45f73","size":68350,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ea8ff16b5fbeb13dfa71822cd94fad412de45f73"},{"path":"image/ID_Photo/5. 服装_老年/13.女-深灰色中式唐装长袖上衣,采用经典立领、对襟版型,搭配同色系一字盘扣,尽显传统韵味。衣身饰有同色系祥龙压纹 刺绣图案,线条大气流畅,面料哑光舒适,整体沉稳雅致.jpg","mode":"100644","type":"blob","sha":"8e734c533d85b22966307d88c88e394f2eb6f9d5","size":72279,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8e734c533d85b22966307d88c88e394f2eb6f9d5"},{"path":"image/ID_Photo/5. 服装_老年/14.男-内搭薄荷绿翻领衬衫,黑色纽扣点缀,版型清爽利落;外搭酒红色 V 领针织开衫,衣身饰有红黑相间的民族风几何提花,复古保暖。整体为舒适沉稳的中老年休闲穿搭。.jpg","mode":"100644","type":"blob","sha":"bd9aad69feabe6938bca0aa4de4b9e9c48b3efe1","size":75013,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/bd9aad69feabe6938bca0aa4de4b9e9c48b3efe1"},{"path":"image/ID_Photo/5. 服装_老年/15.男-深灰肌理西装三件套,搭配白衬衫与香槟金几何纹领带,平驳领版型利落,老年证件照装.jpg","mode":"100644","type":"blob","sha":"1ef6d72ac9948e825e170b3e8314ae70f37b6c47","size":70777,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1ef6d72ac9948e825e170b3e8314ae70f37b6c47"},{"path":"image/ID_Photo/5. 服装_老年/16.男-深灰色 V 领针织衫,内搭白蓝竖条纹衬衫,简约老年证件照服装.jpg","mode":"100644","type":"blob","sha":"58693f0acace4028bb7b95eaffe309c1e00d006e","size":70855,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/58693f0acace4028bb7b95eaffe309c1e00d006e"},{"path":"image/ID_Photo/5. 服装_老年/17.男-浅灰色中式唐装,立领对襟设计,搭配同色系一字盘扣,衣身饰回纹、福字等传统暗纹,面料素雅,风格端庄沉稳,尽显中式儒雅韵味,适配中老年形象.jpg","mode":"100644","type":"blob","sha":"37ee788fc828f3d5e60b29367cd9866578f6fb4d","size":71377,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/37ee788fc828f3d5e60b29367cd9866578f6fb4d"},{"path":"image/ID_Photo/5. 服装_老年/18.男-酒红色缎面中式唐装,采用立领、一字盘扣设计,衣身饰有精致龙纹刺绣,缎面自带光泽感,老年证件照服装.jpg","mode":"100644","type":"blob","sha":"3f8f48a593a74c920c63fd26d67b7a6f07c63f34","size":74220,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/3f8f48a593a74c920c63fd26d67b7a6f07c63f34"},{"path":"image/ID_Photo/5. 服装_老年/19.男-黑色中式唐装长袖上衣,采用经典立领、对襟版型,同色系一字盘扣,尽显传统韵味。衣身饰有同色系祥龙压纹 刺绣图案,线条大气流畅,面料哑光舒适,整体沉稳雅致.jpg","mode":"100644","type":"blob","sha":"2d7edefdd4de1bda68bfb308d86464401365049d","size":71134,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/2d7edefdd4de1bda68bfb308d86464401365049d"},{"path":"image/ID_Photo/5. 服装_老年/20.男-黑色立领中山装式上衣,门襟饰金属包边纽扣,内搭白衬衫,剪裁利落挺括,是兼具复古感与正式感的新中式正装风.jpg","mode":"100644","type":"blob","sha":"bcd95e4c1eb63fe48afa5c7c80c57419d7122125","size":70780,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/bcd95e4c1eb63fe48afa5c7c80c57419d7122125"},{"path":"image/ID_Photo/5. 服装_老年/21.男-外层是黑色立领拉链夹克,版型简约利落,内层为绿色绞花针织毛衣,带黑色横条纹装饰。整体风格沉稳实用,中老年男士日常休闲穿搭.jpg","mode":"100644","type":"blob","sha":"1003323d470af9df705b69a06c36b3a82f359afe","size":72933,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1003323d470af9df705b69a06c36b3a82f359afe"},{"path":"image/ID_Photo/5. 服装_老年/22.男-藏蓝色毛呢中山装,翻领单排扣,对称带盖口袋,版型利落,复古沉稳.jpg","mode":"100644","type":"blob","sha":"dc4f902a2cd30c0c9e5ea40cbcfd00e2fccca0c8","size":73778,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/dc4f902a2cd30c0c9e5ea40cbcfd00e2fccca0c8"},{"path":"image/ID_Photo/5. 服装_老年/23.男-黑色棒球领夹克,带低调暗格纹,拉链款设计利落大方;内搭藏蓝格纹衬衫,整体为成熟稳重的中老年商务休闲风.jpg","mode":"100644","type":"blob","sha":"2bcaa27daf8877473b4568b90080ccda63b3e694","size":74123,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/2bcaa27daf8877473b4568b90080ccda63b3e694"},{"path":"image/ID_Photo/5. 服装_老年/24.男-深蓝灰色翻领针织 Polo 衫,带棕黄与黑色横条纹,门襟纽扣设计,左胸有品牌标识,中老年证件照服装。.jpg","mode":"100644","type":"blob","sha":"ccae546fecbf3aef1e42a46a11314f0ec78d8f8b","size":78212,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ccae546fecbf3aef1e42a46a11314f0ec78d8f8b"},{"path":"image/ID_Photo/6. 发型_女士","mode":"040000","type":"tree","sha":"b4842114b0b3d76c9a2e7025384f28fcdc20586f","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/b4842114b0b3d76c9a2e7025384f28fcdc20586f"},{"path":"image/ID_Photo/6. 发型_女士/01-蓬松有层次的发型.jpg","mode":"100644","type":"blob","sha":"78f45e33cead95eb1e1927409cb2b5d5320266dd","size":15651,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/78f45e33cead95eb1e1927409cb2b5d5320266dd"},{"path":"image/ID_Photo/6. 发型_女士/02-黑色侧编麻花辫,带轻薄空气刘海,碎发修饰脸颊,头发整齐垂于一侧,干净清爽.jpg","mode":"100644","type":"blob","sha":"7e57b4d658f869976ed6a86516c2e54164565f55","size":30404,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/7e57b4d658f869976ed6a86516c2e54164565f55"},{"path":"image/ID_Photo/6. 发型_女士/03-黑色高盘发,带轻薄空气刘海,鬓角留少量碎发修饰脸型,头发全部束起,露出完整额头与耳朵,干净利落.jpg","mode":"100644","type":"blob","sha":"3a14c22bfed443671fbf7a48d11b6d81d072efb8","size":28522,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/3a14c22bfed443671fbf7a48d11b6d81d072efb8"},{"path":"image/ID_Photo/6. 发型_女士/04-黑色中分长直发,两侧各饰一个黑色缎面蝴蝶结,鬓角留少量碎发修饰脸型,头发自然垂落于肩后.jpg","mode":"100644","type":"blob","sha":"28cb40ad2104ac05e618d344a21de09fb56e1427","size":29564,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/28cb40ad2104ac05e618d344a21de09fb56e1427"},{"path":"image/ID_Photo/6. 发型_女士/05-黑色中分长直发,两侧各系黑色缎面蝴蝶结,左侧额前留一缕碎发修饰,头发尾部前后错落:左侧头发在胸前、右侧头发隐藏在肩膀后,露出完整眉眼与耳朵,适配证件照.jpg","mode":"100644","type":"blob","sha":"ef6a776cc950883b6333b7251b05a3fdcf577a35","size":30139,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ef6a776cc950883b6333b7251b05a3fdcf577a35"},{"path":"image/ID_Photo/6. 发型_女士/06-深棕色中长发,带轻薄均匀空气刘海,发丝柔顺有光泽,左右都自然垂落于肩前,发尾微内扣,修饰脸型,露出完整耳朵,整体干净清爽,适配证件照.jpg","mode":"100644","type":"blob","sha":"42effb5489016cde440b8a813722bf4dd295269c","size":32024,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/42effb5489016cde440b8a813722bf4dd295269c"},{"path":"image/ID_Photo/6. 发型_女士/07-深棕色偏分大波浪长卷发,发丝蓬松有光泽,一侧卷发自然垂于胸前,另一侧置于身后,露出完整眉眼与耳朵,气质干练温柔,适配证件照.jpg","mode":"100644","type":"blob","sha":"a038d901f8732a4c97a72148544725c06a0d2d1d","size":31904,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a038d901f8732a4c97a72148544725c06a0d2d1d"},{"path":"image/ID_Photo/6. 发型_女士/08-深棕色高马尾丸子头,发尾碎发自然飘向一侧,额前无刘海,鬓角留少量碎发修饰脸型,头发整体束起,露出完整眉眼与耳朵.jpg","mode":"100644","type":"blob","sha":"14dc1a610b80e8e7b16a16883e22a4601074a5f6","size":28398,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/14dc1a610b80e8e7b16a16883e22a4601074a5f6"},{"path":"image/ID_Photo/6. 发型_女士/09-深棕色长发,搭配轻薄空气齐刘海,发尾自然垂落于肩后,整体清爽利落,露出完整眉眼与耳朵.jpg","mode":"100644","type":"blob","sha":"9f2d7edcddf42820cb9e2e12695b4e6a17702d37","size":30353,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9f2d7edcddf42820cb9e2e12695b4e6a17702d37"},{"path":"image/ID_Photo/6. 发型_女士/10-经典中分黑长直发,发丝柔顺服帖,自然垂落在肩后,无刘海遮挡,露出完整的额头、眉眼与耳朵,整体干净清爽,适配证件照造型.jpg","mode":"100644","type":"blob","sha":"508b60aa71940a7b1f60bd5a7f65ff4ce3bb2888","size":28693,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/508b60aa71940a7b1f60bd5a7f65ff4ce3bb2888"},{"path":"image/ID_Photo/6. 发型_女士/11-黑色高盘发,发丝服帖整齐,全部梳起挽成利落发髻,无刘海遮挡,露出完整的额头、眉眼与耳朵,仅鬓角留少量碎发修饰脸型,整体干净干练,适配空乘证件照造型.jpg","mode":"100644","type":"blob","sha":"43fe111be3b2043055048044e41522e422e6b176","size":26140,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/43fe111be3b2043055048044e41522e422e6b176"},{"path":"image/ID_Photo/6. 发型_女士/12-蓬松的乌黑中分大波浪长卷发垂落于胸前,超多发量,一侧头发挡住耳朵从眼角落下,整体时尚大气.jpg","mode":"100644","type":"blob","sha":"74f9a55643923a6d6ab385591e685508e12654e2","size":30264,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/74f9a55643923a6d6ab385591e685508e12654e2"},{"path":"image/ID_Photo/6. 发型_女士/13-四六分高盘发,挽成利落发髻,无刘海遮挡,仅一缕刘海从太阳穴自然落下修饰脸型,鬓角和发髻处留少量碎发修饰脸型,整体干净干练.jpg","mode":"100644","type":"blob","sha":"9a92408982beb2fe182c73dab9c3cffebb1ec669","size":26137,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9a92408982beb2fe182c73dab9c3cffebb1ec669"},{"path":"image/ID_Photo/6. 发型_女士/14-四六分低盘发,挽成利落发髻,无刘海遮挡,仅一缕刘海从太阳穴自然落下修饰脸型,鬓角和发髻处留少量碎发修饰脸型,整体干净干练.jpg","mode":"100644","type":"blob","sha":"80365a611ebd2a4724c09fb436fa3271b45f9b50","size":28638,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/80365a611ebd2a4724c09fb436fa3271b45f9b50"},{"path":"image/ID_Photo/6. 发型_女士/15-乌黑侧编麻花辫,搭配白色宽发箍固定发型,发丝柔顺服帖,发辫自然垂落于肩前,无刘海遮挡,鬓角留少量碎发修饰脸型,整体清新温婉.jpg","mode":"100644","type":"blob","sha":"d1207030f74127ce65bfaef53a27458c05e413d6","size":29889,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d1207030f74127ce65bfaef53a27458c05e413d6"},{"path":"image/ID_Photo/6. 发型_女士/16-深棕色双麻花辫,搭配空气齐刘海,两条麻花辫自然垂落于胸前,发尾用白色纱质绑带固定,整体元气清爽.jpg","mode":"100644","type":"blob","sha":"5c91da096dff9cb8cd10c7c519e4911798f0c1bb","size":29855,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5c91da096dff9cb8cd10c7c519e4911798f0c1bb"},{"path":"image/ID_Photo/6. 发型_女士/17-乌黑及肩中长发,一半空气刘海、一半露出额头,发丝柔顺带自然微卷,自然垂落于肩前肩后,头发外轮廓随意,整体清新温柔.jpg","mode":"100644","type":"blob","sha":"601e07588648cbe7b08570a92b1416a7b41baab0","size":30824,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/601e07588648cbe7b08570a92b1416a7b41baab0"},{"path":"image/ID_Photo/6. 发型_女士/18-乌黑偏分齐耳波波头短发,少量碎发随性散落不刻板,整体清爽干练.jpg","mode":"100644","type":"blob","sha":"ad9d6f396cc30882496424aa76708f58efd6d2da","size":29260,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ad9d6f396cc30882496424aa76708f58efd6d2da"},{"path":"image/ID_Photo/6. 发型_女士/19-深棕色侧高马尾中长发,高束于头顶,发尾自然垂落于一侧肩膀,仅鬓角留少量碎发修饰脸型,整体清爽利落.jpg","mode":"100644","type":"blob","sha":"34dea81e8f2af7c3ec4ab8a073b7d90daf4ca574","size":29407,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/34dea81e8f2af7c3ec4ab8a073b7d90daf4ca574"},{"path":"image/ID_Photo/6. 发型_女士/20-棕褐色半扎长卷发,两侧发丝自然挂向耳后,搭配轻薄侧分刘海修饰脸型,发尾呈柔和波浪状垂落于肩前,整体温柔元气.jpg","mode":"100644","type":"blob","sha":"e7c84046bdbb6d9788e38efe3b5f10d02035f032","size":31588,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e7c84046bdbb6d9788e38efe3b5f10d02035f032"},{"path":"image/ID_Photo/6. 发型_女士/21-乌黑中分半扎长直发,头顶两侧编有对称的多股细发辫,打造出蓬松精致的棱角感,剩下少量头发自然垂落于肩前,整体清爽灵动,充满少女感.jpg","mode":"100644","type":"blob","sha":"e8d935bd0f727b6820071c1d689b46c6f1465d12","size":30336,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e8d935bd0f727b6820071c1d689b46c6f1465d12"},{"path":"image/ID_Photo/6. 发型_女士/22-乌黑高颅顶半扎发,头顶发丝蓬松有型,带有精致的纹理棱角感,修饰脸型的同时拉高颅顶,半扎的发丝柔顺垂落在肩后,仅鬓角留少量碎发点缀,整体清爽利落又显元气.jpg","mode":"100644","type":"blob","sha":"6078adb8414f047d5ef7ae422ce88daba801862e","size":29560,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/6078adb8414f047d5ef7ae422ce88daba801862e"},{"path":"image/ID_Photo/6. 发型_女士/23-奶奶灰(冷调灰棕)扎发,所有头发被盘起,搭配齐刘海,头顶两侧编有多股细碎小辫被整齐挽起,打造出饱满精致的颅顶轮廓,鬓角留少量碎发修饰脸型,整体温婉清新.jpg","mode":"100644","type":"blob","sha":"4363e7df1d8e3ceb048c9ad96c20c34d65e7d88c","size":27624,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4363e7df1d8e3ceb048c9ad96c20c34d65e7d88c"},{"path":"image/ID_Photo/6. 发型_女士/24-深棕色齐耳波波头发型,透气的空气刘海,发尾蓬松,露出完整眉眼与耳朵,整体清爽干练.jpg","mode":"100644","type":"blob","sha":"dbb521b455d124d1ee3a6988a4a2db57e390f1d8","size":30457,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/dbb521b455d124d1ee3a6988a4a2db57e390f1d8"},{"path":"image/ID_Photo/6. 发型_女士/25-黑色长发,搭配厚重齐刘海,刘海全部遮住额头,发尾自然垂落于肩后,整体清爽利落.jpg","mode":"100644","type":"blob","sha":"8a598a5fa976970e5dcb117e6b86b3d56f8550d3","size":29193,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8a598a5fa976970e5dcb117e6b86b3d56f8550d3"},{"path":"image/ID_Photo/6. 发型_女士/26-棕栗色偏分大波浪长卷发,头顶搭配白色蝴蝶结发饰,发丝呈柔和波浪状垂落于肩前,一侧头发挡住耳朵和太阳穴,搭配心形珍珠耳环,整体温柔甜美.jpg","mode":"100644","type":"blob","sha":"4fea3ad76bc159b206820029f9e900db50c3f654","size":32383,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4fea3ad76bc159b206820029f9e900db50c3f654"},{"path":"image/ID_Photo/6. 发型_女士/27-黑色中分盘发,发丝梳拢后盘起,无刘海遮挡,露出完整的额头、眉眼与耳朵,整体干练利落,是空乘员的经典造型.jpg","mode":"100644","type":"blob","sha":"5bff6feed14f932a8a965e7e91224c18bbe3dba8","size":27094,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5bff6feed14f932a8a965e7e91224c18bbe3dba8"},{"path":"image/ID_Photo/6. 发型_女士/28-双马尾中长发,中分,刘海被编成细碎小辫装饰向后扎起,两边棱角显得头顶格外蓬松,马尾用黑色皮筋扎于耳后,发尾自然发散开垂落于胸前,露出完整眉眼与耳朵,整体清爽元气.jpg","mode":"100644","type":"blob","sha":"febaac11b974c98a4b6de206d508a1b2f76cedf7","size":32026,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/febaac11b974c98a4b6de206d508a1b2f76cedf7"},{"path":"image/ID_Photo/7. 发型_男士","mode":"040000","type":"tree","sha":"17b8e12332ec3b1a355eb71ba245f16c537b5dad","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/17b8e12332ec3b1a355eb71ba245f16c537b5dad"},{"path":"image/ID_Photo/7. 发型_男士/01-蓬松有层次的发型.jpg","mode":"100644","type":"blob","sha":"78f45e33cead95eb1e1927409cb2b5d5320266dd","size":15651,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/78f45e33cead95eb1e1927409cb2b5d5320266dd"},{"path":"image/ID_Photo/7. 发型_男士/02-发型更换成军人寸头短发,发丝利落有型,无分缝,两侧修剪干净,顶部发丝整齐直立,整体干练精神.jpg","mode":"100644","type":"blob","sha":"5c76e803dab6f7e572a68e676e4aa8f7a4460edc","size":27127,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5c76e803dab6f7e572a68e676e4aa8f7a4460edc"},{"path":"image/ID_Photo/7. 发型_男士/03-发型更改成:碎盖短发,顶部蓬松层次碎发,刘海四六分,少量碎刘海自然遮额,两侧推剪干净服帖,轮廓立体利落,少年感干练造型,颅顶饱满,发丝纹理自然柔和.jpg","mode":"100644","type":"blob","sha":"50ed64d94720bc12b421fa5c4dfaa2b9f58f15c0","size":27467,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/50ed64d94720bc12b421fa5c4dfaa2b9f58f15c0"},{"path":"image/ID_Photo/7. 发型_男士/04-发型更改成:韩式齐刘海碎盖短发,颅顶蓬松无分缝。.jpg","mode":"100644","type":"blob","sha":"d51b4b0c57a80b69cdf2e93c4c902b6f60b80651","size":27765,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d51b4b0c57a80b69cdf2e93c4c902b6f60b80651"},{"path":"nodes","mode":"040000","type":"tree","sha":"a1fb2921f9881bc72a1788caaddd9c71b14e5614","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/a1fb2921f9881bc72a1788caaddd9c71b14e5614"},{"path":"nodes/ID证生成器.py","mode":"100644","type":"blob","sha":"bab4b75efcc1ca20072ddf16dde7ffcd42226037","size":15691,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/bab4b75efcc1ca20072ddf16dde7ffcd42226037"},{"path":"nodes/Kontext Lora切换.py","mode":"100644","type":"blob","sha":"c39a6083fc55a6a66cb677499ead3f15a897a390","size":12573,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/c39a6083fc55a6a66cb677499ead3f15a897a390"},{"path":"nodes/Kontext生图比例 纯列表.py","mode":"100644","type":"blob","sha":"9867daae6e290fb562a9d4f62dd42fc1c8a349d6","size":1498,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9867daae6e290fb562a9d4f62dd42fc1c8a349d6"},{"path":"nodes/Seg次序过滤.py","mode":"100644","type":"blob","sha":"74cdc8ff44ae7009a05dca261329d16a855f9a7f","size":15100,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/74cdc8ff44ae7009a05dca261329d16a855f9a7f"},{"path":"nodes/kontext生图比例.py","mode":"100644","type":"blob","sha":"ff59e6e7418163501c1ab3083516c72f15ba7b6a","size":2557,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ff59e6e7418163501c1ab3083516c72f15ba7b6a"},{"path":"nodes/万能滑条.py","mode":"100644","type":"blob","sha":"520996488ad1fb3ece9d0a0ee8954812428ba048","size":1556,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/520996488ad1fb3ece9d0a0ee8954812428ba048"},{"path":"nodes/主色提取.py","mode":"100644","type":"blob","sha":"068ff79cb3ae509a33b1db7ff637fb1c64150079","size":3280,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/068ff79cb3ae509a33b1db7ff637fb1c64150079"},{"path":"nodes/人脸自动矫正.py","mode":"100644","type":"blob","sha":"d086f6f6105e1c5d2338780d9d9d8b8a7e2d230e","size":5885,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d086f6f6105e1c5d2338780d9d9d8b8a7e2d230e"},{"path":"nodes/保存图像JPG.py","mode":"100644","type":"blob","sha":"befedda9bf674d1b2e088f9e7cf5c52b8f68e632","size":14203,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/befedda9bf674d1b2e088f9e7cf5c52b8f68e632"},{"path":"nodes/保留遮罩区域移除图像背景.py","mode":"100644","type":"blob","sha":"377ffcd9b8f5d5f60e288fd089ee16b506bbfadd","size":15664,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/377ffcd9b8f5d5f60e288fd089ee16b506bbfadd"},{"path":"nodes/加载图像.py","mode":"100644","type":"blob","sha":"045af0f86d8ce5983933b5da7e724565b5f8902f","size":9289,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/045af0f86d8ce5983933b5da7e724565b5f8902f"},{"path":"nodes/加载批次图像.py","mode":"100644","type":"blob","sha":"105d06c3e0c25fa71c2b1722a9dc924fb3070688","size":7404,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/105d06c3e0c25fa71c2b1722a9dc924fb3070688"},{"path":"nodes/单尺寸排版.py","mode":"100644","type":"blob","sha":"927116e8143518ce8b9bcc69563d6e1ea9e89c35","size":10701,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/927116e8143518ce8b9bcc69563d6e1ea9e89c35"},{"path":"nodes/图像与遮罩描边.py","mode":"100644","type":"blob","sha":"4466c1c79ce57622a671096a8c56d4dcfefbac90","size":19201,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/4466c1c79ce57622a671096a8c56d4dcfefbac90"},{"path":"nodes/图像与遮罩预览.py","mode":"100644","type":"blob","sha":"202feb51bde08ca48c7aa16c80dc2a29f9f25678","size":11422,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/202feb51bde08ca48c7aa16c80dc2a29f9f25678"},{"path":"nodes/图像亮度比较.py","mode":"100644","type":"blob","sha":"ba55468104d0bc3856738bfbe4e713d1c007489c","size":2259,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ba55468104d0bc3856738bfbe4e713d1c007489c"},{"path":"nodes/图像保存(高级).py","mode":"100644","type":"blob","sha":"eb1b2964add987472151abf2c38213b7b1b6e739","size":5506,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/eb1b2964add987472151abf2c38213b7b1b6e739"},{"path":"nodes/图像合并(遮罩).py","mode":"100644","type":"blob","sha":"21322f38039a6d1880fb6c837a9c74af2dd8f5fa","size":7111,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/21322f38039a6d1880fb6c837a9c74af2dd8f5fa"},{"path":"nodes/图像嵌入.py","mode":"100644","type":"blob","sha":"87793bdb9f7570405e21fcfe2458a93ba2ca7783","size":17497,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/87793bdb9f7570405e21fcfe2458a93ba2ca7783"},{"path":"nodes/图像差异到遮罩.py","mode":"100644","type":"blob","sha":"46474d3b2ff8ad141dd55028a0332a1fc6c39084","size":3595,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/46474d3b2ff8ad141dd55028a0332a1fc6c39084"},{"path":"nodes/图像旋转.py","mode":"100644","type":"blob","sha":"1ad52f54a22b84e28216b264321604b151591f5b","size":1368,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1ad52f54a22b84e28216b264321604b151591f5b"},{"path":"nodes/图像添加水印.py","mode":"100644","type":"blob","sha":"e6e338f6d4b414f77ee4d2ed2e201a3ab39dd362","size":11087,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/e6e338f6d4b414f77ee4d2ed2e201a3ab39dd362"},{"path":"nodes/图像组合批次.py","mode":"100644","type":"blob","sha":"8102bcd9f1a0abedc787d22df3668ba90099bdcc","size":4587,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8102bcd9f1a0abedc787d22df3668ba90099bdcc"},{"path":"nodes/图像缩放V2.py","mode":"100644","type":"blob","sha":"d50156fd7b37c159acb80e1ad5e67f050d36d603","size":31534,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d50156fd7b37c159acb80e1ad5e67f050d36d603"},{"path":"nodes/图像缩放按像素.py","mode":"100644","type":"blob","sha":"ea52a74d6ec122eae9b0880a39142bb312f8e0de","size":12523,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ea52a74d6ec122eae9b0880a39142bb312f8e0de"},{"path":"nodes/图像缩放(范围).py","mode":"100644","type":"blob","sha":"08c976f6d405940e31b6de6ad7ae94bab36464a8","size":14504,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/08c976f6d405940e31b6de6ad7ae94bab36464a8"},{"path":"nodes/图像裁剪按比例.py","mode":"100644","type":"blob","sha":"7ae26e8b95af38024fbc75e8811784b2b8addb48","size":6516,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/7ae26e8b95af38024fbc75e8811784b2b8addb48"},{"path":"nodes/图像裁剪(主体保护).py","mode":"100644","type":"blob","sha":"018d34cfdb88cf5b568cadb867914142ea8b70af","size":28145,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/018d34cfdb88cf5b568cadb867914142ea8b70af"},{"path":"nodes/外补画板(3合一).py","mode":"100644","type":"blob","sha":"387cb2102308f7d12a46aa3eee6f6e8a02a4a256","size":31776,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/387cb2102308f7d12a46aa3eee6f6e8a02a4a256"},{"path":"nodes/多尺寸混合排版.py","mode":"100644","type":"blob","sha":"3d9bdfbd7dbce65258c683ae714ce11d1db49da6","size":17182,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/3d9bdfbd7dbce65258c683ae714ce11d1db49da6"},{"path":"nodes/头顶遮罩.py","mode":"100644","type":"blob","sha":"108442bc9c9b307fa85da6d2e4248e2dc6d8cdc7","size":1671,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/108442bc9c9b307fa85da6d2e4248e2dc6d8cdc7"},{"path":"nodes/字符串按类型分隔.py","mode":"100644","type":"blob","sha":"1f27ed8c279205b75ea6816cdcab7d19a50c6507","size":3583,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1f27ed8c279205b75ea6816cdcab7d19a50c6507"},{"path":"nodes/布尔开关.py","mode":"100644","type":"blob","sha":"880630ed42b9e973e2a275667b87bcd979589a68","size":561,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/880630ed42b9e973e2a275667b87bcd979589a68"},{"path":"nodes/忽略多组.py","mode":"100644","type":"blob","sha":"fc1992c878179f88b3a0d776f0293cd79108eee5","size":499,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/fc1992c878179f88b3a0d776f0293cd79108eee5"},{"path":"nodes/批处理开关.py","mode":"100644","type":"blob","sha":"ac5f62439442a4a735335dfa994aea1dd9522a81","size":1398,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ac5f62439442a4a735335dfa994aea1dd9522a81"},{"path":"nodes/批处理进度条.py","mode":"100644","type":"blob","sha":"3c7020db4f68c732173a6a4f0d5414ed4b1b21df","size":3757,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/3c7020db4f68c732173a6a4f0d5414ed4b1b21df"},{"path":"nodes/批量自动排版.py","mode":"100644","type":"blob","sha":"88e1cbbee7d0612082d10a54d371b2b82eff53d3","size":27350,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/88e1cbbee7d0612082d10a54d371b2b82eff53d3"},{"path":"nodes/效果选择.py","mode":"100644","type":"blob","sha":"27f19c58211d1e22230408d7f97e0c4a63152e06","size":3818,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/27f19c58211d1e22230408d7f97e0c4a63152e06"},{"path":"nodes/数学运算.py","mode":"100644","type":"blob","sha":"47247bd59370a09dbc86dbfba2bd16a112604ecf","size":8074,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/47247bd59370a09dbc86dbfba2bd16a112604ecf"},{"path":"nodes/文件夹图片统计.py","mode":"100644","type":"blob","sha":"1788c5bc1d7d5bf59581e7cdfcb23b596218f91e","size":1855,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1788c5bc1d7d5bf59581e7cdfcb23b596218f91e"},{"path":"nodes/文件夹数量统计.py","mode":"100644","type":"blob","sha":"b2dd96304d61dd2312c6160c4b162c08a7c7589d","size":1415,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/b2dd96304d61dd2312c6160c4b162c08a7c7589d"},{"path":"nodes/文件夹索引.py","mode":"100644","type":"blob","sha":"0b8e108e2ef892c1a8c9f1b21445db28f457b3e0","size":2674,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0b8e108e2ef892c1a8c9f1b21445db28f457b3e0"},{"path":"nodes/根据文件名识别尺寸.py","mode":"100644","type":"blob","sha":"9708495fb21a520e95a353eff8efee86d22234f0","size":4119,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9708495fb21a520e95a353eff8efee86d22234f0"},{"path":"nodes/浮点滑条.py","mode":"100644","type":"blob","sha":"a4f78138756f1ad91afcfcd8eb9a99ea8fe21f1d","size":1690,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/a4f78138756f1ad91afcfcd8eb9a99ea8fe21f1d"},{"path":"nodes/移除纯色背景.py","mode":"100644","type":"blob","sha":"04d33428e1d78020cdfb4288f857f1b53a712dd6","size":4681,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/04d33428e1d78020cdfb4288f857f1b53a712dd6"},{"path":"nodes/肤色差值.py","mode":"100644","type":"blob","sha":"1dd3a984b38052e90f1390b5a5ac634d11cd936b","size":4822,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1dd3a984b38052e90f1390b5a5ac634d11cd936b"},{"path":"nodes/自动分割图像.py","mode":"100644","type":"blob","sha":"143ad84a7b6a97d4615e2998229215e36713508d","size":5741,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/143ad84a7b6a97d4615e2998229215e36713508d"},{"path":"nodes/自动切换正反斜杠.py","mode":"100644","type":"blob","sha":"487e10d2c8b636e693e9926562799ad6cbca86d6","size":1627,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/487e10d2c8b636e693e9926562799ad6cbca86d6"},{"path":"nodes/自动新建文件夹.py","mode":"100644","type":"blob","sha":"2cc02967e0a64bcce0023d360b878bd0e6dd897a","size":2365,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/2cc02967e0a64bcce0023d360b878bd0e6dd897a"},{"path":"nodes/证件照服装发型.py","mode":"100644","type":"blob","sha":"38d48d6065c49b237fd7e02e40ed60aa97d85c61","size":3740,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/38d48d6065c49b237fd7e02e40ed60aa97d85c61"},{"path":"nodes/证件照简易提示词.py","mode":"100644","type":"blob","sha":"f52634779fa34401320c17c44cf3ecc96c450659","size":6352,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f52634779fa34401320c17c44cf3ecc96c450659"},{"path":"nodes/证件照裁剪.py","mode":"100644","type":"blob","sha":"f95b92900b8913e77fabf695df9cd0aca45ca091","size":29939,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f95b92900b8913e77fabf695df9cd0aca45ca091"},{"path":"nodes/身份证自动扶正拼版.py","mode":"100644","type":"blob","sha":"875c7078c110bc51205e7de6dd489eed54e914b7","size":16708,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/875c7078c110bc51205e7de6dd489eed54e914b7"},{"path":"nodes/遮罩中心对齐.py","mode":"100644","type":"blob","sha":"5d2cb36a2d4023eea70bd250ea45f211c71efffb","size":2904,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/5d2cb36a2d4023eea70bd250ea45f211c71efffb"},{"path":"nodes/遮罩分析.py","mode":"100644","type":"blob","sha":"6c10ab9e3b2e9cae6e078f7236ca68278889b2bf","size":5898,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/6c10ab9e3b2e9cae6e078f7236ca68278889b2bf"},{"path":"nodes/遮罩圆角消除.py","mode":"100644","type":"blob","sha":"6c512343ed4592aca3afe399745f8e91a2009082","size":6424,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/6c512343ed4592aca3afe399745f8e91a2009082"},{"path":"nodes/遮罩对齐V2.py","mode":"100644","type":"blob","sha":"9432de5054e3f8beb0effc5233ad319015140caf","size":6114,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9432de5054e3f8beb0effc5233ad319015140caf"},{"path":"nodes/遮罩检测.py","mode":"100644","type":"blob","sha":"138ef28d63192b542e928bb300d8911269716f07","size":1675,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/138ef28d63192b542e928bb300d8911269716f07"},{"path":"nodes/遮罩模糊生长按比例.py","mode":"100644","type":"blob","sha":"bcb47ed5e2bfd63261b4f4b25464c5708d9ed247","size":2897,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/bcb47ed5e2bfd63261b4f4b25464c5708d9ed247"},{"path":"nodes/遮罩比例计算.py","mode":"100644","type":"blob","sha":"8398810cb689b04e81d72f6f8d063f84580af88c","size":1568,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/8398810cb689b04e81d72f6f8d063f84580af88c"},{"path":"nodes/遮罩混合运算.py","mode":"100644","type":"blob","sha":"d84245d57b625564710902874d4ed5b8c763c815","size":8845,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d84245d57b625564710902874d4ed5b8c763c815"},{"path":"nodes/遮罩裁剪.py","mode":"100644","type":"blob","sha":"0f63b7b56cfe544a2809f6c7604d9e4973754118","size":3565,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0f63b7b56cfe544a2809f6c7604d9e4973754118"},{"path":"nodes/遮罩裁剪V2.py","mode":"100644","type":"blob","sha":"27541c4ef51842995810a6f091e68e5636b24595","size":34863,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/27541c4ef51842995810a6f091e68e5636b24595"},{"path":"nodes/面部对齐.py","mode":"100644","type":"blob","sha":"594abb28e9ecf0dc08f706c910543382b3dca7a0","size":26812,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/594abb28e9ecf0dc08f706c910543382b3dca7a0"},{"path":"nodes/预设尺寸.py","mode":"100644","type":"blob","sha":"6cde3d1d125bc80b951db0dc903b490862f3855b","size":2890,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/6cde3d1d125bc80b951db0dc903b490862f3855b"},{"path":"nodes/颜色处理.py","mode":"100644","type":"blob","sha":"1285830d415c0a05a872f59f90d27a250fba39df","size":12159,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/1285830d415c0a05a872f59f90d27a250fba39df"},{"path":"requirements.txt","mode":"100644","type":"blob","sha":"ba5c4f712e114dac9cffb147ae8172619a739ae1","size":125,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/ba5c4f712e114dac9cffb147ae8172619a739ae1"},{"path":"shape_predictor_5_face_landmarks.dat","mode":"100644","type":"blob","sha":"67878ed3894d929c5e03bd1ad2d931cc6d745ee7","size":9150489,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/67878ed3894d929c5e03bd1ad2d931cc6d745ee7"},{"path":"web","mode":"040000","type":"tree","sha":"76664c24b61873131c7f23700b956f152494c45b","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/76664c24b61873131c7f23700b956f152494c45b"},{"path":"web/js","mode":"040000","type":"tree","sha":"0e0b9ce84538b43f94d66e73a6ce0edd7b4fa773","url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/0e0b9ce84538b43f94d66e73a6ce0edd7b4fa773"},{"path":"web/js/BOOLEAN.js","mode":"100644","type":"blob","sha":"9a76d4e8a77edf07e474483a0a9813a758e72d7f","size":7965,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/9a76d4e8a77edf07e474483a0a9813a758e72d7f"},{"path":"web/js/GoohaiNote.js","mode":"100644","type":"blob","sha":"d1cf7a89baf92fc4af803008f7e9d825da70dd71","size":36952,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/d1cf7a89baf92fc4af803008f7e9d825da70dd71"},{"path":"web/js/colorWidget.js","mode":"100644","type":"blob","sha":"f1f223861ce9141a3b02f43f14fee84331ca7caf","size":4049,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/f1f223861ce9141a3b02f43f14fee84331ca7caf"},{"path":"web/js/goohai_universal_slider.js","mode":"100644","type":"blob","sha":"315a5b1bdc45ab1b1af4bdde22c43cb474a77e7d","size":23801,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/315a5b1bdc45ab1b1af4bdde22c43cb474a77e7d"},{"path":"web/js/id_photo_clothing.js","mode":"100644","type":"blob","sha":"3863b49efed37ec175c3fb46046235089fbbdc2b","size":31244,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/3863b49efed37ec175c3fb46046235089fbbdc2b"},{"path":"web/js/nodes pass.js","mode":"100644","type":"blob","sha":"0fa99eba33750a9d124899f976be3ba72c50cf3c","size":32682,"url":"https://api.github.com/repos/goohai/Goohaitools-comfyui/git/blobs/0fa99eba33750a9d124899f976be3ba72c50cf3c"}],"truncated":false} \ No newline at end of file diff --git a/docs/hel-892/crop-split-reference/guhai__README.md b/docs/hel-892/crop-split-reference/guhai__README.md new file mode 100644 index 00000000..594ccd15 --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__README.md @@ -0,0 +1 @@ +git clone https://github.com/goohai/Goohaitools-comfyui.git diff --git a/docs/hel-892/crop-split-reference/guhai____init__.py b/docs/hel-892/crop-split-reference/guhai____init__.py new file mode 100644 index 00000000..d335c5f4 --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai____init__.py @@ -0,0 +1,49 @@ +import os +import importlib.util +import sys +from pathlib import Path + +# 获取当前包目录的路径 +current_dir = Path(__file__).parent +nodes_dir = current_dir / "nodes" + +# 设置WEB目录路径 - 这是关键配置 +WEB_DIRECTORY = "./web" + +# 初始化全局映射字典 +NODE_CLASS_MAPPINGS = {} +NODE_DISPLAY_NAME_MAPPINGS = {} + +# 遍历nodes目录中的所有Python文件 +for file_path in nodes_dir.glob("*.py"): + # 跳过__init__.py文件 + if file_path.name == "__init__.py": + continue + + # 提取模块名(不含.py后缀) + module_name = file_path.stem + + # 使用importlib动态加载模块 + spec = importlib.util.spec_from_file_location(f"goohaitools.nodes.{module_name}", file_path) + module = importlib.util.module_from_spec(spec) + + try: + # 执行模块代码 + spec.loader.exec_module(module) + + # 检查并合并NODE_CLASS_MAPPINGS + if hasattr(module, 'NODE_CLASS_MAPPINGS'): + NODE_CLASS_MAPPINGS.update(module.NODE_CLASS_MAPPINGS) + + # 检查并合并NODE_DISPLAY_NAME_MAPPINGS + if hasattr(module, 'NODE_DISPLAY_NAME_MAPPINGS'): + NODE_DISPLAY_NAME_MAPPINGS.update(module.NODE_DISPLAY_NAME_MAPPINGS) + + except Exception as e: + print(f"Error loading node module {module_name}: {str(e)}") + continue + +__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS'] + +# 打印加载信息 +print(f'\033[92m[GoohaiTools]\033[0m \033[93m{len(NODE_CLASS_MAPPINGS)} nodes\033[0m loaded | \033[94mColorWidget enabled\033[0m') \ No newline at end of file diff --git a/docs/hel-892/crop-split-reference/guhai__extension.json b/docs/hel-892/crop-split-reference/guhai__extension.json new file mode 100644 index 00000000..59178823 --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__extension.json @@ -0,0 +1,37 @@ +{ + "title": "Goohaitools-comfyui", + "description": "孤海ComfyUI自定义节点合集,批处理实用工具箱。", + "author": "goohai", + "tags": ["孤海", "tool", "utility", "image-processing", "face-detection"], + "install_mode": "copy", + "files": [ + { + "src": "nodes/*.py", + "dst": "custom_nodes/Goohaitools-comfyui/nodes/" + }, + { + "src": "fonts/", + "dst": "custom_nodes/Goohaitools-comfyui/fonts/" + }, + { + "src": "requirements.txt", + "dst": "custom_nodes/Goohaitools-comfyui/" + }, + { + "src": "shape_predictor_5_face_landmarks.dat", + "dst": "custom_nodes/Goohaitools-comfyui/" + }, + { + "src": "__init__.py", + "dst": "custom_nodes/Goohaitools-comfyui/" + }, + { + "src": "extension.json", + "dst": "custom_nodes/Goohaitools-comfyui/" + }, + { + "src": ".gitignore", + "dst": "custom_nodes/Goohaitools-comfyui/" + } + ] +} \ No newline at end of file diff --git a/docs/hel-892/crop-split-reference/guhai__nodes__自动分割图像.py b/docs/hel-892/crop-split-reference/guhai__nodes__自动分割图像.py new file mode 100644 index 00000000..143ad84a --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__nodes__自动分割图像.py @@ -0,0 +1,172 @@ +import os +import re +import numpy as np +from PIL import Image +import torch +import folder_paths + +def auto_crop_image(image): + img = image.convert("RGB") + img_array = np.array(img) + + # 检测背景颜色(取四个角的颜色) + corners = [ + img_array[0, 0], + img_array[0, -1], + img_array[-1, 0], + img_array[-1, -1] + ] + bg_color = np.median(corners, axis=0) + + # 定义颜色差异阈值 + threshold = 30 + + # 上边界 + top = 0 + for row in img_array: + if np.any(np.abs(row - bg_color) > threshold): + break + top += 1 + + # 下边界 + bottom = img_array.shape[0] - 1 + for row in reversed(img_array): + if np.any(np.abs(row - bg_color) > threshold): + break + bottom -= 1 + + # 左边界 + left = 0 + for col in img_array.transpose(1, 0, 2): + if np.any(np.abs(col - bg_color) > threshold): + break + left += 1 + + # 右边界 + right = img_array.shape[1] - 1 + for col in reversed(img_array.transpose(1, 0, 2)): + if np.any(np.abs(col - bg_color) > threshold): + break + right -= 1 + + return img.crop((left, top, right+1, bottom+1)) + +class GuHaiAutoImageSplit: + CATEGORY = "孤海工具箱" + RETURN_TYPES = ("IMAGE",) + RETURN_NAMES = ("分割图像",) + FUNCTION = "split_image" + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "图像": ("IMAGE",), + "保存目录": ("STRING", {"default": "output"}), + "水平张数": ("INT", {"default": 4, "min": 1}), + "垂直张数": ("INT", {"default": 2, "min": 1}), + "移除画布边缘": ("BOOLEAN", {"default": True}), + "移除描边": ("INT", {"default": 0, "min": 0}), + "文件名前缀": ("STRING", {"default": "孤海图像分割_"}), + "保存格式": (["PNG", "JPG"], {"default": "PNG"}), + } + } + + def split_image(self, 图像, 保存目录, 水平张数, 垂直张数, 移除画布边缘, 移除描边, 文件名前缀, 保存格式): + # 处理空文件名前缀 + if not 文件名前缀.strip(): + 文件名前缀 = "孤海图像分割_" + + # 转换张量为PIL图像 + img_tensor = 图像[0].cpu().numpy() + img_array = np.clip(img_tensor * 255.0, 0, 255).astype(np.uint8) + img = Image.fromarray(img_array) + + # 根据开关处理图像 + if 移除画布边缘: + processed_img = auto_crop_image(img) + else: + processed_img = img # 直接使用原始图像 + + img_width, img_height = processed_img.size + + # 计算分块尺寸 + tile_width = img_width // 水平张数 + tile_height = img_height // 垂直张数 + + # 创建保存目录 + full_path = os.path.join(folder_paths.get_output_directory(), 保存目录) + os.makedirs(full_path, exist_ok=True) + + # 处理保存格式 + format_map = { + "JPG": ("JPEG", "jpg"), + "PNG": ("PNG", "png") + } + save_format, ext = format_map[保存格式] + save_args = {"format": save_format} + if save_format == "JPEG": + save_args["quality"] = 95 + + # 获取现有文件最大编号 + max_counter = 0 + pattern = re.compile(rf"^{re.escape(文件名前缀)}(\d{{2,}})\.{ext}$", re.IGNORECASE) + for filename in os.listdir(full_path): + match = pattern.match(filename) + if match: + current_num = int(match.group(1)) + if current_num > max_counter: + max_counter = current_num + + # 分割并保存图像 + output_images = [] + counter = max_counter + 1 + for y in range(垂直张数): + for x in range(水平张数): + # 计算原始分块位置 + left = x * tile_width + upper = y * tile_height + right = left + tile_width + lower = upper + tile_height + + # 裁剪原始分块 + tile = processed_img.crop((left, upper, right, lower)) + + # 应用移除描边 + if 移除描边 > 0: + w, h = tile.size + # 确保裁剪后尺寸有效 + trim_size = min(移除描边, w//2-1, h//2-1) + if trim_size > 0: + tile = tile.crop(( + trim_size, + trim_size, + w - trim_size, + h - trim_size + )) + + # 转换模式兼容JPG + if save_format == "JPEG" and tile.mode in ("RGBA", "LA"): + tile = tile.convert("RGB") + + # 生成文件名 + filename = f"{文件名前缀}{counter:02d}.{ext}" + save_path = os.path.join(full_path, filename) + tile.save(save_path, **save_args) + + # 转换回张量格式 + tile_np = np.array(tile).astype(np.float32) / 255.0 + tile_tensor = torch.from_numpy(tile_np).unsqueeze(0) + output_images.append(tile_tensor) + counter += 1 + + return (torch.cat(output_images, dim=0),) + +# 节点注册 +NODE_CLASS_MAPPINGS = { + "GuHaiAutoImageSplit": GuHaiAutoImageSplit +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "GuHaiAutoImageSplit": "孤海自动分割图像" +} \ No newline at end of file diff --git a/docs/hel-892/crop-split-reference/guhai__web__js__BOOLEAN.js b/docs/hel-892/crop-split-reference/guhai__web__js__BOOLEAN.js new file mode 100644 index 00000000..9a76d4e8 --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__web__js__BOOLEAN.js @@ -0,0 +1,230 @@ +import { app } from "../../../scripts/app.js"; + +/* ═══════════════════════════════════════════════════════════ + * 布尔开关 — 替换 "布尔 孤海" 节点原生 checkbox + * ═══════════════════════════════════════════════════════════ */ + +app.registerExtension({ + name: "goohaitools.bool_switch", + + async beforeRegisterNodeDef(nodeType, nodeData) { + if (nodeData.name !== "布尔孤海") return; + + const origOnCreated = nodeType.prototype.onNodeCreated; + nodeType.prototype.onNodeCreated = function () { + origOnCreated?.apply(this, arguments); + + /* ── 设置默认节点颜色(仅首次创建时) ── */ + this.color = "#4F4047"; + this.bgcolor = "#493C42"; + buildCustomSwitch(this); + }; + + const origOnConfigure = nodeType.prototype.onConfigure; + nodeType.prototype.onConfigure = function (info) { + origOnConfigure?.apply(this, arguments); + if (this._guhaiSyncUI) this._guhaiSyncUI(); + }; + }, +}); + + +/* ──────────────────────────────────────────────────────────── + * 构建自定义开关(Canvas 绘制,非 DOM) + * ──────────────────────────────────────────────────────────── */ +function buildCustomSwitch(node) { + const boolWidget = node.widgets?.find((w) => w.name === "开关"); + if (!boolWidget) return; + + boolWidget.hidden = true; + + let isOn = !!boolWidget.value; + let labelText = (node.properties && node.properties.guhai_label) || "开关"; + let lastClickTime = 0; + let activeInput = null; + let _w = 200, _y = 0, _h = 44; + + /* ── 圆角矩形辅助 ── */ + function rrect(ctx, x, y, w, h, r) { + ctx.beginPath(); + ctx.moveTo(x + r, y); + ctx.arcTo(x + w, y, x + w, y + h, r); + ctx.arcTo(x + w, y + h, x, y + h, r); + ctx.arcTo(x, y + h, x, y, r); + ctx.arcTo(x, y, x + w, y, r); + ctx.closePath(); + } + + /* ── 文本截断辅助 ── */ + function ellipsis(ctx, text, maxW) { + if (ctx.measureText(text).width <= maxW) return text; + let t = text; + while (t.length > 1 && ctx.measureText(t + "…").width > maxW) { + t = t.slice(0, -1); + } + return t + "…"; + } + + /* ── 结束标签编辑 ── */ + function finishEdit() { + if (!activeInput) return; + labelText = activeInput.value.trim() || "开关"; + activeInput.remove(); + activeInput = null; + try { + node.properties = node.properties || {}; + node.properties.guhai_label = labelText; + } catch (_) {} + } + + /* ── 开始标签编辑 ── */ + function startLabelEdit(clientX, clientY) { + if (activeInput) return; + + const scale = app.canvas?.ds?.scale ?? 1; + const input = document.createElement("input"); + input.type = "text"; + input.value = labelText; + Object.assign(input.style, { + position: "fixed", + left: clientX + "px", + top: (clientY - 14 * scale) + "px", + fontSize: Math.max(12, Math.round(20 * scale)) + "px", + fontWeight: "bold", + color: "#e0e0e0", + background: "#2a2a2a", + border: "1px solid #555", + borderRadius: "4px", + padding: "2px 6px", + outline: "none", + zIndex: "99999", + minWidth: "80px", + }); + + document.body.appendChild(input); + activeInput = input; + + requestAnimationFrame(() => { + input.focus(); + input.select(); + }); + + input.addEventListener("keydown", (ev) => { + if (ev.key === "Enter" || ev.key === "Escape") { + ev.preventDefault(); + ev.stopImmediatePropagation(); + finishEdit(); + } + }, true); + + input.addEventListener("blur", () => { + setTimeout(finishEdit, 50); + }); + } + + /* ════════════════════════════════════════════════════════ + * 注册 Canvas 自定义 Widget + * ════════════════════════════════════════════════════════ */ + node.addCustomWidget({ + name: "guhai_toggle", + type: "toggle_custom", + value: isOn, + + /* ── 每帧绘制 ── */ + draw(ctx, node, widgetWidth, y, H) { + _w = widgetWidth; + _y = y; + _h = H; + + const m = 10; + const yOff = 6; + const xOff = 6; + + /* ─ 开关轨道 ─ */ + const tw = 72, th = 28; + const tx = widgetWidth - tw - m - xOff; + const ty = y + yOff + (H - th) / 2; + + /* ─ 标签文字:在按钮左侧区域内水平居中 ─ */ + const textAreaRight = tx - m; + const textAreaCenter = (m + textAreaRight) / 2; + const maxTextW = textAreaRight - m; + + ctx.font = "bold 24px sans-serif"; + ctx.fillStyle = "#e0e0e0"; + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + ctx.fillText( + ellipsis(ctx, labelText, maxTextW), + textAreaCenter, + y + yOff + H / 2 + ); + + /* ─ 开关轨道绘制 ─ */ + ctx.save(); + if (isOn) { + ctx.shadowColor = "rgba(76,175,80,0.4)"; + ctx.shadowBlur = 10; + ctx.fillStyle = "#4CAF50"; + } else { + ctx.fillStyle = "#606060"; + } + rrect(ctx, tx, ty, tw, th, th / 2); + ctx.fill(); + ctx.restore(); + + /* ─ 圆形旋钮 ─ */ + const kr = 11; + const kx = isOn ? tx + tw - kr - 3 : tx + kr + 3; + const ky = ty + th / 2; + + ctx.save(); + ctx.shadowColor = "rgba(0,0,0,0.3)"; + ctx.shadowBlur = 4; + ctx.fillStyle = isOn ? "#ffffff" : "#999999"; + ctx.beginPath(); + ctx.arc(kx, ky, kr, 0, Math.PI * 2); + ctx.fill(); + ctx.restore(); + }, + + /* ── 鼠标事件 ── */ + mouse(event, pos, node) { + if (event.type !== "pointerdown" && event.type !== "mousedown") { + return false; + } + + const now = Date.now(); + const dbl = (now - lastClickTime) < 350; + lastClickTime = now; + + /* 双击 → 编辑标签 */ + if (dbl) { + startLabelEdit(event.clientX, event.clientY); + return true; + } + + /* 单击 → 切换开关 */ + const toggleStartX = _w - 72 - 10 - 20; + if (pos[0] > toggleStartX) { + isOn = !isOn; + boolWidget.value = isOn; + this.value = isOn; + return true; + } + + return false; + }, + + computeSize(width) { + return [width, 44]; + }, + }); + + /* ── 工作流加载后同步 UI ── */ + node._guhaiSyncUI = () => { + isOn = !!boolWidget.value; + labelText = (node.properties && node.properties.guhai_label) || "开关"; + if (activeInput) finishEdit(); + }; +} diff --git a/docs/hel-892/crop-split-reference/guhai__web__js__GoohaiNote.js b/docs/hel-892/crop-split-reference/guhai__web__js__GoohaiNote.js new file mode 100644 index 00000000..d1cf7a89 --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__web__js__GoohaiNote.js @@ -0,0 +1,930 @@ +/** + * 孤海注释 - ComfyUI 自定义文本编辑器节点 * + */ + +import { app } from "../../../scripts/app.js"; + +// ==================== 模块级工具常量与函数 ==================== + +// URL 安全字符集(RFC 3986 + 常见字符) +const _URL_CHARS = "a-zA-Z0-9._~:/?#\\[\\]@!$&'()*+,;=%\\-"; + +// 链接匹配正则 +const LINK_REGEX = new RegExp( + "(\\[\\[(.+?)\\]\\])" + + "|(https?:\\/\\/[" + _URL_CHARS + "]+)" + + "|(www\\.[" + _URL_CHARS + "]+)", + "g" +); + +const isChinese = (ch) => /[\u4e00-\u9fff\u3400-\u4dbf\uf900-\ufaff]/.test(ch); +const isBreakPoint = (ch) => /[\s\p{P}\p{S}]/u.test(ch); +const isPunct = (ch) => /\p{P}|\p{S}/.test(ch); + +const CJK_PUNCT_SET = new Set( + ',。、!?:;「」『』【】《》()\u201C\u201D\u2018\u2019—…~.'.split('') +); +const isCJKPunct = (ch) => CJK_PUNCT_SET.has(ch); +const isCJKLike = (ch) => isChinese(ch) || isCJKPunct(ch); + +const LINE_START_FORBIDDEN = new Set([ + ',', ',', '.', '。', ';', ';', '!', '!', + '\u201D', '\u2019', '」', '』', +]); +const isLineStartForbidden = (ch) => LINE_START_FORBIDDEN.has(ch); + +// ==================== ComfyUI 字体获取(TTL 缓存) ==================== + +let _cachedComfyFont = null; +let _cachedFontTime = 0; +const FONT_CACHE_TTL = 3000; + +function getComfyUIFont() { + const now = Date.now(); + if (_cachedComfyFont && (now - _cachedFontTime) < FONT_CACHE_TTL) return _cachedComfyFont; + + const root = getComputedStyle(document.documentElement); + for (const v of ['--font-family', '--fontFamily', '--p-font-family', '--ui-font-family', '--body-font-family']) { + const val = root.getPropertyValue(v).trim(); + if (val && val !== '' && val !== 'inherit' && val !== 'initial') { + _cachedComfyFont = val; _cachedFontTime = now; return val; + } + } + + for (const sel of ['.p-panelmenu .p-panelmenu-item-content', '.p-panelmenu', '.comfy-multiline-input', '.litegraph .dialog', '.p-button', '#vue-app', '#app']) { + const el = document.querySelector(sel); + if (el) { + const ff = getComputedStyle(el).fontFamily; + if (ff && ff.trim() !== '' && !/^["']?serif/i.test(ff.trim())) { + _cachedComfyFont = ff; _cachedFontTime = now; return ff; + } + } + } + + const walkTargets = document.querySelectorAll('button, label, span, p, h1, h2, h3, h4, a, li, .p-component'); + for (const el of walkTargets) { + const ff = getComputedStyle(el).fontFamily; + if (ff && ff.trim() !== '') { + const lower = ff.trim().toLowerCase(); + if (lower !== 'serif' && !lower.startsWith('serif,')) { + _cachedComfyFont = ff; _cachedFontTime = now; return ff; + } + } + } + + _cachedComfyFont = '-apple-system, BlinkMacSystemFont, "Segoe UI", DengXian, Roboto, "Helvetica Neue", "Noto Sans", "Microsoft YaHei", "PingFang SC", sans-serif'; + _cachedFontTime = now; + return _cachedComfyFont; +} + +// ==================== 链接解析与字符级换行 ==================== + +/** + * 将文本解析为语义段落数组 + */ +function parseSegments(text) { + LINK_REGEX.lastIndex = 0; + const segments = []; + let match, last = 0; + while ((match = LINK_REGEX.exec(text)) !== null) { + if (match.index > last) + segments.push({ type: 'text', content: text.substring(last, match.index), url: null }); + if (match[1] !== undefined) { + // [[链接]] 语法 + segments.push({ type: 'link', content: match[2], url: match[2] }); + } else if (match[3] !== undefined) { + segments.push({ type: 'link', content: match[3], url: match[3] }); + } else if (match[4] !== undefined) { + segments.push({ type: 'link', content: match[4], url: match[4] }); + } + last = match.index + match[0].length; + } + if (last < text.length) + segments.push({ type: 'text', content: text.substring(last), url: null }); + return segments; +} + +/** + * 将语义段落展开为带类型标记的字符数组 + * 每个元素: { ch, type: 'text'|'link', url: string|null } + */ +function buildCharList(segments) { + const list = []; + for (const seg of segments) { + for (const ch of seg.content) { + list.push({ ch, type: seg.type, url: seg.url }); + } + } + return list; +} + +/** + * 对带类型标记的字符数组执行自动换行 + */ +function wrapCharList(ctx, charList, maxWidth) { + if (!charList || charList.length === 0) return [[]]; + + const lines = []; + let line = []; + let lineStr = ''; + + const rebuild = () => { lineStr = line.map(c => c.ch).join(''); }; + + for (let i = 0; i < charList.length; i++) { + const c = charList[i]; + + if (c.ch === '\n') { + lines.push(line); + line = []; + lineStr = ''; + continue; + } + + const test = lineStr + c.ch; + + if (ctx.measureText(test).width > maxWidth && line.length > 0) { + + if (isCJKLike(c.ch)) { + lines.push(line); + line = [c]; + lineStr = c.ch; + } else { + let lastCJK = -1; + for (let k = line.length - 1; k >= 0; k--) { + if (isCJKLike(line[k].ch)) { lastCJK = k; break; } + } + + if (lastCJK >= 0) { + lines.push(line.slice(0, lastCJK + 1)); + line = [...line.slice(lastCJK + 1), c]; + rebuild(); + } else { + const limit = Math.min(20, line.length); + let bp = -1; + for (let j = line.length - 1; j >= line.length - limit; j--) { + if (isBreakPoint(line[j].ch)) { bp = j; break; } + } + + if (bp >= 0) { + lines.push(line.slice(0, bp + 1)); + line = [...line.slice(bp + 1), c]; + rebuild(); + if (line.length > 0 && isPunct(line[0].ch)) { + let pEnd = 0; + while (pEnd < line.length && isPunct(line[pEnd].ch)) pEnd++; + lines[lines.length - 1] = [...lines[lines.length - 1], ...line.slice(0, pEnd)]; + line = line.slice(pEnd); + rebuild(); + } + } else if (isPunct(c.ch)) { + lines.push([...line, c]); + line = []; + lineStr = ''; + } else { + lines.push(line); + line = [c]; + lineStr = c.ch; + } + } + } + + // 行首禁排字符 + let fix = 0; + while (fix++ < 20 && line.length > 0 && isLineStartForbidden(line[0].ch) && lines.length > 0) { + const prev = lines[lines.length - 1]; + if (!prev || prev.length <= 1) break; + const last = prev[prev.length - 1]; + if (isCJKLike(last.ch)) { + line = [last, ...line]; + lines[lines.length - 1] = prev.slice(0, -1); + } else if (!isBreakPoint(last.ch)) { + let ws = prev.length - 1; + while (ws > 0 && !isBreakPoint(prev[ws - 1].ch)) ws--; + if (ws === 0) { + line = [last, ...line]; + lines[lines.length - 1] = prev.slice(0, -1); + } else { + line = [...prev.slice(ws), ...line]; + lines[lines.length - 1] = prev.slice(0, ws); + } + } else break; + rebuild(); + } + } else { + line.push(c); + lineStr = test; + } + } + + if (line.length > 0) lines.push(line); + return lines.length > 0 ? lines : [[]]; +} + +// ==================== 基础节点类 ==================== + +class TextEditorBaseNode extends LGraphNode { + constructor(title) { + super(title); + this.serialize_widgets = true; + this.isVirtualNode = true; + this.class_type = this.constructor.type; + this.type = this.constructor.type; + this.pos = [0, 0]; + } + + static setUp() { + if (!this.registered) { + LiteGraph.registerNodeType(this.type, this); + this.registered = true; + } + } + + configure(info) { + if (info.properties) Object.assign(this.properties, info.properties); + if (info.pos) this.pos = info.pos; + if (info.size) this.size = info.size; + if (info.flags) this.flags = info.flags; + } + + serialize() { + const data = super.serialize(); + if (!data.id && this.id) data.id = this.id; + if (!data.order && this.order !== undefined) data.order = this.order; + if (!data.mode && this.mode !== undefined) data.mode = this.mode; + data.properties = { ...this.properties }; + if (!data.pos && this.pos) data.pos = [...this.pos]; + if (!data.size && this.size) data.size = [...this.size]; + if (!data.flags && this.flags) data.flags = { ...this.flags }; + return data; + } +} + +// ==================== 文本编辑器节点 ==================== + +class TextEditorNode extends TextEditorBaseNode { + + constructor(title) { + super(title); + this.flags = this.flags || {}; + this.flags.allow_interaction = !this.flags.pinned; + this.properties = { + text: "双击编辑文本内容...", + fontSize: 24, + fontColor: "#E3E3E3", + backgroundColor: "#1B4669", + backgroundAlpha: 0.6, + borderRadius: 30, + padding: 12, + lineHeight: 1.4, + textAlign: "center" + }; + this.resizable = true; + this.size = [360, 100]; + this.color = "#fff0"; + this.bgcolor = "transparent"; + this.isEditing = false; + this.editTextarea = null; + this.linkAreas = []; + } + + /* ---------- 字符级多行文本绘制 ---------- */ + + drawMultilineText(ctx, text, maxWidth, lineHeight) { + this.linkAreas = []; + + + const processed = text + .replace(/\\n/g, "\n") + .replace(/\r\n/g, "\n") + .replace(/\r/g, "\n"); + + const segments = parseSegments(processed); + const chars = buildCharList(segments); + const lines = wrapCharList(ctx, chars, maxWidth); + + if (lines.length === 0) return; + + const totalHeight = (lines.length - 1) * lineHeight + this.properties.fontSize; + const startY = (this.size[1] - totalHeight) / 2 + this.properties.fontSize / 10; + ctx.textBaseline = "top"; + + for (let idx = 0; idx < lines.length; idx++) { + const lineChars = lines[idx]; + if (lineChars.length === 0) continue; + const y = startY + idx * lineHeight; + + + const groups = []; + let gi = 0; + while (gi < lineChars.length) { + const { type, url } = lineChars[gi]; + let gj = gi; + while (gj < lineChars.length && lineChars[gj].type === type && lineChars[gj].url === url) gj++; + groups.push({ + type, url, + text: lineChars.slice(gi, gj).map(c => c.ch).join('') + }); + gi = gj; + } + + // 计算行起始 x(根据对齐方式) + const totalW = groups.reduce((s, g) => s + ctx.measureText(g.text).width, 0); + let startX; + if (this.properties.textAlign === "left") { + startX = this.properties.padding; + } else if (this.properties.textAlign === "right") { + startX = this.size[0] - this.properties.padding - totalW; + } else { + startX = (this.size[0] - totalW) / 2; + } + + ctx.textAlign = "left"; + let dx = startX; + + for (const g of groups) { + const w = ctx.measureText(g.text).width; + if (g.type === 'link') { + this.linkAreas.push({ x: dx, y, width: w, height: lineHeight, url: g.url }); + ctx.fillStyle = "#1976D2"; + ctx.fillText(g.text, dx, y); + // 下划线 + const uy = y + this.properties.fontSize; + ctx.beginPath(); + ctx.moveTo(dx, uy + 1); + ctx.lineTo(dx + w, uy + 1); + ctx.strokeStyle = "#1976D2"; + ctx.lineWidth = 1; + ctx.stroke(); + } else { + ctx.fillStyle = this.properties.fontColor; + ctx.fillText(g.text, dx, y); + } + dx += w; + } + } + } + + /* ---------- 编辑器管理 ---------- */ + + createTextEditor() { + if (this.editTextarea) this.removeTextEditor(); + + _cachedFontTime = 0; + + const canvas = LGraphCanvas.active_canvas; + const rect = canvas.canvas.getBoundingClientRect(); + const ox = (this.pos[0] + canvas.ds.offset[0]) * canvas.ds.scale; + const oy = (this.pos[1] + canvas.ds.offset[1]) * canvas.ds.scale; + + const TOOLBAR_OFFSET = 190; + + // ---- 工具栏 ---- + this.editToolbar = document.createElement("div"); + Object.assign(this.editToolbar.style, { + position: "absolute", + left: rect.left + ox + "px", + top: rect.top + oy - TOOLBAR_OFFSET + "px", + width: "373px", display: "flex", flexDirection: "column", + gap: "8px", zIndex: "1001", fontSize: "12px", color: "#ffffff" + }); + + // ---- 对齐 ---- + const alignRow = document.createElement("div"); + Object.assign(alignRow.style, { display: "flex", alignItems: "center", gap: "8px" }); + const alignLabel = document.createElement("span"); + alignLabel.textContent = "对齐:"; + alignLabel.style.minWidth = "32px"; + alignLabel.style.fontSize = "13px"; + alignRow.appendChild(alignLabel); + + this.alignButtons = {}; + [ + { key: "left", symbol: "⬅" }, + { key: "center", symbol: "⬌" }, + { key: "right", symbol: "➡" } + ].forEach((opt) => { + const btn = document.createElement("button"); + btn.textContent = opt.symbol; + Object.assign(btn.style, { + width: "28px", height: "24px", border: "1px solid #666", + borderRadius: "3px", cursor: "pointer", fontSize: "12px", + backgroundColor: this.properties.textAlign === opt.key ? "#459BAC" : "#444", + color: "#fff", display: "flex", alignItems: "center", justifyContent: "center" + }); + btn.addEventListener("click", () => { + this.properties.textAlign = opt.key; + this.updateAlignButtons(); + app.graph.setDirtyCanvas(true); + }); + this.alignButtons[opt.key] = btn; + alignRow.appendChild(btn); + }); + this.editToolbar.appendChild(alignRow); + + // ---- 文本(颜色)+ 大小(滑条) ---- + const textRow = document.createElement("div"); + Object.assign(textRow.style, { display: "flex", alignItems: "center", gap: "8px" }); + + const txtLbl = document.createElement("span"); + txtLbl.textContent = "文本:"; + txtLbl.style.minWidth = "32px"; + txtLbl.style.fontSize = "13px"; + textRow.appendChild(txtLbl); + + this.textColorPicker = document.createElement("input"); + this.textColorPicker.type = "color"; + this.textColorPicker.value = this.properties.fontColor; + Object.assign(this.textColorPicker.style, { width: "56px", height: "24px", border: "none", borderRadius: "3px", cursor: "pointer" }); + this.textColorPicker.addEventListener("change", (e) => { + this.properties.fontColor = e.target.value; + this.updateTextareaStyle(); + app.graph.setDirtyCanvas(true); + }); + textRow.appendChild(this.textColorPicker); + + const textSpacer = document.createElement("div"); + Object.assign(textSpacer.style, { width: "28px", flexShrink: "0", flexGrow: "0" }); + textRow.appendChild(textSpacer); + + const sizeLbl = document.createElement("span"); + sizeLbl.textContent = "大小:"; + sizeLbl.style.fontSize = "13px"; + textRow.appendChild(sizeLbl); + + this.fontSizeSlider = document.createElement("input"); + this.fontSizeSlider.type = "range"; + this.fontSizeSlider.min = "8"; + this.fontSizeSlider.max = "200"; + this.fontSizeSlider.value = this.properties.fontSize; + Object.assign(this.fontSizeSlider.style, { flex: "1", height: "20px" }); + this.fontSizeSlider.addEventListener("input", (e) => { + this.properties.fontSize = parseInt(e.target.value); + this.fontSizeValue.textContent = this.properties.fontSize; + this.updateTextareaStyle(); + app.graph.setDirtyCanvas(true); + }); + textRow.appendChild(this.fontSizeSlider); + + this.fontSizeValue = document.createElement("span"); + this.fontSizeValue.textContent = this.properties.fontSize; + Object.assign(this.fontSizeValue.style, { fontSize: "12px", minWidth: "25px", textAlign: "right" }); + textRow.appendChild(this.fontSizeValue); + this.editToolbar.appendChild(textRow); + + // ---- 背景(颜色)+ 透明(滑条) ---- + const bgRow = document.createElement("div"); + Object.assign(bgRow.style, { display: "flex", alignItems: "center", gap: "8px" }); + + const bgLbl = document.createElement("span"); + bgLbl.textContent = "背景:"; + bgLbl.style.minWidth = "32px"; + bgLbl.style.fontSize = "13px"; + bgRow.appendChild(bgLbl); + + this.bgColorPicker = document.createElement("input"); + this.bgColorPicker.type = "color"; + this.bgColorPicker.value = this.properties.backgroundColor; + Object.assign(this.bgColorPicker.style, { width: "56px", height: "24px", border: "none", borderRadius: "3px", cursor: "pointer" }); + this.bgColorPicker.addEventListener("change", (e) => { + this.properties.backgroundColor = e.target.value; + this.updateTextareaStyle(); + app.graph.setDirtyCanvas(true); + }); + bgRow.appendChild(this.bgColorPicker); + + const bgSpacer = document.createElement("div"); + Object.assign(bgSpacer.style, { width: "28px", flexShrink: "0", flexGrow: "0" }); + bgRow.appendChild(bgSpacer); + + const alphaLbl = document.createElement("span"); + alphaLbl.textContent = "透明:"; + alphaLbl.style.fontSize = "13px"; + bgRow.appendChild(alphaLbl); + + this.alphaSlider = document.createElement("input"); + this.alphaSlider.type = "range"; + this.alphaSlider.min = "0"; + this.alphaSlider.max = "1"; + this.alphaSlider.step = "0.05"; + this.alphaSlider.value = this.properties.backgroundAlpha; + Object.assign(this.alphaSlider.style, { flex: "1", height: "20px" }); + this.alphaSlider.addEventListener("input", (e) => { + this.properties.backgroundAlpha = parseFloat(e.target.value); + this.alphaValue.textContent = Math.round(100 * this.properties.backgroundAlpha) + "%"; + this.updateTextareaStyle(); + app.graph.setDirtyCanvas(true); + }); + bgRow.appendChild(this.alphaSlider); + + this.alphaValue = document.createElement("span"); + this.alphaValue.textContent = Math.round(100 * this.properties.backgroundAlpha) + "%"; + Object.assign(this.alphaValue.style, { fontSize: "12px", minWidth: "25px", textAlign: "right" }); + bgRow.appendChild(this.alphaValue); + this.editToolbar.appendChild(bgRow); + + // ---- 圆角 ---- + const radiusRow = document.createElement("div"); + Object.assign(radiusRow.style, { display: "flex", alignItems: "center", gap: "8px" }); + const radiusLbl = document.createElement("span"); + radiusLbl.textContent = "圆角:"; + radiusLbl.style.minWidth = "32px"; + radiusLbl.style.fontSize = "13px"; + radiusRow.appendChild(radiusLbl); + + this.borderRadiusSlider = document.createElement("input"); + this.borderRadiusSlider.type = "range"; + this.borderRadiusSlider.min = "0"; + this.borderRadiusSlider.max = "300"; + this.borderRadiusSlider.value = this.properties.borderRadius; + Object.assign(this.borderRadiusSlider.style, { flex: "1", height: "20px" }); + this.borderRadiusSlider.addEventListener("input", (e) => { + this.properties.borderRadius = parseInt(e.target.value); + this.borderRadiusValue.textContent = this.properties.borderRadius; + app.graph.setDirtyCanvas(true); + }); + radiusRow.appendChild(this.borderRadiusSlider); + + this.borderRadiusValue = document.createElement("span"); + this.borderRadiusValue.textContent = this.properties.borderRadius; + Object.assign(this.borderRadiusValue.style, { fontSize: "12px", minWidth: "25px", textAlign: "right" }); + radiusRow.appendChild(this.borderRadiusValue); + this.editToolbar.appendChild(radiusRow); + + // ---- 行距 ---- + const lhRow = document.createElement("div"); + Object.assign(lhRow.style, { display: "flex", alignItems: "center", gap: "8px" }); + const lhLbl = document.createElement("span"); + lhLbl.textContent = "行距:"; + lhLbl.style.minWidth = "32px"; + lhLbl.style.fontSize = "13px"; + lhRow.appendChild(lhLbl); + + this.lineHeightSlider = document.createElement("input"); + this.lineHeightSlider.type = "range"; + this.lineHeightSlider.min = "0.8"; + this.lineHeightSlider.max = "3.0"; + this.lineHeightSlider.step = "0.1"; + this.lineHeightSlider.value = this.properties.lineHeight; + Object.assign(this.lineHeightSlider.style, { flex: "1", height: "20px" }); + this.lineHeightSlider.addEventListener("input", (e) => { + this.properties.lineHeight = parseFloat(e.target.value); + this.lineHeightValue.textContent = this.properties.lineHeight.toFixed(1); + app.graph.setDirtyCanvas(true); + }); + lhRow.appendChild(this.lineHeightSlider); + + this.lineHeightValue = document.createElement("span"); + this.lineHeightValue.textContent = this.properties.lineHeight.toFixed(1); + Object.assign(this.lineHeightValue.style, { fontSize: "12px", minWidth: "25px", textAlign: "right" }); + lhRow.appendChild(this.lineHeightValue); + this.editToolbar.appendChild(lhRow); + + document.body.appendChild(this.editToolbar); + + // ---- 文本编辑区 ---- + this.editTextarea = document.createElement("textarea"); + this.editTextarea.value = this.properties.text; + Object.assign(this.editTextarea.style, { + position: "absolute", + left: rect.left + ox + this.properties.padding * canvas.ds.scale + "px", + top: rect.top + oy + 10 * canvas.ds.scale + "px", + width: (this.size[0] - 2 * this.properties.padding) * canvas.ds.scale + "px", + height: (this.size[1] - 20) * canvas.ds.scale + "px", + fontFamily: getComfyUIFont(), + border: "none", borderRadius: "0px", outline: "none", + resize: "none", padding: "0px", boxSizing: "border-box", + zIndex: "1000", textAlign: this.properties.textAlign + }); + this.updateTextareaStyle(); + document.body.appendChild(this.editTextarea); + this.editTextarea.focus(); + this.editTextarea.select(); + + // 保存并关闭 + const saveAndClose = () => { + this.properties.text = this.editTextarea.value; + this.removeTextEditor(); + this.setDirtyCanvas(true, true); + app.graph.setDirtyCanvas(true); + }; + + // 位置同步 + this.updateEditorsPosition = () => { + if (!this.editTextarea || !this.editToolbar) return; + const c = LGraphCanvas.active_canvas; + const r = c.canvas.getBoundingClientRect(); + const ox2 = (this.pos[0] + c.ds.offset[0]) * c.ds.scale; + const oy2 = (this.pos[1] + c.ds.offset[1]) * c.ds.scale; + Object.assign(this.editTextarea.style, { + left: r.left + ox2 + this.properties.padding * c.ds.scale + "px", + top: r.top + oy2 + 10 * c.ds.scale + "px", + width: (this.size[0] - 2 * this.properties.padding) * c.ds.scale + "px", + height: (this.size[1] - 20) * c.ds.scale + "px" + }); + Object.assign(this.editToolbar.style, { + left: r.left + ox2 + "px", + top: r.top + oy2 - TOOLBAR_OFFSET + "px" + }); + this.updateTextareaStyle(); + }; + + const origOCC = canvas.onCanvasChanged; + canvas.onCanvasChanged = (evt) => { + origOCC && origOCC.call(canvas, evt); + this.updateEditorsPosition(); + }; + this.canvasUpdateInterval = setInterval(() => this.updateEditorsPosition(), 16); + + // 键盘事件 + this.editTextarea.addEventListener("keydown", (e) => { + if ("Escape" === e.key) { + this.removeTextEditor(); + } else if ("Enter" === e.key && (e.ctrlKey || e.metaKey)) { + saveAndClose(); + } + e.stopPropagation(); + }); + + // 点击外部自动保存 + this.clickCount = 0; + this.documentClickHandler = (e) => { + this.clickCount++; + setTimeout(() => { + this.clickCount--; + if (this.clickCount === 0 && this.editTextarea && this.editToolbar && + !this.editTextarea.contains(e.target) && + !this.editToolbar.contains(e.target) && this.isEditing) { + saveAndClose(); + } + }, 300); + }; + setTimeout(() => { + if (this.isEditing) document.addEventListener("click", this.documentClickHandler, true); + }, 200); + + // 失去焦点 + this.editTextarea.addEventListener("blur", () => { + setTimeout(() => { + if (this.editToolbar && this.editTextarea && + !this.editToolbar.contains(document.activeElement) && + document.activeElement !== this.editTextarea) { + saveAndClose(); + } + }, 100); + }); + + this.isEditing = true; + } + + updateTextareaStyle() { + if (!this.editTextarea) return; + const s = LGraphCanvas.active_canvas.ds.scale; + Object.assign(this.editTextarea.style, { + fontSize: this.properties.fontSize * s + "px", + fontFamily: getComfyUIFont(), + color: this.properties.fontColor, + backgroundColor: this.hexToRGBA(this.properties.backgroundColor, this.properties.backgroundAlpha), + textAlign: this.properties.textAlign, + lineHeight: this.properties.lineHeight, + paddingTop: "2px", paddingLeft: "0px", paddingRight: "0px", paddingBottom: "0px", + boxSizing: "border-box" + }); + } + + updateAlignButtons() { + Object.keys(this.alignButtons).forEach((k) => { + this.alignButtons[k].style.backgroundColor = this.properties.textAlign === k ? "#459BAC" : "#444"; + }); + } + + removeTextEditor() { + if (this.editTextarea) { document.body.removeChild(this.editTextarea); this.editTextarea = null; } + if (this.editToolbar) { document.body.removeChild(this.editToolbar); this.editToolbar = null; } + if (this.canvasUpdateInterval) { clearInterval(this.canvasUpdateInterval); this.canvasUpdateInterval = null; } + if (this.documentClickHandler) { document.removeEventListener("click", this.documentClickHandler, true); this.documentClickHandler = null; } + this.isEditing = false; + } + + /* ---------- 渲染 ---------- */ + + onDrawBackground(ctx) { + ctx.save(); + ctx.imageSmoothingEnabled = true; + + const r = this.properties.borderRadius; + ctx.beginPath(); + ctx.roundRect(0, 0, this.size[0], this.size[1], r); + ctx.fillStyle = this.hexToRGBA(this.properties.backgroundColor, this.properties.backgroundAlpha); + ctx.fill(); + + if (this.isEditing) { + ctx.strokeStyle = "#4CAF50"; + ctx.lineWidth = 2; + ctx.stroke(); + } + + if (!this.isEditing) { + ctx.fillStyle = this.properties.fontColor; + ctx.font = this.properties.fontSize + "px " + getComfyUIFont(); + const lh = this.properties.fontSize * this.properties.lineHeight; + const mw = this.size[0] - 2 * this.properties.padding; + this.drawMultilineText(ctx, this.properties.text, mw, lh); + } + + ctx.restore(); + } + + hexToRGBA(hex, alpha) { + return "rgba(" + + parseInt(hex.slice(1, 3), 16) + ", " + + parseInt(hex.slice(3, 5), 16) + ", " + + parseInt(hex.slice(5, 7), 16) + ", " + + alpha + ")"; + } + + draw(ctx) { + this.flags = this.flags || {}; + this.flags.allow_interaction = !this.flags.pinned; + this.onDrawBackground(ctx); + } + + /* ---------- 属性变更 ---------- */ + + onPropertyChanged(name, value) { + if (this.isEditing) { + if ("fontSize" === name && this.fontSizeSlider) { + this.fontSizeSlider.value = value; + this.fontSizeValue.textContent = value; + } else if ("fontColor" === name && this.textColorPicker) { + this.textColorPicker.value = value; + } else if ("backgroundColor" === name && this.bgColorPicker) { + this.bgColorPicker.value = value; + } else if ("backgroundAlpha" === name && this.alphaSlider) { + this.alphaSlider.value = value; + this.alphaValue.textContent = Math.round(100 * value) + "%"; + } else if ("lineHeight" === name && this.lineHeightSlider) { + this.lineHeightSlider.value = value; + this.lineHeightValue.textContent = value.toFixed(1); + } else if ("textAlign" === name && this.alignButtons) { + this.updateAlignButtons(); + } else if ("borderRadius" === name && this.borderRadiusSlider) { + this.borderRadiusSlider.value = value; + this.borderRadiusValue.textContent = value; + } + this.updateTextareaStyle(); + } + this.setDirtyCanvas(true, true); + app.graph.setDirtyCanvas(true); + } + + /* ---------- 交互事件 ---------- */ + + onMouseDown(evt, pos) { + if (!this.isEditing && this.linkAreas && this.linkAreas.length > 0) { + const lp = [pos[0] - this.pos[0], pos[1] - this.pos[1]]; + for (const a of this.linkAreas) { + if (lp[0] >= a.x && lp[0] <= a.x + a.width && lp[1] >= a.y && lp[1] <= a.y + a.height) { + this.openLink(a.url); + return true; + } + } + } + return false; + } + + openLink(url) { + try { + if (!url.match(/^https?:\/\//) && !url.match(/^www\./)) { + url = "https://" + url; + } + window.open(url, "_blank"); + } catch (err) { + console.error("打开链接失败:", err); + } + } + + onDblClick() { + if (!this.isEditing) this.createTextEditor(); + } + + onResize(size) { + if (size && Array.isArray(size) && size.length >= 2) { + this.size[0] = Math.max(size[0], 5); + this.size[1] = Math.max(size[1], 5); + app.graph.setDirtyCanvas(true); + } + } + + getExtraMenuOptions(node, options) { + options.unshift({ + content: "编辑文本", + callback: () => this.createTextEditor() + }); + options.push({ + content: "固定节点", + callback: () => { + this.flags.pinned = !this.flags.pinned; + this.flags.allow_interaction = !this.flags.pinned; + } + }); + } + + onShowCustomPanelInfo(panel) { + panel.querySelector('div.property[data-property="Mode"]')?.remove(); + panel.querySelector('div.property[data-property="Color"]')?.remove(); + } + + onRemoved() { + this.removeTextEditor(); + } +} + +// ==================== 静态属性与控件定义 ==================== + +TextEditorNode.type = "孤海注释"; +TextEditorNode.title = "孤海注释"; +TextEditorNode.title_mode = LiteGraph.NO_TITLE; +TextEditorNode.collapsable = false; + +TextEditorNode["@text"] = { type: "string", title: "文本内容", default: "双击编辑文本内容...", multiline: true }; +TextEditorNode["@fontSize"] = { type: "number", title: "字体大小", default: 24, min: 8, max: 200, step: 1 }; +TextEditorNode["@fontColor"] = { type: "color", title: "字体颜色", default: "#E3E3E3" }; +TextEditorNode["@backgroundColor"] = { type: "color", title: "背景颜色", default: "#1B4669" }; +TextEditorNode["@backgroundAlpha"] = { type: "number", title: "背景透明度", default: 0.6, min: 0, max: 1, step: 0.05 }; +TextEditorNode["@borderRadius"] = { type: "number", title: "圆角", default: 30, min: 0, max: 300, step: 1 }; +TextEditorNode["@padding"] = { type: "number", title: "内边距", default: 12, min: 0, max: 50, step: 1 }; +TextEditorNode["@lineHeight"] = { type: "number", title: "行距", default: 1.4, min: 0.8, max: 3, step: 0.1 }; +TextEditorNode["@textAlign"] = { type: "combo", title: "对齐方式", values: ["left", "center", "right"], default: "center" }; + +// ==================== 画布事件补丁 ==================== + +const _origDrawNode = LGraphCanvas.prototype.drawNode; +LGraphCanvas.prototype.drawNode = function (node, ctx) { + if (node.constructor === TextEditorNode) { + node.bgcolor = "transparent"; + node.color = "#fff0"; + const result = _origDrawNode.apply(this, arguments); + node.onDrawBackground(ctx); + return result; + } + return _origDrawNode.apply(this, arguments); +}; + +const _origPMDown = LGraphCanvas.prototype.processMouseDown; +LGraphCanvas.prototype.processMouseDown = function (e) { + if (!this.graph) return; + const canvasPos = this.convertEventToCanvasOffset(e); + const node = this.graph.getNodeOnPos(canvasPos[0], canvasPos[1], this.visible_nodes); + if (node && node.constructor === TextEditorNode && !node.isEditing) { + const lp = [canvasPos[0] - node.pos[0], canvasPos[1] - node.pos[1]]; + if (node.linkAreas && node.linkAreas.length > 0) { + for (const a of node.linkAreas) { + if (lp[0] >= a.x && lp[0] <= a.x + a.width && + lp[1] >= a.y && lp[1] <= a.y + a.height) { + node.openLink(a.url); + e.preventDefault(); + e.stopPropagation(); + return false; + } + } + } + } + return _origPMDown.call(this, e); +}; + +// ==================== pinned 节点点击穿透 ==================== + +const mouseState = { processingMouseDown: false, lastMouseEvent: null }; + +const _origGNOP = LGraph.prototype.getNodeOnPos; +LGraph.prototype.getNodeOnPos = function (x, y, nodes, margin) { + if (nodes) { + const recent = LiteGraph.getTime() - + (LGraphCanvas.active_canvas && LGraphCanvas.active_canvas.last_mouseclick + ? LGraphCanvas.active_canvas.last_mouseclick : 0) < 300; + if (mouseState.processingMouseDown && mouseState.lastMouseEvent && + mouseState.lastMouseEvent.type.includes("down") && + mouseState.lastMouseEvent.which === 1 && !recent) { + nodes = [...nodes].filter(n => !(n instanceof TextEditorNode && n.flags.pinned)); + } + } + return _origGNOP.apply(this, [x, y, nodes, margin]); +}; + +document.addEventListener("mousedown", function (e) { + mouseState.processingMouseDown = true; + mouseState.lastMouseEvent = e; +}, true); + +document.addEventListener("mouseup", function () { + mouseState.processingMouseDown = false; +}, true); + +// ==================== 注册 ComfyUI 扩展 ==================== + +app.registerExtension({ + name: "孤海注释", + registerCustomNodes() { + TextEditorNode.setUp(); + } +}); diff --git a/docs/hel-892/crop-split-reference/guhai__web__js__colorWidget.js b/docs/hel-892/crop-split-reference/guhai__web__js__colorWidget.js new file mode 100644 index 00000000..f1f22386 --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__web__js__colorWidget.js @@ -0,0 +1,126 @@ +/** + * COLOR Widget for ComfyUI + * + * This integration script is licensed under the GNU General Public License v3.0 (GPL-3.0). + * If you incorporate or modify this code, please credit AILab as the original source: + * https://github.com/1038lab + */ + +import { app } from "/scripts/app.js"; + +const getContrastTextColor = (hexColor) => { + if (typeof hexColor !== 'string' || !/^#?[0-9a-fA-F]{6}$/.test(hexColor)) { + return '#cccccc'; // fallback text color + } + + const hex = hexColor.replace('#', ''); + const r = parseInt(hex.substr(0, 2), 16); + const g = parseInt(hex.substr(2, 2), 16); + const b = parseInt(hex.substr(4, 2), 16); + const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255; + + return luminance > 0.5 ? '#333333' : '#cccccc'; +}; + +const AILabColorWidget = { + COLORCODE: (key, val) => { + const widget = {}; + widget.y = 0; + widget.name = key; + widget.type = 'COLORCODE'; + widget.options = { default: '#222222' }; + widget.value = typeof val === 'string' ? val : '#222222'; + + widget.draw = function (ctx, node, widgetWidth, widgetY, height) { + const hide = this.type !== 'COLORCODE' && app.canvas.ds.scale > 0.5; + if (hide) { + return; + } + + const margin = 15; + const radius = 12; + + ctx.fillStyle = this.value; + ctx.beginPath(); + const x = margin; + const y = widgetY; + const w = widgetWidth - margin * 2; + const h = height; + ctx.moveTo(x + radius, y); + ctx.lineTo(x + w - radius, y); + ctx.quadraticCurveTo(x + w, y, x + w, y + radius); + ctx.lineTo(x + w, y + h - radius); + ctx.quadraticCurveTo(x + w, y + h, x + w - radius, y + h); + ctx.lineTo(x + radius, y + h); + ctx.quadraticCurveTo(x, y + h, x, y + h - radius); + ctx.lineTo(x, y + radius); + ctx.quadraticCurveTo(x, y, x + radius, y); + ctx.closePath(); + ctx.fill(); + + ctx.strokeStyle = '#555'; + ctx.lineWidth = 1; + ctx.stroke(); + + ctx.fillStyle = getContrastTextColor(this.value); + ctx.font = '12px sans-serif'; + ctx.textAlign = 'center'; + + const text = `${this.name} (${this.value})`; + ctx.fillText(text, widgetWidth * 0.5, widgetY + height * 0.65); + }; + + widget.mouse = function (e, pos, node) { + if (e.type === 'pointerdown') { + const margin = 15; + + if (pos[0] >= margin && pos[0] <= node.size[0] - margin) { + const picker = document.createElement('input'); + picker.type = 'color'; + picker.value = this.value; + + picker.style.position = 'absolute'; + picker.style.left = '-9999px'; + picker.style.top = '-9999px'; + + document.body.appendChild(picker); + + picker.addEventListener('change', () => { + this.value = picker.value; + node.graph._version++; + node.setDirtyCanvas(true, true); + picker.remove(); + }); + + picker.click(); + return true; + } + } + return false; + }; + + widget.computeSize = function (width) { + return [width, 32]; + }; + + return widget; + } +}; + +app.registerExtension({ + name: "AILab.colorWidget", + + getCustomWidgets() { + return { + COLORCODE: (node, inputName, inputData) => { + return { + widget: node.addCustomWidget( + AILabColorWidget.COLORCODE(inputName, inputData?.[1]?.default || '#222222') + ), + minWidth: 150, + minHeight: 32, + }; + } + }; + } +}); \ No newline at end of file diff --git a/docs/hel-892/crop-split-reference/guhai__web__js__goohai_universal_slider.js b/docs/hel-892/crop-split-reference/guhai__web__js__goohai_universal_slider.js new file mode 100644 index 00000000..315a5b1b --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__web__js__goohai_universal_slider.js @@ -0,0 +1,615 @@ +import { app } from "../../../scripts/app.js"; + +// ═══════════════════════════════════════════════ +// 孤海万能滑条 · Goohai Universal Slider +// Canvas 绘制版:缩放到任意大小都始终可见 +// ═══════════════════════════════════════════════ + + +(function () { + const ID = "goohai-us-css"; + if (document.getElementById(ID)) return; + const s = document.createElement("style"); + s.id = ID; + s.textContent = ` +.ghs-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);backdrop-filter:blur(3px);z-index:100000;display:flex;justify-content:center;align-items:center;animation:ghsIn .15s ease} +@keyframes ghsIn{from{opacity:0}to{opacity:1}} +@keyframes ghsPop{from{opacity:0;transform:translateY(-8px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}} +.ghs-panel{background:#1c1c1e;border:1px solid #333;border-radius:14px;padding:28px 32px;min-width:380px;box-shadow:0 24px 80px rgba(0,0,0,.6);animation:ghsPop .2s ease;font-family:'Segoe UI',system-ui,-apple-system,sans-serif;--gs-c:#e8c547} +.ghs-ptitle{font-size:16px;font-weight:700;color:#eee;margin-bottom:22px} +.ghs-row{display:flex;align-items:center;margin-bottom:14px} +.ghs-rlbl{width:72px;font-size:12.5px;color:#999;flex-shrink:0} +.ghs-inp{flex:1;background:#2a2a2c;border:1px solid #3a3a3c;border-radius:8px;padding:8px 12px;color:#eee;font-size:13px;outline:none;transition:border-color .2s;font-family:inherit} +.ghs-inp:focus{border-color:var(--gs-c)} +.ghs-clr{width:48px;height:34px;padding:2px;border-radius:8px;border:1px solid #3a3a3c;background:#2a2a2c;cursor:pointer} +.ghs-btns{display:flex;justify-content:flex-end;gap:10px;margin-top:22px} +.ghs-btn{padding:8px 22px;border-radius:8px;border:none;cursor:pointer;font-size:13px;font-weight:500;transition:all .15s;font-family:inherit} +.ghs-bx{background:#2a2a2c;color:#aaa;border:1px solid #3a3a3c} +.ghs-bx:hover{background:#333;color:#ccc} +.ghs-bok{background:var(--gs-c);color:#111;font-weight:600} +.ghs-bok:hover{filter:brightness(1.12)} +.ghs-radio-wrap{flex:1;display:flex;gap:20px;align-items:center} +.ghs-radio-label{display:flex;align-items:center;gap:6px;cursor:pointer;color:#eee;font-size:13px;padding:6px 12px;border-radius:6px;background:#2a2a2c;border:1px solid #3a3a3c;transition:all .15s} +.ghs-radio-label:hover{border-color:var(--gs-c)} +.ghs-radio-label input[type="radio"]{appearance:none;-webkit-appearance:none;width:16px;height:16px;border:2px solid #555;border-radius:50%;cursor:pointer;transition:all .15s;position:relative} +.ghs-radio-label input[type="radio"]:checked{border-color:var(--gs-c)} +.ghs-radio-label input[type="radio"]:checked::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:8px;height:8px;border-radius:50%;background:var(--gs-c)} + `; + document.head.appendChild(s); +})(); + +// ── 工具函数 ────────────────────────────────── +const pct = (v, mn, mx) => { const r = mx - mn; return r > 0 ? ((v - mn) / r) * 100 : 0; }; +const clamp = (v, mn, mx) => Math.max(mn, Math.min(mx, v)); +const snap = (v, mn, step) => step > 0 ? Math.round((v - mn) / step) * step + mn : v; +const fmt = (v, isInt) => isInt ? String(Math.round(v)) : v.toFixed(2); +function castVal(v, isInt) { + if (isInt) return parseInt(Math.round(v), 10); + return parseFloat(v.toFixed(2)); +} + +// ── 统一的值计算函数,先 snap 再按类型取整 ── +function calcValue(v, mn, mx, step, isInt) { + v = snap(v, mn, step); + v = clamp(v, mn, mx); + return castVal(v, isInt); +} + +// ── Canvas 圆角矩形 ────────────────────────── +function rrect(ctx, x, y, w, h, r) { + if (w < 0) w = 0; + ctx.beginPath(); + ctx.moveTo(x + r, y); + ctx.arcTo(x + w, y, x + w, y + h, r); + ctx.arcTo(x + w, y + h, x, y + h, r); + ctx.arcTo(x, y + h, x, y, r); + ctx.arcTo(x, y, x + w, y, r); + ctx.closePath(); +} + +// ── updateVis ──────────────────────────────── +function updateVis(n) { + n.setDirtyCanvas(true, true); +} + +// ── syncWidgetType ─────────────────────────── +function syncWidgetType(node) { + const g = node._gs; + if (!g || !g.widget) return; + const p = node.properties; + const isInt = p.sliderType === "int"; + g.widget.type = isInt ? "INT" : "FLOAT"; + let v = g.widget.value; + v = clamp(v, p.sliderMin, p.sliderMax); + v = isInt ? Math.round(v) : parseFloat(v.toFixed(2)); + g.widget.value = v; +} + +// ── syncOutputType ─────────────────────────── +function syncOutputType(node) { + const g = node._gs; + if (!g || !g.outputTypeWidget) return; + const isInt = node.properties.sliderType === "int"; + g.outputTypeWidget.value = isInt ? "int" : "float"; +} + +// ── 清理拖拽状态 ───────────────────────────── +function cleanupDrag(node) { + const g = node._gs; + if (!g) return; + g._dragging = false; + if (g._docCleanup) { + g._docCleanup(); + g._docCleanup = null; + } +} + +// ── showSettings ───────────────────────────── +function showSettings(node) { + cleanupDrag(node); + document.querySelectorAll(".ghs-overlay").forEach((e) => e.remove()); + const p = node.properties; + + const ov = document.createElement("div"); + ov.className = "ghs-overlay"; + ov.setAttribute("tabindex", "-1"); + + const pl = document.createElement("div"); + pl.className = "ghs-panel"; + pl.style.setProperty("--gs-c", p.sliderColor); + + const title = document.createElement("div"); + title.className = "ghs-ptitle"; + title.textContent = "🎮 孤海滑条 设置"; + pl.appendChild(title); + + function addRow(labelText, el) { + const r = document.createElement("div"); + r.className = "ghs-row"; + const l = document.createElement("label"); + l.className = "ghs-rlbl"; + l.textContent = labelText; + r.append(l, el); + pl.appendChild(r); + } + function mkInp(type, value, attrs) { + const i = document.createElement("input"); + i.className = "ghs-inp"; + i.type = type; + i.value = value; + if (attrs) Object.entries(attrs).forEach(([k, v]) => i.setAttribute(k, v)); + return i; + } + + const clrI = document.createElement("input"); + clrI.className = "ghs-clr"; + clrI.type = "color"; + clrI.value = p.sliderColor; + addRow("滑条颜色", clrI); + + const radioWrap = document.createElement("div"); + radioWrap.className = "ghs-radio-wrap"; + const types = [ + { v: "float", t: "浮点 (Float)" }, + { v: "int", t: "整数 (Integer)" }, + ]; + let selectedType = p.sliderType; + types.forEach((opt) => { + const label = document.createElement("label"); + label.className = "ghs-radio-label"; + const radio = document.createElement("input"); + radio.type = "radio"; + radio.name = "ghs-slider-type"; + radio.value = opt.v; + radio.checked = (p.sliderType === opt.v); + radio.addEventListener("change", () => { if (radio.checked) selectedType = opt.v; }); + label.append(radio, document.createTextNode(opt.t)); + radioWrap.appendChild(label); + }); + addRow("类型", radioWrap); + + const minI = mkInp("number", p.sliderMin, { step: "any" }); + addRow("最小值", minI); + const maxI = mkInp("number", p.sliderMax, { step: "any" }); + addRow("最大值", maxI); + const stepI = mkInp("number", p.sliderStep, { step: "any", min: "0.0001" }); + addRow("步长", stepI); + const lblI = mkInp("text", p.sliderLabel); + addRow("显示名称", lblI); + + const btns = document.createElement("div"); + btns.className = "ghs-btns"; + const bCancel = document.createElement("button"); + bCancel.className = "ghs-btn ghs-bx"; + bCancel.textContent = "取消"; + bCancel.onclick = () => ov.remove(); + const bOk = document.createElement("button"); + bOk.className = "ghs-btn ghs-bok"; + bOk.textContent = "确定"; + bOk.onclick = () => { + let type = selectedType; + let mn = parseFloat(minI.value); + let mx = parseFloat(maxI.value); + let step = parseFloat(stepI.value); + let label = (lblI.value || "").trim() || "值"; + let color = clrI.value; + + if (isNaN(mn)) mn = 0; + if (isNaN(mx)) mx = 1; + if (mn > mx) { const t = mn; mn = mx; mx = t; } + if (isNaN(step) || step <= 0) step = type === "int" ? 1 : 0.01; + if (type === "int") { + mn = Math.round(mn); + mx = Math.round(mx); + step = Math.max(1, Math.round(step)); + } + + p.sliderType = type; + p.sliderMin = mn; + p.sliderMax = mx; + p.sliderStep = step; + p.sliderLabel = label; + p.sliderColor = color; + + const w = node._gs.widget; + if (w) { + w.value = calcValue(w.value, mn, mx, step, type === "int"); + } + + syncWidgetType(node); + syncOutputType(node); + updateVis(node); + node.setDirtyCanvas(true, true); + ov.remove(); + }; + + btns.append(bCancel, bOk); + pl.appendChild(btns); + ov.appendChild(pl); + + ov.addEventListener("click", (e) => { if (e.target === ov) ov.remove(); }); + ov.addEventListener("keydown", (e) => { + if (e.key === "Escape") ov.remove(); + if (e.key === "Enter") bOk.click(); + }); + + document.body.appendChild(ov); + ov.focus(); +} + +// ── setupSlider ────────────────────────────── +function setupSlider(node) { + const D = { + sliderType: "float", sliderMin: 0, sliderMax: 1, + sliderStep: 0.01, sliderLabel: "值", sliderColor: "#e8c547", + }; + if (!node.properties) node.properties = {}; + for (const [k, v] of Object.entries(D)) { + if (node.properties[k] === undefined) node.properties[k] = v; + } + const p = node.properties; + const isInt = p.sliderType === "int"; + + /* 隐藏 PY 自带滑条 */ + const dw = node.widgets ? node.widgets.find((w) => w.name === "值") : null; + if (dw) { + dw.hidden = true; + dw.computeSize = () => [0, 0]; + } + + /* output_type 隐藏 widget */ + let outputTypeWidget = node.widgets + ? node.widgets.find((w) => w.name === "output_type") + : null; + if (!outputTypeWidget) { + node.addWidget("combo", "output_type", isInt ? "int" : "float", function () {}, { values: ["float", "int"] }); + outputTypeWidget = node.widgets ? node.widgets.find((w) => w.name === "output_type") : null; + } + if (outputTypeWidget) { + outputTypeWidget.value = isInt ? "int" : "float"; + outputTypeWidget.type = "hidden"; + outputTypeWidget.hidden = true; + outputTypeWidget.computeSize = () => [0, 0]; + outputTypeWidget.draw = function () {}; + outputTypeWidget.mouse = function () {}; + } + + /* 节点外观 */ + node.color = "#2D384D"; + node.bgcolor = "#2D384D"; + + /* 覆盖标题渲染 */ + const origFG = node.onDrawForeground; + node.onDrawForeground = function (ctx) { + const th = (typeof LiteGraph !== "undefined" && LiteGraph.NODE_TITLE_HEIGHT) || 30; + const r = (typeof LiteGraph !== "undefined" && LiteGraph.NODE_ROUND_RADIUS) || 8; + const w = this.size[0]; + const x = 0, y = -th, fw = w, fh = th + 2; + + ctx.save(); + ctx.beginPath(); + ctx.moveTo(x + r, y); + ctx.lineTo(x + fw - r, y); + ctx.arcTo(x + fw, y, x + fw, y + r, r); + ctx.lineTo(x + fw, y + fh); + ctx.lineTo(x, y + fh); + ctx.lineTo(x, y + r); + ctx.arcTo(x, y, x + r, y, r); + ctx.closePath(); + ctx.fillStyle = this.color || "#2D384D"; + ctx.fill(); + ctx.restore(); + + ctx.save(); + ctx.font = "20px 'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif"; + ctx.fillStyle = "#E3E3E3"; + ctx.textAlign = "center"; + ctx.textBaseline = "top"; + ctx.fillText(this.title || "", w / 2, -th + 10); + ctx.restore(); + if (origFG) origFG.call(this, ctx); + }; + + /* ── 绘制状态缓存 ── */ + const ds = { trackLeft: 14, trackW: 192 }; + + node._gs = { + widget: dw, + outputTypeWidget: outputTypeWidget, + _dragging: false, + _docCleanup: null, + }; + + syncWidgetType(node); + syncOutputType(node); + + /* ══════════════════════════════════════════ + * 注册 Canvas 自定义 Widget + * ══════════════════════════════════════════ */ + node.addCustomWidget({ + name: "ghs_ui", + type: "goohai_slider", + + draw(ctx, node, W, y, H) { + const g = node._gs; + if (!g) return; + const p = node.properties; + const v = g.widget ? g.widget.value : 0; + const isInt = p.sliderType === "int"; + const ratio = clamp(pct(v, p.sliderMin, p.sliderMax), 0, 100); + const color = p.sliderColor; + + + const ml = 14; + const mr = 24; + ds.trackLeft = ml; + ds.trackW = W - ml - mr; + + /* ── 居中标签(名称 16px + 数值 20px bold) ── */ + ctx.save(); + ctx.textBaseline = "middle"; + ctx.textAlign = "left"; + + const nameFont = "16px 'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif"; + const valFont = "bold 24px 'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif"; + + ctx.font = nameFont; + const nameText = p.sliderLabel; + const nameW = ctx.measureText(nameText).width; + + ctx.font = valFont; + const valText = " " + fmt(v, isInt); + const valW = ctx.measureText(valText).width; + + const lx = (W - nameW - valW) / 2; + const ly = y + 6; + + ctx.shadowColor = "rgba(0,0,0,0.6)"; + ctx.shadowBlur = 3; + ctx.shadowOffsetY = 1; + + ctx.font = nameFont; + ctx.fillStyle = "#B2B7BD"; + ctx.fillText(nameText, lx, ly); + + ctx.font = valFont; + ctx.fillStyle = color; + ctx.fillText(valText, lx + nameW, ly); + ctx.restore(); + + /* ── 轨道背景(10px 高,圆角 5) */ + const trackY = y + 34; + const trackH = 10; + const trackR = 5; + + ctx.save(); + ctx.shadowColor = "rgba(0,0,0,0.5)"; + ctx.shadowBlur = 2; + ctx.shadowOffsetY = 1; + rrect(ctx, ml, trackY, ds.trackW, trackH, trackR); + ctx.fillStyle = "#1a1a1a"; + ctx.fill(); + ctx.restore(); + + const fillW = ds.trackW * ratio / 100; + + /* ── 发光层 ── */ + if (fillW > 0) { + ctx.save(); + ctx.globalAlpha = 0.2; + ctx.shadowColor = color; + ctx.shadowBlur = 10; + rrect(ctx, ml, trackY + 2, fillW, trackH - 4, 5); + ctx.fillStyle = color; + ctx.fill(); + ctx.restore(); + } + + /* ── 填充条 ── */ + if (fillW > 0) { + ctx.save(); + rrect(ctx, ml, trackY, fillW, trackH, trackR); + ctx.fillStyle = color; + ctx.fill(); + ctx.restore(); + } + + /* ── 圆形旋钮(16px 直径) ── */ + const thumbX = ml + fillW; + const thumbY = trackY + trackH / 2; + const thumbR = 8; + + ctx.save(); + if (g._dragging) { + ctx.shadowColor = "rgba(232,197,71,0.12)"; + ctx.shadowBlur = 5; + } else { + ctx.shadowColor = "rgba(0,0,0,0.4)"; + ctx.shadowBlur = 4; + } + ctx.fillStyle = "#f5f0e8"; + ctx.strokeStyle = color; + ctx.lineWidth = 2; + ctx.beginPath(); + ctx.arc(thumbX, thumbY, thumbR, 0, Math.PI * 2); + ctx.fill(); + ctx.stroke(); + ctx.restore(); + }, + + mouse(event, pos, node) { + const g = node._gs; + if (!g) return; + const p = node.properties; + + /* ── mouseup / pointerup:结束拖拽 ── */ + if (event.type === "mouseup" || event.type === "pointerup") { + if (g._dragging) { + g._dragging = false; + if (g._docCleanup) { g._docCleanup(); g._docCleanup = null; } + node.setDirtyCanvas(true, true); + return true; + } + return; + } + + /* ── mousemove / pointermove:拖拽中实时更新 ── */ + if ((event.type === "mousemove" || event.type === "pointermove") && g._dragging) { + const isInt = p.sliderType === "int"; + const ratio = clamp((pos[0] - ds.trackLeft) / ds.trackW, 0, 1); + let v = p.sliderMin + ratio * (p.sliderMax - p.sliderMin); + v = calcValue(v, p.sliderMin, p.sliderMax, p.sliderStep, isInt); + if (g.widget) g.widget.value = v; + node.setDirtyCanvas(true, false); + return true; + } + + /* ── 仅处理左键 mousedown / pointerdown ── */ + if (event.type !== "mousedown" && event.type !== "pointerdown") return; + if (event.button !== 0) return; + + /* ── 清理可能残留的拖拽状态 ── */ + if (g._dragging) { + g._dragging = false; + if (g._docCleanup) { g._docCleanup(); g._docCleanup = null; } + } + + /* ── 左键:跳到点击位置并开始拖拽 ── */ + const isInt = p.sliderType === "int"; + const ratio = clamp((pos[0] - ds.trackLeft) / ds.trackW, 0, 1); + let v = p.sliderMin + ratio * (p.sliderMax - p.sliderMin); + v = calcValue(v, p.sliderMin, p.sliderMax, p.sliderStep, isInt); + + if (g.widget) g.widget.value = v; + node.setDirtyCanvas(true, false); + + g._dragging = true; + + /* ── document 备用监听(防止 LiteGraph 不转发后续事件时的保底) ── */ + const startCX = event.clientX; + const startVal = v; + + function onDocMove(e2) { + if (!g._dragging) return; + const dx = e2.clientX - startCX; + const scale = app.canvas.ds.scale || 1; + const graphDx = dx / scale; + const ratioD = graphDx / ds.trackW; + const valDelta = ratioD * (p.sliderMax - p.sliderMin); + let nv = startVal + valDelta; + nv = calcValue(nv, p.sliderMin, p.sliderMax, p.sliderStep, isInt); + if (g.widget) g.widget.value = nv; + node.setDirtyCanvas(true, false); + } + + function onDocUp() { + if (!g._dragging) return; + g._dragging = false; + g._docCleanup = null; + document.removeEventListener("mousemove", onDocMove); + document.removeEventListener("mouseup", onDocUp); + node.setDirtyCanvas(true, true); + } + + g._docCleanup = function () { + document.removeEventListener("mousemove", onDocMove); + document.removeEventListener("mouseup", onDocUp); + }; + document.addEventListener("mousemove", onDocMove); + document.addEventListener("mouseup", onDocUp); + + return true; + }, + + computeSize(width) { + return [width, 60]; + }, + }); + + /* 监听外部值变化 */ + const origCB = node.onWidgetChanged; + node.onWidgetChanged = function (name, value, widget) { + if (origCB) origCB.call(this, name, value, widget); + if (name === "值") updateVis(this); + }; + + /* 节点宽度 */ + node.size[0] = Math.max(node.size[0], 300); +} + +// ── 注册扩展 ──────────────────────────────── +app.registerExtension({ + name: "goohai.universal.slider", + + async beforeRegisterNodeDef(nodeType, nodeData) { + if (nodeData.name !== "GoohaiUniversalSlider") return; + + /* ── 圆角标题补丁 ── */ + if ( + typeof LGraphCanvas !== "undefined" && + LGraphCanvas.prototype.drawNode && + typeof LiteGraph !== "undefined" && + !LGraphCanvas.prototype._ghsRadiusPatched + ) { + LGraphCanvas.prototype._ghsRadiusPatched = true; + const origDrawNode = LGraphCanvas.prototype.drawNode; + LGraphCanvas.prototype.drawNode = function (node, ctx, ...args) { + if (node.type === "GoohaiUniversalSlider") { + const origR = LiteGraph.NODE_ROUND_RADIUS; + LiteGraph.NODE_ROUND_RADIUS = 8; + origDrawNode.call(this, node, ctx, ...args); + LiteGraph.NODE_ROUND_RADIUS = origR; + } else { + origDrawNode.call(this, node, ctx, ...args); + } + }; + } + + /* ── onNodeCreated ── */ + const onCreated = nodeType.prototype.onNodeCreated; + nodeType.prototype.onNodeCreated = function () { + const r = onCreated ? onCreated.apply(this, arguments) : undefined; + setupSlider(this); + return r; + }; + + /* ── configure(加载已保存的节点时恢复状态) ── */ + const onConfigure = nodeType.prototype.configure; + nodeType.prototype.configure = function (info) { + if (onConfigure) onConfigure.apply(this, arguments); + if (!this._gs) return; + const p = this.properties; + + + const w = this._gs.widget; + if (w) { + const isInt = p.sliderType === "int"; + w.value = calcValue(w.value, p.sliderMin, p.sliderMax, p.sliderStep, isInt); + } + + syncWidgetType(this); + syncOutputType(this); + updateVis(this); + }; + + /* ── 右键上下文菜单 ── */ + const origExtra = nodeType.prototype.getExtraMenuOptions; + nodeType.prototype.getExtraMenuOptions = function (canvas, options) { + let r; + try { + if (typeof origExtra === "function") { + r = origExtra.apply(this, arguments); + } + } catch (e) { + console.warn("[GoohaiSlider] getExtraMenuOptions:", e); + } + if (Array.isArray(options)) { + options.splice(0, 0, null, { + content: "🎮 孤海滑条 设置", + callback: () => showSettings(this), + }); + } + return r; + }; + }, +}); diff --git a/docs/hel-892/crop-split-reference/guhai__web__js__id_photo_clothing.js b/docs/hel-892/crop-split-reference/guhai__web__js__id_photo_clothing.js new file mode 100644 index 00000000..3863b49e --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__web__js__id_photo_clothing.js @@ -0,0 +1,755 @@ +// custom_nodes/GoohaiTools-comfyui/web/js/id_photo_clothing.js +// 证件照服装选择_孤海 —— 前端 UI 扩展 + +import { app } from "../../../scripts/app.js"; + +const NODE_NAME = "IDPhotoClothingSelector_孤海"; +const THUMB_W = 128; +const THUMB_H = 180; +const GAP = 5; +const BORDER_RADIUS = 10; +const COLS = 4; +const SCROLLBAR_EXTRA = 10; +const GALLERY_WIDTH = COLS * THUMB_W + (COLS - 1) * GAP + SCROLLBAR_EXTRA; +const BORDER_HIGHLIGHT = 3; +const SEARCH_AREA_H = 34; +const INNER_GAP = 6; +const PROMPT_TEXTAREA_H = THUMB_H - INNER_GAP - SEARCH_AREA_H; +const TOP_ROW_GAP = 15; +const BOTTOM_PAD = 20; + +let _dataCache = null; + +async function loadTemplateData() { + if (_dataCache) return _dataCache; + try { + const resp = await fetch("/goohai/id_photo_templates"); + _dataCache = await resp.json(); + } catch (e) { + console.error("[GoohaiTools] 加载模板数据失败:", e); + _dataCache = { categories: [], templates: {} }; + } + return _dataCache; +} + +// ==================== UI 辅助元素 ==================== + +function createCheckmark() { + const el = document.createElement("div"); + el.textContent = "✓"; + Object.assign(el.style, { + position: "absolute", top: "2px", right: "2px", + width: "18px", height: "18px", + background: "#4CAF50", borderRadius: "50%", + display: "flex", alignItems: "center", justifyContent: "center", + color: "#fff", fontSize: "13px", fontWeight: "bold", + zIndex: "10", pointerEvents: "none", + boxShadow: "0 1px 4px rgba(0,0,0,0.4)", + }); + return el; +} + +function createSelectedBadge() { + const el = document.createElement("div"); + el.textContent = "已选"; + Object.assign(el.style, { + position: "absolute", top: "4px", left: "4px", + padding: "2px 6px", + background: "#4CAF50", + borderRadius: "4px", + display: "flex", alignItems: "center", justifyContent: "center", + color: "#fff", fontSize: "10px", fontWeight: "bold", + zIndex: "10", pointerEvents: "none", + boxShadow: "0 1px 4px rgba(0,0,0,0.4)", + whiteSpace: "nowrap", + }); + return el; +} + +function createImageFallback(parent, title, width, height, borderRadius) { + const fb = document.createElement("div"); + Object.assign(fb.style, { + width, height, + display: "flex", alignItems: "center", justifyContent: "center", + background: "#333", color: "#999", fontSize: "11px", + padding: "4px", textAlign: "center", borderRadius, + }); + fb.textContent = title; + parent.appendChild(fb); +} + +// ==================== 注册扩展 ==================== + +app.registerExtension({ + name: "goohai.id_photo_clothing", + + async beforeRegisterNodeDef(nodeType, nodeData) { + if (nodeData.name !== NODE_NAME) return; + + const origOnCreated = nodeType.prototype.onNodeCreated; + nodeType.prototype.onNodeCreated = function () { + origOnCreated?.apply(this, arguments); + this.color = "#3a4d64"; + this.bgcolor = "#2c3849"; + this._initClothingUI(); + }; + + nodeType.prototype._initClothingUI = async function () { + const node = this; + const data = await loadTemplateData(); + + const allTemplates = data.templates; + const allCategories = data.categories; + + // ========== 状态变量 ========== + const defaultCat = allCategories[0] || ""; + let currentCategory = defaultCat; + let searchQuery = ""; + let isSearching = false; + let selectedCategory = ""; + let selectedFilename = ""; + let selectedPrompt = ""; + let _lastSyncedValue = ""; + let _lastAppliedMaxH = 0; + + // ========== 提示词输出 widget ========== + const promptWidget = node.widgets?.find(w => w.name === "提示词输出"); + if (promptWidget) { + _lastSyncedValue = promptWidget.value || ""; + } + + // ========== 挂接「风格类型」下拉回调 ========== + const catWidget = node.widgets?.find(w => w.name === "风格类型"); + if (catWidget) { + const origCb = catWidget.callback; + catWidget.callback = function (v) { + origCb?.call(this, v); + currentCategory = v; + searchQuery = ""; + isSearching = false; + searchInput.value = ""; + clearBtn.style.display = "none"; + renderGallery(); + }; + } + + // ========== 辅助函数 ========== + + function syncPrompt() { + if (promptWidget) { + promptWidget.value = selectedPrompt; + const el = promptWidget.element; + if (el) { + const ta = el.tagName === "TEXTAREA" ? el : el.querySelector?.("textarea"); + if (ta) ta.value = selectedPrompt; + } + } + promptArea.value = selectedPrompt; + _lastSyncedValue = selectedPrompt; + } + + function findTemplate(cat, fname) { + return (allTemplates[cat] || []).find(t => t.filename === fname); + } + + function saveSelectionState() { + if (!node.properties) node.properties = {}; + const actualPrompt = promptWidget ? (promptWidget.value || "") : selectedPrompt; + if (selectedFilename && selectedCategory) { + node.properties._goohai_sel = { + cat: selectedCategory, + file: selectedFilename, + curCat: currentCategory, + prompt: actualPrompt, + }; + } else { + node.properties._goohai_sel = { + _none: true, + curCat: currentCategory, + prompt: actualPrompt, + }; + } + } + + function deselectAll() { + selectedCategory = ""; + selectedFilename = ""; + selectedPrompt = ""; + syncPrompt(); + saveSelectionState(); + renderGallery(); + } + + function selectTemplate(tpl) { + selectedCategory = tpl.category; + selectedFilename = tpl.filename; + selectedPrompt = tpl.prompt || ""; + syncPrompt(); + saveSelectionState(); + renderGallery(); + } + + function buildDisplayList() { + let pool = []; + if (isSearching) { + const keywords = searchQuery + .toLowerCase() + .split(/[,,、\s;;\-_.!@#$%^&*()+=${}|\\:"'<>?\/~`]+/) + .filter(k => k.length > 0); + + for (const cat of allCategories) { + for (const tpl of (allTemplates[cat] || [])) { + const catLower = cat.toLowerCase(); + const titleLower = tpl.title.toLowerCase(); + const promptLower = tpl.prompt.toLowerCase(); + const allMatch = keywords.every(kw => + catLower.includes(kw) + || titleLower.includes(kw) + || promptLower.includes(kw) + ); + if (allMatch) { + pool.push(tpl); + } + } + } + } else { + pool = (allTemplates[currentCategory] || []).slice(); + } + + const list = []; + const sel = selectedFilename && selectedCategory + ? findTemplate(selectedCategory, selectedFilename) + : null; + + list.push(sel + ? { _kind: "first_preview", ...sel, _isSel: false, _isFirst: true } + : { _kind: "none", title: "无", prompt: "", _isSel: false, _isFirst: true } + ); + + for (const tpl of pool) { + const isSelected = !!sel + && tpl.category === selectedCategory + && tpl.filename === selectedFilename; + list.push({ _kind: "item", ...tpl, _isSel: isSelected, _isFirst: false }); + } + + return { items: list, poolCount: pool.length }; + } + + // ==================== DOM 构建 ==================== + + const container = document.createElement("div"); + Object.assign(container.style, { + width: "100%", + boxSizing: "border-box", + fontFamily: "'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif", + padding: "0px 4px 4px 4px", + }); + + // ========== 顶部横排区域:预览框(左) + 提示词/搜索(右) ========== + + const topRow = document.createElement("div"); + Object.assign(topRow.style, { + display: "flex", + flexDirection: "row", + alignItems: "flex-start", + width: "100%", + gap: `${TOP_ROW_GAP}px`, + marginBottom: "6px", + }); + + // ---- 左侧预览框 ---- + const previewBox = document.createElement("div"); + Object.assign(previewBox.style, { + width: `${THUMB_W}px`, + height: `${THUMB_H}px`, + minWidth: `${THUMB_W}px`, + boxSizing: "border-box", + border: `${BORDER_HIGHLIGHT}px solid #4CAF50`, + borderRadius: `${BORDER_RADIUS}px`, + overflow: "hidden", + position: "relative", + cursor: "pointer", + flexShrink: "0", + transition: "transform .1s", + background: "#1e1e1e", + }); + previewBox.addEventListener("mouseenter", () => { + previewBox.style.transform = "scale(1.03)"; + }); + previewBox.addEventListener("mouseleave", () => { + previewBox.style.transform = "scale(1)"; + }); + previewBox.addEventListener("click", () => deselectAll()); + topRow.appendChild(previewBox); + + // ---- 右侧列:提示词框 + 搜索框 ---- + const rightCol = document.createElement("div"); + Object.assign(rightCol.style, { + display: "flex", + flexDirection: "column", + flex: "1", + minWidth: "0", + height: `${THUMB_H}px`, + boxSizing: "border-box", + overflow: "hidden", + }); + + // ---- 提示词文本框 ---- + const promptArea = document.createElement("textarea"); + promptArea.placeholder = "服装/发型提示词:选择模板后自动填入,也可随时手动编辑..."; + Object.assign(promptArea.style, { + width: "100%", + height: `${PROMPT_TEXTAREA_H}px`, + minHeight: `${PROMPT_TEXTAREA_H}px`, + maxHeight: `${PROMPT_TEXTAREA_H}px`, + resize: "none", + background: "#222", + color: "#ddd", + border: "1px solid #444", + borderRadius: "6px", + padding: "6px 8px", + fontSize: "14px", + fontFamily: "'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif", + outline: "none", + boxSizing: "border-box", + overflow: "auto", + display: "block", + lineHeight: "1.5", + transition: "border-color .2s", + marginBottom: `${INNER_GAP}px`, + flexShrink: "0", + }); + promptArea.addEventListener("focus", () => { + promptArea.style.borderColor = "#4CAF50"; + }); + promptArea.addEventListener("blur", () => { + promptArea.style.borderColor = "#444"; + }); + promptArea.addEventListener("keydown", (e) => e.stopPropagation()); + promptArea.addEventListener("input", () => { + if (promptWidget) { + promptWidget.value = promptArea.value; + const el = promptWidget.element; + if (el) { + const ta = el.tagName === "TEXTAREA" ? el : el.querySelector?.("textarea"); + if (ta) ta.value = promptArea.value; + } + } + _lastSyncedValue = promptArea.value; + saveSelectionState(); + }); + rightCol.appendChild(promptArea); + + // ---- 搜索框 ---- + const searchWrapper = document.createElement("div"); + Object.assign(searchWrapper.style, { + position: "relative", + width: "100%", + marginBottom: "0px", + marginTop: "0px", + flexShrink: "0", + }); + + const magnifier = document.createElement("div"); + magnifier.innerHTML = ``; + Object.assign(magnifier.style, { + position: "absolute", left: "8px", top: "50%", + transform: "translateY(-50%)", + display: "flex", alignItems: "center", justifyContent: "center", + pointerEvents: "none", zIndex: "2", + }); + searchWrapper.appendChild(magnifier); + + const searchInput = document.createElement("input"); + searchInput.type = "text"; + searchInput.placeholder = "搜索模板(多个关键词用任意符号隔开,如:西装 领带 男...)"; + Object.assign(searchInput.style, { + width: "100%", + padding: "5px 26px 5px 28px", + border: "1px solid #555", borderRadius: "4px", + background: "#2a2a2a", color: "#e0e0e0", + fontSize: "12px", outline: "none", + boxSizing: "border-box", + transition: "border-color .2s", + }); + searchInput.addEventListener("focus", () => { + searchInput.style.borderColor = "#4CAF50"; + }); + searchInput.addEventListener("blur", () => { + searchInput.style.borderColor = "#555"; + }); + searchInput.addEventListener("keydown", (e) => { + e.stopPropagation(); + if (e.key === "Escape") searchInput.blur(); + }); + searchInput.addEventListener("input", () => { + searchQuery = searchInput.value.trim(); + isSearching = searchQuery.length > 0; + clearBtn.style.display = isSearching ? "flex" : "none"; + renderGallery(); + }); + searchWrapper.appendChild(searchInput); + + const clearBtn = document.createElement("div"); + clearBtn.textContent = "✕"; + Object.assign(clearBtn.style, { + position: "absolute", right: "8px", top: "50%", + transform: "translateY(-50%)", + width: "16px", height: "16px", + display: "none", alignItems: "center", justifyContent: "center", + color: "#888", fontSize: "12px", fontWeight: "bold", + cursor: "pointer", zIndex: "2", + borderRadius: "50%", + transition: "color .15s, background .15s", + }); + clearBtn.addEventListener("mouseenter", () => { + clearBtn.style.color = "#e0e0e0"; + clearBtn.style.background = "rgba(255,255,255,0.1)"; + }); + clearBtn.addEventListener("mouseleave", () => { + clearBtn.style.color = "#888"; + clearBtn.style.background = "transparent"; + }); + clearBtn.addEventListener("click", () => { + searchInput.value = ""; + searchQuery = ""; + isSearching = false; + clearBtn.style.display = "none"; + searchInput.focus(); + renderGallery(); + }); + searchWrapper.appendChild(clearBtn); + rightCol.appendChild(searchWrapper); + + topRow.appendChild(rightCol); + container.appendChild(topRow); + + // ---- 画廊网格 ---- + const gallery = document.createElement("div"); + gallery.className = "goohai-clothing-gallery"; + Object.assign(gallery.style, { + display: "grid", + gridTemplateColumns: `repeat(auto-fill, ${THUMB_W}px)`, + justifyContent: "start", + gap: `${GAP}px`, + width: "100%", + maxHeight: `${3 * THUMB_H + 2 * GAP}px`, + overflowY: "auto", + paddingRight: "2px", + scrollbarWidth: "thin", + scrollbarColor: "#555 transparent", + }); + gallery.addEventListener("wheel", (e) => e.stopPropagation()); + container.appendChild(gallery); + + const scrollStyle = document.createElement("style"); + scrollStyle.textContent = ` + .goohai-clothing-gallery::-webkit-scrollbar { width: 6px; } + .goohai-clothing-gallery::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; } + .goohai-clothing-gallery::-webkit-scrollbar-track { background: transparent; } + `; + container.appendChild(scrollStyle); + + // ==================== 渲染左侧预览框 ==================== + + function renderPreviewBox(firstItem) { + previewBox.innerHTML = ""; + const innerRadius = `${BORDER_RADIUS - BORDER_HIGHLIGHT}px`; + + if (firstItem._kind === "none") { + const placeholder = document.createElement("div"); + Object.assign(placeholder.style, { + width: "100%", height: "100%", + display: "flex", alignItems: "center", justifyContent: "center", + background: "#2d2d2d", color: "#888", fontSize: "16px", + borderRadius: innerRadius, + }); + placeholder.textContent = "无"; + previewBox.appendChild(placeholder); + previewBox.appendChild(createSelectedBadge()); + } else { + const img = document.createElement("img"); + img.src = `/goohai/id_photo_image/${encodeURIComponent(firstItem.category)}/${encodeURIComponent(firstItem.filename)}`; + Object.assign(img.style, { + width: "100%", height: "100%", + objectFit: "cover", display: "block", + borderRadius: innerRadius, + }); + img.onerror = function () { + this.style.display = "none"; + createImageFallback(previewBox, firstItem.title, "100%", "100%", innerRadius); + }; + previewBox.appendChild(img); + previewBox.appendChild(createSelectedBadge()); + } + + previewBox.title = firstItem.prompt || firstItem.title || ""; + } + + // ==================== 渲染画廊 ==================== + + function renderGallery() { + gallery.innerHTML = ""; + const { items, poolCount } = buildDisplayList(); + + renderPreviewBox(items[0]); + + for (let i = 1; i < items.length; i++) { + const item = items[i]; + const showBorder = item._isSel; + const cardRadius = showBorder + ? `${BORDER_RADIUS - BORDER_HIGHLIGHT}px` + : `${BORDER_RADIUS}px`; + + const card = document.createElement("div"); + Object.assign(card.style, { + position: "relative", cursor: "pointer", + width: `${THUMB_W}px`, + height: `${THUMB_H}px`, + border: showBorder + ? `${BORDER_HIGHLIGHT}px solid #4CAF50` + : `1px solid transparent`, + borderRadius: `${BORDER_RADIUS}px`, + overflow: "hidden", + transition: "border-color .15s, transform .1s", + background: "#1e1e1e", + flexShrink: "0", + }); + card.addEventListener("mouseenter", () => { + card.style.transform = "scale(1.03)"; + }); + card.addEventListener("mouseleave", () => { + card.style.transform = "scale(1)"; + }); + + const img = document.createElement("img"); + img.src = `/goohai/id_photo_image/${encodeURIComponent(item.category)}/${encodeURIComponent(item.filename)}`; + Object.assign(img.style, { + width: `${THUMB_W}px`, + height: `${THUMB_H}px`, + objectFit: "cover", + display: "block", + borderRadius: cardRadius, + }); + img.loading = "lazy"; + img.onerror = function () { + this.style.display = "none"; + createImageFallback(card, item.title, `${THUMB_W}px`, `${THUMB_H}px`, cardRadius); + }; + card.appendChild(img); + + const label = document.createElement("div"); + Object.assign(label.style, { + position: "absolute", bottom: "0", left: "0", right: "0", + background: "linear-gradient(transparent, rgba(0,0,0,0.8))", + color: "#e0e0e0", fontSize: "10px", + padding: "8px 4px 3px", textAlign: "center", + whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", + borderRadius: `0 0 ${BORDER_RADIUS}px ${BORDER_RADIUS}px`, + }); + label.textContent = item.title; + card.appendChild(label); + + if (isSearching && item._kind === "item") { + const badge = document.createElement("div"); + Object.assign(badge.style, { + position: "absolute", top: "2px", left: "2px", + background: "rgba(0,0,0,0.7)", color: "#aaa", + fontSize: "9px", padding: "1px 4px", borderRadius: "2px", + }); + badge.textContent = item.category; + card.appendChild(badge); + } + + card.title = item.prompt || item.title; + + if (item._isSel) { + card.appendChild(createCheckmark()); + card.addEventListener("click", deselectAll); + } else { + card.addEventListener("click", () => selectTemplate(item)); + } + + gallery.appendChild(card); + } + + if (isSearching && poolCount === 0) { + const noResult = document.createElement("div"); + Object.assign(noResult.style, { + gridColumn: "1 / -1", textAlign: "center", + color: "#666", padding: "16px", fontSize: "12px", + }); + noResult.textContent = "未找到匹配的模板"; + gallery.appendChild(noResult); + } + } + + // ==================== 添加 DOM Widget ==================== + + const galleryWidget = node.addDOMWidget("clothing_gallery", "div", container, { + serialize: false, + hideOnZoom: false, + }); + + galleryWidget.computeSize = () => [0, 0]; + + if (promptWidget) { + promptWidget.computeSize = () => [0, 0]; + if (promptWidget.element) { + promptWidget.element.style.display = "none"; + } + } + + // ==================== 画廊高度自适应 ==================== + + function getLayoutMetrics() { + const TITLE_H = (typeof LiteGraph !== 'undefined' && LiteGraph.NODE_TITLE_HEIGHT) || 30; + const SLOT_H = (typeof LiteGraph !== 'undefined' && LiteGraph.NODE_SLOT_HEIGHT) || 20; + return { TITLE_H, SLOT_H }; + } + + function getContainerFixedOverhead() { + return 8 + THUMB_H + 6; + } + + function updateGalleryHeight() { + const { TITLE_H, SLOT_H } = getLayoutMetrics(); + const nodeH = node.size[1]; + if (!nodeH || nodeH <= 0) return; + + const catH = SLOT_H; + const avail = nodeH - TITLE_H - catH - getContainerFixedOverhead() - BOTTOM_PAD; + const minH = THUMB_H + GAP; + const maxH = Math.max(minH, avail); + + if (Math.abs(maxH - _lastAppliedMaxH) < 1) return; + _lastAppliedMaxH = maxH; + + gallery.style.maxHeight = maxH + "px"; + } + + const origOnResize = node.onResize; + node.onResize = function (size) { + if (origOnResize) origOnResize.call(node, size); + requestAnimationFrame(updateGalleryHeight); + }; + + const _pollId = setInterval(() => { + if (!node.graph) { clearInterval(_pollId); return; } + updateGalleryHeight(); + }, 200); + + // ==================== 同步外部值变化 ==================== + + const _syncPollId = setInterval(() => { + if (!node.graph) { clearInterval(_syncPollId); return; } + const current = promptWidget?.value || ""; + if (current !== _lastSyncedValue) { + _lastSyncedValue = current; + promptArea.value = current; + selectedPrompt = current; + saveSelectionState(); + } + }, 300); + + // ==================== 节点移除时清理定时器 ==================== + + const origOnRemoved = node.onRemoved; + node.onRemoved = function () { + clearInterval(_pollId); + clearInterval(_syncPollId); + origOnRemoved?.apply(this, arguments); + }; + + // ==================== 状态恢复 ==================== + + function tryLegacyRestore() { + const saved = promptWidget?.value || ""; + if (!saved) return false; + + for (const cat of allCategories) { + const tpl = (allTemplates[cat] || []).find(t => t.prompt === saved); + if (tpl) { + selectedCategory = cat; + selectedFilename = tpl.filename; + selectedPrompt = tpl.prompt; + currentCategory = cat; + if (catWidget) catWidget.value = cat; + promptArea.value = selectedPrompt; + _lastSyncedValue = selectedPrompt; + saveSelectionState(); + renderGallery(); + return true; + } + } + return false; + } + + function restoreState() { + const state = node.properties?._goohai_sel; + if (!state) return tryLegacyRestore(); + + // 恢复当前浏览分类 + if (state.curCat && allCategories.includes(state.curCat)) { + currentCategory = state.curCat; + if (catWidget) catWidget.value = currentCategory; + } + + // 无选择状态 + if (state._none) { + selectedCategory = ""; + selectedFilename = ""; + selectedPrompt = state.prompt ?? ""; + syncPrompt(); + renderGallery(); + return true; + } + + // 恢复模板选择 + if (state.cat && state.file) { + const tpl = findTemplate(state.cat, state.file); + if (tpl) { + selectedCategory = tpl.category; + selectedFilename = tpl.filename; + selectedPrompt = state.prompt ?? (tpl.prompt || ""); + syncPrompt(); + renderGallery(); + return true; + } + } + + return tryLegacyRestore(); + } + + // ==================== 初始渲染 ==================== + + if (!restoreState()) { + const defaultList = allTemplates[defaultCat] || []; + if (defaultList.length > 0) { + selectedCategory = defaultCat; + const idx = Math.min(4, defaultList.length - 1); + selectedFilename = defaultList[idx].filename; + selectedPrompt = defaultList[idx].prompt; + } + syncPrompt(); + saveSelectionState(); + } + + renderGallery(); + + // 首次打开时固定节点大小 + setTimeout(() => { + const { TITLE_H, SLOT_H } = getLayoutMetrics(); + const defaultGalleryH = 3 * THUMB_H + 2 * GAP; + const nodeSize = node.computeSize(); + const targetW = Math.max(nodeSize[0], GALLERY_WIDTH + 40); + const targetH = TITLE_H + SLOT_H + getContainerFixedOverhead() + defaultGalleryH + BOTTOM_PAD; + + gallery.style.maxHeight = defaultGalleryH + "px"; + node.setSize([targetW, targetH]); + updateGalleryHeight(); + }, 100); + }; + }, +}); diff --git a/docs/hel-892/crop-split-reference/guhai__web__js__nodes pass.js b/docs/hel-892/crop-split-reference/guhai__web__js__nodes pass.js new file mode 100644 index 00000000..0fa99eba --- /dev/null +++ b/docs/hel-892/crop-split-reference/guhai__web__js__nodes pass.js @@ -0,0 +1,908 @@ +import { app } from "../../../scripts/app.js"; + +app.registerExtension({ + name: "goohaitools.ignore_groups", + + async beforeRegisterNodeDef(nodeType, nodeData) { + if (nodeData.name !== "忽略多组孤海") return; + + const origCreated = nodeType.prototype.onNodeCreated; + nodeType.prototype.onNodeCreated = function () { + origCreated?.apply(this, arguments); + this.size = [400, this.size[1]]; + buildIgnoreGroupsUI(this); + }; + + const origConfigure = nodeType.prototype.onConfigure; + nodeType.prototype.onConfigure = function (info) { + origConfigure?.apply(this, arguments); + if (this._guhaiSyncGroups) this._guhaiSyncGroups(); + }; + + /* 右键上下文菜单 */ + const origGetExtra = nodeType.prototype.getExtraMenuOptions; + nodeType.prototype.getExtraMenuOptions = function (canvas, options) { + if (origGetExtra) origGetExtra.apply(this, arguments); + options.unshift({ + content: "🎮 忽略多组_孤海 设置", + callback: () => { + if (this._guhaiShowSettings) { + this._guhaiShowSettings( + Math.round(innerWidth / 2 - 130), + Math.round(innerHeight / 2 - 200) + ); + } + } + }); + }; + }, +}); + + +function buildIgnoreGroupsUI(node) { + + /* ═══════════════════ 状态 ═══════════════════ */ + let filter = ""; + let mode = "default"; + let active = null; + let activeSet = null; + let nameColor = null; + let igDisable = false; + let selfChanging = false; + let dirty = true; + + if (node.properties) { + if (node.properties.guhai_ig_filter != null) filter = node.properties.guhai_ig_filter; + if (node.properties.guhai_ig_mode != null) mode = node.properties.guhai_ig_mode; + if (node.properties.guhai_ig_active != null) active = node.properties.guhai_ig_active; + if (node.properties.guhai_ig_active_set != null) activeSet = node.properties.guhai_ig_active_set; + if (node.properties.guhai_ig_name_color != null) nameColor = node.properties.guhai_ig_name_color; + if (node.properties.guhai_ig_disable != null) igDisable = !!node.properties.guhai_ig_disable; + } + + function save() { + node.properties = node.properties || {}; + node.properties.guhai_ig_filter = filter; + node.properties.guhai_ig_mode = mode; + node.properties.guhai_ig_active = active; + node.properties.guhai_ig_active_set = activeSet; + node.properties.guhai_ig_name_color = nameColor; + node.properties.guhai_ig_disable = igDisable; + } + + + /* ═══════════════════ Canvas 布局常量 ═══════════════════ */ + const HEADER_H = 14; + const ROW_H = 34; + const ROW_GAP = 15; + const PAD_X = 16; + const ROW_PAD_L = 26; + const ROW_PAD_R = 16; + const TOGGLE_W = 67; + const TOGGLE_H = 26; + const KNOB_R = 11; + + + /* ═══════════════════ 几何工具 ═══════════════════ */ + function gBounds(g) { + if (g._bounding) return [...g._bounding]; + if (g.bounding) return [...g.bounding]; + const p = g.pos || [0, 0], s = g.size || [0, 0]; + return [p[0], p[1], s[0], s[1]]; + } + + function nBounds(n) { + const p = n.pos || [0, 0], s = n.size || [100, 60]; + return [p[0], p[1], s[0], s[1]]; + } + + function hit(a, b) { + return !(a[0] + a[2] <= b[0] || a[0] >= b[0] + b[2] || + a[1] + a[3] <= b[1] || a[1] >= b[1] + b[3]); + } + + function inside(inner, outer) { + return inner[0] >= outer[0] && inner[1] >= outer[1] && + inner[0] + inner[2] <= outer[0] + outer[2] && + inner[1] + inner[3] <= outer[1] + outer[3]; + } + + + /* ═══════════════════ 组数据 ═══════════════════ */ + function rawGroups() { + const g = app.graph; + if (!g || !g._groups) return []; + return g._groups.map(gr => ({ + title: (gr.title || "").trim() || "Unnamed", + bounds: gBounds(gr), + ref: gr, + })); + } + + function visible() { + let list = rawGroups(); + if (filter.trim()) { + const kw = filter.trim().toLowerCase(); + list = list.filter(g => g.title.toLowerCase().includes(kw)); + } + list.sort((a, b) => + a.title.localeCompare(b.title, undefined, { sensitivity: "base" }) + ); + return list; + } + + function collectNodes(grp) { + const g = app.graph; + if (!g || !g._nodes) return []; + const all = rawGroups(); + const pb = grp.bounds; + const rects = [pb]; + all.forEach(ag => { + if (ag.ref !== grp.ref && inside(ag.bounds, pb)) { + rects.push(ag.bounds); + } + }); + return g._nodes.filter(n => { + const nb = nBounds(n); + return rects.some(r => hit(nb, r)); + }); + } + + + /* 递归获取所有完全嵌套的子组 */ + function getAllNestedGroups(parentGroup) { + const all = rawGroups(); + const result = []; + const visited = new Set(); + visited.add(parentGroup.ref); + + function findNested(parent) { + all.forEach(ag => { + if (!visited.has(ag.ref) && inside(ag.bounds, parent.bounds)) { + visited.add(ag.ref); + result.push(ag); + findNested(ag); + } + }); + } + + findNested(parentGroup); + return result; + } + + + /* ═══════════════════ 旁路 / 恢复 ═══════════════════ */ + function bypassGroup(grp) { + collectNodes(grp).forEach(n => { + if (igDisable) { + n.mode = 2; + } else { + n.mode = 4; + } + }); + } + + function restoreGroup(grp) { + collectNodes(grp).forEach(n => { + n.mode = 0; + if (n.flags) n.flags.disabled = false; + }); + } + + function isNodeActive(n) { + return n.mode !== 4 && n.mode !== 2 && !n.flags?.disabled; + } + + + /* ═══════════════════ 组状态检测与外部同步 ═══════════════════ */ + + + function getGroupState(grp) { + const nodes = collectNodes(grp); + if (nodes.length === 0) return true; + const allActive = nodes.every(n => isNodeActive(n)); + const allInactive = nodes.every(n => !isNodeActive(n)); + if (allActive) return true; + if (allInactive) return false; + return null; + } + + /* 计算所有组状态签名(用于检测外部变化) */ + function computeStateSig(list) { + return list.map(g => { + const s = getGroupState(g); + return g.title + ":" + (s === true ? "1" : s === false ? "0" : "m"); + }).join("\x00"); + } + + /* 将外部操作引起的节点状态变化同步到 activeSet / active */ + function syncExternalState() { + const list = visible(); + let changed = false; + + if (mode === "default") { + if (!Array.isArray(activeSet)) return; + list.forEach(g => { + const gs = getGroupState(g); + const isActive = activeSet.includes(g.title); + if (gs === true && !isActive) { + /* 全部激活 → 开关打开 */ + activeSet.push(g.title); + changed = true; + } else if (gs === false && isActive) { + /* 全部绕过/禁用 → 开关关闭 */ + activeSet = activeSet.filter(t => t !== g.title); + changed = true; + } + /* 混合状态 → 保持当前开关不变 */ + }); + } else if (mode === "at_most_one") { + /* at_most_one:仅处理"关闭"方向 */ + if (active) { + const grp = list.find(g => g.title === active); + if (grp && getGroupState(grp) === false) { + active = null; + changed = true; + } + } + } + /* always_one:不做自动同步,避免违反"始终开启1个"约束 */ + + if (changed) save(); + } + + + /* ═══════════════════ Canvas 绘图辅助 ═══════════════════ */ + + function rrect(ctx, x, y, w, h, r) { + ctx.beginPath(); + ctx.moveTo(x + r, y); + ctx.arcTo(x + w, y, x + w, y + h, r); + ctx.arcTo(x + w, y + h, x, y + h, r); + ctx.arcTo(x, y + h, x, y, r); + ctx.arcTo(x, y, x + w, y, r); + ctx.closePath(); + } + + function ellipsis(ctx, text, maxW) { + if (ctx.measureText(text).width <= maxW) return text; + let t = text; + while (t.length > 1 && ctx.measureText(t + "…").width > maxW) { + t = t.slice(0, -1); + } + return t + "…"; + } + + function hexToRgba(hex, alpha) { + if (!hex || hex.length < 7) return `rgba(120,120,120,${alpha})`; + const r = parseInt(hex.slice(1, 3), 16); + const g = parseInt(hex.slice(3, 5), 16); + const b = parseInt(hex.slice(5, 7), 16); + return `rgba(${r},${g},${b},${alpha})`; + } + + function drawGear(ctx, cx, cy, r) { + const teeth = 8; + const outerR = r; + const innerR = r * 0.65; + const holeR = r * 0.3; + const step = (Math.PI * 2) / teeth; + const q = step * 0.25; + + ctx.save(); + ctx.beginPath(); + for (let i = 0; i < teeth; i++) { + const a = i * step - Math.PI / 2; + if (i === 0) { + ctx.moveTo(cx + outerR * Math.cos(a - q), cy + outerR * Math.sin(a - q)); + } else { + ctx.lineTo(cx + outerR * Math.cos(a - q), cy + outerR * Math.sin(a - q)); + } + ctx.lineTo(cx + outerR * Math.cos(a + q), cy + outerR * Math.sin(a + q)); + const va = a + step / 2; + ctx.lineTo(cx + innerR * Math.cos(va - q), cy + innerR * Math.sin(va - q)); + ctx.lineTo(cx + innerR * Math.cos(va + q), cy + innerR * Math.sin(va + q)); + } + ctx.closePath(); + ctx.fillStyle = "rgba(120,120,120,0.15)"; + ctx.fill(); + ctx.strokeStyle = "rgba(120,120,120,0.4)"; + ctx.lineWidth = 1.2; + ctx.stroke(); + + ctx.beginPath(); + ctx.arc(cx, cy, holeR, 0, Math.PI * 2); + ctx.fillStyle = "#2a2a2a"; + ctx.fill(); + ctx.strokeStyle = "rgba(153,153,153,0.6)"; + ctx.lineWidth = 1; + ctx.stroke(); + ctx.restore(); + } + + + /* ═══════════════════ 核心刷新 ═══════════════════ */ + let lastSig = ""; + let lastStateSig = ""; + + function refresh(forceApply) { + const list = visible(); + const sig = list.map(g => g.title).join("\x00"); + const listChanged = (sig !== lastSig); + lastSig = sig; + + let stateChanged = false; + + if (mode === "default") { + if (!Array.isArray(activeSet)) { + /* 首次加载/复位时,根据每个组的实际节点状态来决定开关 */ + activeSet = []; + list.forEach(g => { + const gs = getGroupState(g); + if (gs !== false) { + + activeSet.push(g.title); + } + + }); + stateChanged = true; + } else { + const titles = new Set(list.map(g => g.title)); + const before = activeSet.length; + activeSet = activeSet.filter(t => titles.has(t)); + if (activeSet.length !== before) stateChanged = true; + } + } else { + if (active && !list.find(g => g.title === active)) { + active = (mode === "always_one" && list.length) ? list[0].title : null; + stateChanged = true; + } + if (mode === "always_one" && !active && list.length) { + active = list[0].title; + stateChanged = true; + } + } + + if (stateChanged) save(); + + if (forceApply || stateChanged || listChanged) { + selfChanging = true; + try { + list.forEach(g => { + let isOn; + if (mode === "default") { + isOn = activeSet.includes(g.title); + } else { + isOn = (g.title === active); + } + if (isOn) restoreGroup(g); + else bypassGroup(g); + }); + try { app.graph.change(); } catch (_) { /* ignore */ } + } finally { + selfChanging = false; + } + } + } + + + /* ═══════════════════ 切换逻辑 ═══════════════════ */ + function handleToggle(title) { + if (mode === "default") { + if (!Array.isArray(activeSet)) activeSet = []; + + const list = visible(); + const grp = list.find(g => g.title === title); + const idx = activeSet.indexOf(title); + const turnOn = idx < 0; + + if (turnOn) { + if (!activeSet.includes(title)) activeSet.push(title); + if (grp) { + getAllNestedGroups(grp).forEach(ng => { + if (!activeSet.includes(ng.title)) activeSet.push(ng.title); + }); + } + } else { + const offSet = new Set(); + offSet.add(title); + if (grp) { + getAllNestedGroups(grp).forEach(ng => offSet.add(ng.title)); + } + activeSet = activeSet.filter(t => !offSet.has(t)); + } + } else if (mode === "always_one") { + if (active === title) return; + active = title; + } else { + if (active === title) { + active = null; + } else { + active = title; + } + } + save(); + refresh(true); + } + + + /* ═══════════════════ 选项设置 ═══════════════════ */ + function showSettings(x, y) { + const old = document.getElementById("guhai_ig_pop"); + if (old) old.remove(); + + const pop = document.createElement("div"); + pop.id = "guhai_ig_pop"; + Object.assign(pop.style, { + position: "fixed", + left: Math.min(x, innerWidth - 280) + "px", + top: Math.min(y, innerHeight - 460) + "px", + background: "#2a2a2a", + border: "1px solid #555", + borderRadius: "8px", + padding: "14px 18px", + zIndex: "99999", + minWidth: "250px", + boxShadow: "0 4px 24px rgba(0,0,0,0.6)", + color: "#e0e0e0", + fontFamily: "inherit", + }); + + /* ── 标题 ── */ + const titleEl = document.createElement("div"); + titleEl.textContent = "🎮 忽略多组_孤海 设置"; + Object.assign(titleEl.style, { + fontSize: "15px", fontWeight: "bold", marginBottom: "14px", + color: "#e0e0e0", + borderBottom: "1px solid #444", paddingBottom: "8px", + }); + pop.appendChild(titleEl); + + /* ── 关闭方式(绕过 / 禁用)── */ + const dLabel = document.createElement("div"); + dLabel.textContent = "路由控制"; + Object.assign(dLabel.style, { + fontSize: "13px", fontWeight: "bold", marginBottom: "6px", + }); + pop.appendChild(dLabel); + + const dRow = document.createElement("div"); + Object.assign(dRow.style, { + display: "flex", alignItems: "center", gap: "20px", + marginBottom: "14px", + }); + + const dRadioBypass = document.createElement("input"); + dRadioBypass.type = "radio"; + dRadioBypass.name = "guhai_ig_close_mode"; + dRadioBypass.value = "bypass"; + dRadioBypass.checked = !igDisable; + dRadioBypass.style.cursor = "pointer"; + + const dLblBypass = document.createElement("label"); + dLblBypass.style.cursor = "pointer"; + dLblBypass.style.fontSize = "13px"; + dLblBypass.appendChild(dRadioBypass); + dLblBypass.appendChild(document.createTextNode(" 绕过(ctrl+b)")); + + const dRadioDisable = document.createElement("input"); + dRadioDisable.type = "radio"; + dRadioDisable.name = "guhai_ig_close_mode"; + dRadioDisable.value = "disable"; + dRadioDisable.checked = !!igDisable; + dRadioDisable.style.cursor = "pointer"; + + const dLblDisable = document.createElement("label"); + dLblDisable.style.cursor = "pointer"; + dLblDisable.style.fontSize = "13px"; + dLblDisable.appendChild(dRadioDisable); + dLblDisable.appendChild(document.createTextNode(" 禁用(ctrl+m)")); + + dRow.appendChild(dLblBypass); + dRow.appendChild(dLblDisable); + pop.appendChild(dRow); + + /* ── 筛选关键词 ── */ + const fLabel = document.createElement("div"); + fLabel.textContent = "筛选关键词"; + Object.assign(fLabel.style, { + fontSize: "13px", fontWeight: "bold", marginBottom: "4px", + }); + pop.appendChild(fLabel); + + const fInput = document.createElement("input"); + fInput.type = "text"; + fInput.value = filter; + fInput.placeholder = "留空 = 显示所有组"; + Object.assign(fInput.style, { + width: "100%", padding: "5px 8px", fontSize: "13px", + background: "#1a1a1a", border: "1px solid #555", borderRadius: "4px", + color: "#e0e0e0", outline: "none", boxSizing: "border-box", + marginBottom: "14px", + }); + pop.appendChild(fInput); + + /* ── 切换模式 ── */ + const mLabel = document.createElement("div"); + mLabel.textContent = "切换模式"; + Object.assign(mLabel.style, { + fontSize: "13px", fontWeight: "bold", marginBottom: "4px", + }); + pop.appendChild(mLabel); + + const mSelect = document.createElement("select"); + Object.assign(mSelect.style, { + width: "100%", padding: "5px 8px", fontSize: "13px", + background: "#1a1a1a", border: "1px solid #555", borderRadius: "4px", + color: "#e0e0e0", outline: "none", boxSizing: "border-box", + marginBottom: "14px", + }); + [ + ["default", "默认"], + ["always_one", "始终开启1个"], + ["at_most_one", "最多开启1个"], + ].forEach(([val, txt]) => { + const opt = document.createElement("option"); + opt.value = val; + opt.textContent = txt; + mSelect.appendChild(opt); + }); + mSelect.value = mode; + pop.appendChild(mSelect); + + /* ── 主题颜色 ── */ + const cLabel = document.createElement("div"); + cLabel.textContent = "主题颜色"; + Object.assign(cLabel.style, { + fontSize: "13px", fontWeight: "bold", marginBottom: "4px", + }); + pop.appendChild(cLabel); + + const colorRow = document.createElement("div"); + Object.assign(colorRow.style, { + display: "flex", alignItems: "center", gap: "8px", + marginBottom: "16px", + }); + + const cInput = document.createElement("input"); + cInput.type = "color"; + cInput.value = nameColor || "#ac8686"; + Object.assign(cInput.style, { + width: "36px", height: "28px", padding: "0", + border: "1px solid #555", borderRadius: "4px", + background: "#1a1a1a", cursor: "pointer", + }); + colorRow.appendChild(cInput); + + const cHex = document.createElement("input"); + cHex.type = "text"; + cHex.value = nameColor || "#ac8686"; + Object.assign(cHex.style, { + flex: "1", padding: "5px 8px", fontSize: "13px", + background: "#1a1a1a", border: "1px solid #555", borderRadius: "4px", + color: "#e0e0e0", outline: "none", boxSizing: "border-box", + }); + colorRow.appendChild(cHex); + + cInput.addEventListener("input", () => { cHex.value = cInput.value; }); + cHex.addEventListener("input", () => { + if (/^#[0-9a-fA-F]{6}$/.test(cHex.value)) cInput.value = cHex.value; + }); + pop.appendChild(colorRow); + + /* ── 按钮 ── */ + const btnRow = document.createElement("div"); + Object.assign(btnRow.style, { + display: "flex", justifyContent: "flex-end", gap: "8px", + }); + + function makeBtn(text, bg, onClick) { + const btn = document.createElement("button"); + btn.textContent = text; + Object.assign(btn.style, { + padding: "6px 22px", fontSize: "15.6px", background: bg, + border: "none", borderRadius: "4px", color: "#fff", + cursor: "pointer", + }); + btn.addEventListener("click", onClick); + return btn; + } + + btnRow.appendChild(makeBtn("取消", "#606060", () => pop.remove())); + btnRow.appendChild(makeBtn("应用", "#4CAF50", () => { + filter = fInput.value; + const newMode = mSelect.value; + nameColor = cInput.value || null; + igDisable = dRadioDisable.checked; + + if (newMode !== mode) { + if (newMode === "default") { + activeSet = visible().map(g => g.title); + } else if (newMode === "always_one") { + const list = visible(); + if (activeSet && activeSet.length) { + active = activeSet[0]; + } else if (list.length) { + active = list[0].title; + } else { + active = null; + } + activeSet = null; + } else { + const list = visible(); + if (activeSet && activeSet.length) { + active = activeSet[0]; + } else if (mode === "always_one" && active) { + /* keep */ + } else { + active = null; + } + activeSet = null; + } + mode = newMode; + } else { + mode = newMode; + if (mode === "always_one" && !active) { + const list = visible(); + if (list.length) active = list[0].title; + } + } + + save(); + refresh(true); + pop.remove(); + })); + pop.appendChild(btnRow); + + document.body.appendChild(pop); + fInput.focus(); + + setTimeout(() => { + const handler = (e) => { + if (!pop.contains(e.target)) { + pop.remove(); + document.removeEventListener("mousedown", handler); + } + }; + document.addEventListener("mousedown", handler); + }, 50); + + pop.addEventListener("contextmenu", (e) => { + e.preventDefault(); + e.stopPropagation(); + }); + } + + node._guhaiShowSettings = showSettings; + + + /* ═══════════════════ Canvas 自定义 Widget ═══════════════════ */ + let _w = 400, _y = 0; + + node.addCustomWidget({ + name: "guhai_ig", + type: "ig_custom", + + /* ── 每帧绘制 ── */ + draw(ctx, node, widgetWidth, y, H) { + _w = widgetWidth; + _y = y; + + const gearCX = widgetWidth - 18; + const gearCY = y + HEADER_H / 2; + drawGear(ctx, gearCX, gearCY, 5); + + const list = visible(); + + if (!list.length) { + ctx.font = "13px sans-serif"; + ctx.fillStyle = "#888"; + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + ctx.fillText( + filter.trim() ? "无匹配的组" : "工作流中无编组", + widgetWidth / 2, + y + HEADER_H + 20 + ); + return; + } + + const effectiveColor = nameColor || "#ac8686"; + + list.forEach((g, i) => { + const rowX = PAD_X; + const rowY = y + HEADER_H + i * (ROW_H + ROW_GAP); + const rowW = widgetWidth - PAD_X * 2; + const isOn = mode === "default" + ? activeSet.includes(g.title) + : g.title === active; + + /* 胶囊背景填充 */ + rrect(ctx, rowX, rowY, rowW, ROW_H, ROW_H / 2); + ctx.fillStyle = "#2B2F38"; + ctx.fill(); + + /* 胶囊边框描边 */ + rrect(ctx, rowX, rowY, rowW, ROW_H, ROW_H / 2); + ctx.strokeStyle = "#6E7581"; + ctx.lineWidth = 1; + ctx.stroke(); + + /* 开关轨道 —— 颜色由主题色控制 */ + const tx = rowX + rowW - ROW_PAD_R - TOGGLE_W; + const ty = rowY + (ROW_H - TOGGLE_H) / 2; + + ctx.save(); + if (isOn) { + ctx.shadowColor = hexToRgba(effectiveColor, 0.35); + ctx.shadowBlur = 10; + ctx.fillStyle = effectiveColor; + } else { + ctx.shadowColor = "transparent"; + ctx.shadowBlur = 0; + ctx.fillStyle = "#606060"; + } + rrect(ctx, tx, ty, TOGGLE_W, TOGGLE_H, TOGGLE_H / 2); + ctx.fill(); + ctx.restore(); + + /* 旋钮 */ + const kx = isOn ? tx + TOGGLE_W - KNOB_R - 3 : tx + KNOB_R + 3; + const ky = ty + TOGGLE_H / 2; + + ctx.save(); + ctx.shadowColor = "rgba(0,0,0,0.3)"; + ctx.shadowBlur = 4; + ctx.fillStyle = isOn ? "rgb(230,230,230)" : "rgb(128,128,128)"; + ctx.beginPath(); + ctx.arc(kx, ky, KNOB_R, 0, Math.PI * 2); + ctx.fill(); + ctx.restore(); + + /* 标签文字 */ + const textX = rowX + ROW_PAD_L; + const maxTextW = tx - textX - 10; + ctx.save(); + ctx.globalAlpha = isOn ? 1.0 : 0.5; + ctx.font = "bold 20px sans-serif"; + ctx.fillStyle = effectiveColor; + ctx.textAlign = "left"; + ctx.textBaseline = "middle"; + ctx.fillText( + ellipsis(ctx, g.title, maxTextW), + textX, + rowY + ROW_H / 2 + ); + ctx.restore(); + }); + }, + + /* ── 鼠标事件 ── */ + mouse(event, pos, node) { + if (event.type !== "pointerdown" && event.type !== "mousedown") { + return false; + } + + const localX = pos[0]; + const localY = pos[1] - _y; + + const gearCX = _w - 18; + const gearCY = HEADER_H / 2; + const gdx = localX - gearCX; + const gdy = localY - gearCY; + if (gdx * gdx + gdy * gdy < 7 * 7) { + showSettings(event.clientX, event.clientY); + return true; + } + + const list = visible(); + for (let i = 0; i < list.length; i++) { + const rowX = PAD_X; + const rowY = HEADER_H + i * (ROW_H + ROW_GAP); + const rowW = _w - PAD_X * 2; + + if (localX >= rowX && localX <= rowX + rowW && + localY >= rowY && localY <= rowY + ROW_H) { + handleToggle(list[i].title); + return true; + } + } + + return false; + }, + + computeSize(width) { + const cnt = Math.max(visible().length, 1); + return [400, HEADER_H + cnt * (ROW_H + ROW_GAP) - ROW_GAP + 10]; + }, + }); + + + /* ═══════════════════ 脏标记系统 ═══════════════════ */ + if (app.graph && typeof app.graph.change === "function") { + const origGraphChange = app.graph.change; + app.graph.change = function () { + if (!selfChanging) dirty = true; + return origGraphChange.apply(this, arguments); + }; + } + + function onKeyDown(e) { + if ((e.ctrlKey || e.metaKey) && + (e.key === "m" || e.key === "b" || e.key === "M" || e.key === "B")) { + setTimeout(() => { dirty = true; }, 100); + } + } + document.addEventListener("keydown", onKeyDown); + + + /* ═══════════════════ 定时同步 ═══════════════════ */ + let pageVisible = !document.hidden; + function onVisibilityChange() { + const nowVisible = !document.hidden; + if (nowVisible && !pageVisible) { + pageVisible = true; + dirty = true; + } else { + pageVisible = nowVisible; + } + } + document.addEventListener("visibilitychange", onVisibilityChange); + + const timer = setInterval(() => { + if (!node.graph) { + clearInterval(timer); + document.removeEventListener("visibilitychange", onVisibilityChange); + document.removeEventListener("keydown", onKeyDown); + return; + } + + if (!pageVisible || !dirty) return; + dirty = false; + + const list = visible(); + + const sig = list.map(g => g.title).join("\x00"); + const listChanged = (sig !== lastSig); + const stateSig = computeStateSig(list); + const stateChanged = (stateSig !== lastStateSig); + + if (listChanged || stateChanged) { + lastStateSig = stateSig; + + selfChanging = true; + try { + /* 同步外部状态变化到 activeSet / active */ + syncExternalState(); + /* 组列表变化时执行完整刷新(应用旁路/恢复) */ + if (listChanged) { + refresh(false); + } + try { app.graph.change(); } catch (_) {} + } finally { + selfChanging = false; + } + } + }, 500); + + + /* ═══════════════════ 工作流加载后同步 ═══════════════════ */ + node._guhaiSyncGroups = () => { + filter = (node.properties && node.properties.guhai_ig_filter) || ""; + mode = (node.properties && node.properties.guhai_ig_mode) || "default"; + active = (node.properties && node.properties.guhai_ig_active) || null; + activeSet = (node.properties && node.properties.guhai_ig_active_set) || null; + nameColor = (node.properties && node.properties.guhai_ig_name_color) || null; + igDisable = (node.properties && node.properties.guhai_ig_disable) || false; + lastSig = ""; + lastStateSig = ""; + dirty = true; + refresh(true); + }; + + + /* ═══════════════════ 初始构建 ═══════════════════ */ + refresh(false); + lastStateSig = computeStateSig(visible()); + dirty = false; +} diff --git a/docs/hel-892/crop-split-reference/sources.json b/docs/hel-892/crop-split-reference/sources.json new file mode 100644 index 00000000..2c381686 --- /dev/null +++ b/docs/hel-892/crop-split-reference/sources.json @@ -0,0 +1,360 @@ +{ + "sources": [ + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:__init__.py", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "__init__.py", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/__init__.py", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/__init__.py", + "local_file": "guhai____init__.py", + "sha256": "6b820d7452bd1ef0c0eabee0a8bfe73e9bf570cf4796a8d7d993b15ca020a952", + "retrieved_at": "2026-10-29T19:37:03.242554+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 49 + ] + ], + "rule_locations": { + "WEB_DIRECTORY": [ + 10, + 11 + ], + "dynamic_module_discovery": [ + 17, + 28 + ], + "registration_merge": [ + 30, + 44 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:extension.json", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "extension.json", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/extension.json", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/extension.json", + "local_file": "guhai__extension.json", + "sha256": "4275682d89ac4bf3b09ba235c6be7e4a201a2cdef2d5a3e7d01e344a8ed835f9", + "retrieved_at": "2026-10-29T19:37:03.634229+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 37 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 37 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:nodes/自动分割图像.py", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "nodes/自动分割图像.py", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/nodes/%E8%87%AA%E5%8A%A8%E5%88%86%E5%89%B2%E5%9B%BE%E5%83%8F.py", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/nodes/%E8%87%AA%E5%8A%A8%E5%88%86%E5%89%B2%E5%9B%BE%E5%83%8F.py", + "local_file": "guhai__nodes__自动分割图像.py", + "sha256": "0889d9fe46fcfd6692bcfbd3b2c54dcdc06c7e0095352d3482b4794d22df8260", + "retrieved_at": "2026-10-29T19:37:04.046841+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 172 + ] + ], + "rule_locations": { + "crop_algorithm": [ + 8, + 52 + ], + "return_types": [ + 54, + 58 + ], + "schema": [ + 60, + 73 + ], + "first_input_batch_only": [ + 80, + 83 + ], + "grid_and_directory": [ + 85, + 99 + ], + "format_and_counter": [ + 101, + 119 + ], + "tile_trim_write_return": [ + 121, + 163 + ], + "registration": [ + 165, + 172 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:web/js/BOOLEAN.js", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "web/js/BOOLEAN.js", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/BOOLEAN.js", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/BOOLEAN.js", + "local_file": "guhai__web__js__BOOLEAN.js", + "sha256": "184ddb889362c770eff98bba23579b35e24c3a4dd684b97bfc588f42dfbe6d64", + "retrieved_at": "2026-10-29T19:37:04.457911+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 230 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 230 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:web/js/GoohaiNote.js", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "web/js/GoohaiNote.js", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/GoohaiNote.js", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/GoohaiNote.js", + "local_file": "guhai__web__js__GoohaiNote.js", + "sha256": "5fb1f66f76e5519990afd400f315e209fdc36ed05beb1a8a56348d4830a47ae9", + "retrieved_at": "2026-10-29T19:37:04.907463+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 930 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 930 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:web/js/colorWidget.js", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "web/js/colorWidget.js", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/colorWidget.js", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/colorWidget.js", + "local_file": "guhai__web__js__colorWidget.js", + "sha256": "7e1e02baa9ab773bdbb9247925fec87a07b5309ce1ef35dfdfdec15c5b2eef26", + "retrieved_at": "2026-10-29T19:37:05.306831+00:00", + "license": "GPL-3.0 inline notice credits AILab/1038lab; repository-wide license unknown", + "lines": [ + [ + 1, + 126 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 126 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:web/js/goohai_universal_slider.js", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "web/js/goohai_universal_slider.js", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/goohai_universal_slider.js", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/goohai_universal_slider.js", + "local_file": "guhai__web__js__goohai_universal_slider.js", + "sha256": "e93df36fcf4ecd0d4eb264518582da4cfb4df25ae915c796bb9cb749731f8f7e", + "retrieved_at": "2026-10-29T19:37:05.726329+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 615 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 615 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:web/js/id_photo_clothing.js", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "web/js/id_photo_clothing.js", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/id_photo_clothing.js", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/id_photo_clothing.js", + "local_file": "guhai__web__js__id_photo_clothing.js", + "sha256": "11e6ccd015b17dd5c6ca2010829075372b751b898d21e3f61abe347c4f51d144", + "retrieved_at": "2026-10-29T19:37:06.134916+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 755 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 755 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:web/js/nodes pass.js", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "web/js/nodes pass.js", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/nodes%20pass.js", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/web/js/nodes%20pass.js", + "local_file": "guhai__web__js__nodes pass.js", + "sha256": "17ab7504fef7aaaa2e3cf72028eaa5d9aa1e6688ba75fe434fc8f40e11d27130", + "retrieved_at": "2026-10-29T19:37:06.533673+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 908 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 908 + ] + } + }, + { + "id": "goohai/Goohaitools-comfyui@885cac3dd323d26a77b69ae904a9a344f0dee7d0:README.md", + "repository": "https://github.com/goohai/Goohaitools-comfyui", + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "file": "README.md", + "url": "https://github.com/goohai/Goohaitools-comfyui/blob/885cac3dd323d26a77b69ae904a9a344f0dee7d0/README.md", + "raw_url": "https://raw.githubusercontent.com/goohai/Goohaitools-comfyui/885cac3dd323d26a77b69ae904a9a344f0dee7d0/README.md", + "local_file": "guhai__README.md", + "sha256": "634b819891c824e2086d9249dcf7421bcb33ca0a84737e825e4f2807fa440d0a", + "retrieved_at": "2026-10-29T19:37:06.929256+00:00", + "license": "unknown; no LICENSE in fixed tree", + "lines": [ + [ + 1, + 1 + ] + ], + "rule_locations": { + "full_fixed_source": [ + 1, + 1 + ] + } + }, + { + "id": "christian-byrne/audio-separation-nodes-comfyui@5291831d7c321ab7a5192374482f9848dffee75b:src/crop.py", + "repository": "https://github.com/christian-byrne/audio-separation-nodes-comfyui", + "commit": "5291831d7c321ab7a5192374482f9848dffee75b", + "file": "src/crop.py", + "url": "https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/src/crop.py", + "raw_url": "https://raw.githubusercontent.com/christian-byrne/audio-separation-nodes-comfyui/5291831d7c321ab7a5192374482f9848dffee75b/src/crop.py", + "local_file": "crop.py", + "sha256": "a2ac02bd7b42efd6de665c51edd7c698bb3ba97939574a9e06a99917a614f56c", + "retrieved_at": "2026-10-29T19:38:20.080852+00:00", + "license": "unknown; LICENSE referenced but absent at fixed commit/package", + "lines": [ + [ + 1, + 77 + ] + ], + "rule_locations": { + "schema": [ + 8, + 26 + ], + "return_types": [ + 28, + 31 + ], + "parse_slice": [ + 44, + 77 + ] + } + }, + { + "id": "Comfy-Org/ComfyUI_frontend@4bf6a1960028cc5cda57d48f9fb01a74dfaade43:src/renderer/extensions/vueNodes/widgets/composables/useStringWidget.ts", + "repository": "https://github.com/Comfy-Org/ComfyUI_frontend", + "commit": "4bf6a1960028cc5cda57d48f9fb01a74dfaade43", + "file": "src/renderer/extensions/vueNodes/widgets/composables/useStringWidget.ts", + "url": "https://github.com/Comfy-Org/ComfyUI_frontend/blob/4bf6a1960028cc5cda57d48f9fb01a74dfaade43/src/renderer/extensions/vueNodes/widgets/composables/useStringWidget.ts", + "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/4bf6a1960028cc5cda57d48f9fb01a74dfaade43/src/renderer/extensions/vueNodes/widgets/composables/useStringWidget.ts", + "local_file": "useStringWidget.ts", + "sha256": "b734a2584d558de501150e8011e1c16031f33778c2cd3b4c712f296ce4f05396", + "retrieved_at": "2026-10-29T19:38:44.535452+00:00", + "license": "GPL-3.0; reuse pinned frontend LICENSE in serialization-evidence", + "lines": [ + [ + 1, + 137 + ] + ], + "rule_locations": { + "STRING_constructor": [ + 110, + 137 + ] + } + }, + { + "id": "Comfy-Org/ComfyUI_frontend@4bf6a1960028cc5cda57d48f9fb01a74dfaade43:src/renderer/extensions/vueNodes/widgets/composables/useBooleanWidget.ts", + "repository": "https://github.com/Comfy-Org/ComfyUI_frontend", + "commit": "4bf6a1960028cc5cda57d48f9fb01a74dfaade43", + "file": "src/renderer/extensions/vueNodes/widgets/composables/useBooleanWidget.ts", + "url": "https://github.com/Comfy-Org/ComfyUI_frontend/blob/4bf6a1960028cc5cda57d48f9fb01a74dfaade43/src/renderer/extensions/vueNodes/widgets/composables/useBooleanWidget.ts", + "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/4bf6a1960028cc5cda57d48f9fb01a74dfaade43/src/renderer/extensions/vueNodes/widgets/composables/useBooleanWidget.ts", + "local_file": "useBooleanWidget.ts", + "sha256": "36f477f75561e0c7bfc2c6757906724f8ff2c8660ace26759f3f07493877fece", + "retrieved_at": "2026-10-29T19:38:44.933154+00:00", + "license": "GPL-3.0; reuse pinned frontend LICENSE in serialization-evidence", + "lines": [ + [ + 1, + 31 + ] + ], + "rule_locations": { + "BOOLEAN_constructor": [ + 6, + 31 + ] + } + } + ] +} diff --git a/docs/hel-892/crop-split-reference/useBooleanWidget.ts b/docs/hel-892/crop-split-reference/useBooleanWidget.ts new file mode 100644 index 00000000..242afe54 --- /dev/null +++ b/docs/hel-892/crop-split-reference/useBooleanWidget.ts @@ -0,0 +1,31 @@ +import type { LGraphNode } from '@/lib/litegraph/src/litegraph' +import { isBooleanInputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2' +import type { InputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2' +import type { ComfyWidgetConstructorV2 } from '@/scripts/widgets' + +export const useBooleanWidget = () => { + const widgetConstructor: ComfyWidgetConstructorV2 = ( + node: LGraphNode, + inputSpec: InputSpec + ) => { + if (!isBooleanInputSpec(inputSpec)) { + throw new Error(`Invalid input data: ${inputSpec}`) + } + + const defaultVal = inputSpec.default ?? false + const options = { + on: inputSpec.label_on, + off: inputSpec.label_off + } + + return node.addWidget( + 'toggle', + inputSpec.name, + defaultVal, + () => {}, + options + ) + } + + return widgetConstructor +} diff --git a/docs/hel-892/crop-split-reference/useStringWidget.ts b/docs/hel-892/crop-split-reference/useStringWidget.ts new file mode 100644 index 00000000..1ace7e9e --- /dev/null +++ b/docs/hel-892/crop-split-reference/useStringWidget.ts @@ -0,0 +1,137 @@ +import type { LGraphNode } from '@/lib/litegraph/src/litegraph' +import { useSettingStore } from '@/platform/settings/settingStore' +import { isStringInputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2' +import type { InputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2' +import { app } from '@/scripts/app' +import type { ComfyWidgetConstructorV2 } from '@/scripts/widgets' + +const TRACKPAD_DETECTION_THRESHOLD = 50 + +function addMultilineWidget( + node: LGraphNode, + name: string, + opts: { defaultVal: string; placeholder?: string } +) { + const inputEl = document.createElement('textarea') + inputEl.className = 'comfy-multiline-input' + inputEl.value = opts.defaultVal + inputEl.placeholder = opts.placeholder || name + inputEl.spellcheck = useSettingStore().get('Comfy.TextareaWidget.Spellcheck') + + const widget = node.addDOMWidget(name, 'customtext', inputEl, { + getValue(): string { + return inputEl.value + }, + setValue(v: string) { + inputEl.value = v + } + }) + + widget.inputEl = inputEl + widget.options.minNodeSize = [400, 200] + + inputEl.addEventListener('input', () => { + widget.callback?.(widget.value) + }) + + // Allow middle mouse button panning + inputEl.addEventListener('pointerdown', (event: PointerEvent) => { + if (event.button === 1) { + app.canvas.processMouseDown(event) + } + }) + + inputEl.addEventListener('pointermove', (event: PointerEvent) => { + if ((event.buttons & 4) === 4) { + app.canvas.processMouseMove(event) + } + }) + + inputEl.addEventListener('pointerup', (event: PointerEvent) => { + if (event.button === 1) { + app.canvas.processMouseUp(event) + } + }) + + inputEl.addEventListener('wheel', (event: WheelEvent) => { + const gesturesEnabled = useSettingStore().get( + 'LiteGraph.Pointer.TrackpadGestures' + ) + const deltaX = event.deltaX + const deltaY = event.deltaY + + const canScrollY = inputEl.scrollHeight > inputEl.clientHeight + const isHorizontal = Math.abs(deltaX) > Math.abs(deltaY) + + // Prevent pinch zoom from zooming the page + if (event.ctrlKey) { + event.preventDefault() + event.stopPropagation() + app.canvas.processMouseWheel(event) + return + } + + // Detect if this is likely a trackpad gesture vs mouse wheel + // Trackpads usually have deltaX or smaller deltaY values (< TRACKPAD_DETECTION_THRESHOLD) + // Mouse wheels typically have larger discrete deltaY values (>= TRACKPAD_DETECTION_THRESHOLD) + const isLikelyTrackpad = + Math.abs(deltaX) > 0 || Math.abs(deltaY) < TRACKPAD_DETECTION_THRESHOLD + + // Trackpad gestures: when enabled, trackpad panning goes to canvas + if (gesturesEnabled && isLikelyTrackpad) { + event.preventDefault() + event.stopPropagation() + app.canvas.processMouseWheel(event) + return + } + + // When gestures disabled: horizontal always goes to canvas (no horizontal scroll in textarea) + if (isHorizontal) { + event.preventDefault() + event.stopPropagation() + app.canvas.processMouseWheel(event) + return + } + + // Vertical scrolling when gestures disabled: let textarea scroll if scrollable + if (canScrollY) { + event.stopPropagation() + return + } + + // If textarea can't scroll vertically, pass to canvas + event.preventDefault() + app.canvas.processMouseWheel(event) + }) + + return widget +} + +export const useStringWidget = () => { + const widgetConstructor: ComfyWidgetConstructorV2 = ( + node: LGraphNode, + inputSpec: InputSpec + ) => { + if (!isStringInputSpec(inputSpec)) { + throw new Error(`Invalid input data: ${inputSpec}`) + } + + const defaultVal = inputSpec.default ?? '' + const multiline = inputSpec.multiline + + const widget = multiline + ? addMultilineWidget(node, inputSpec.name, { + defaultVal, + placeholder: inputSpec.placeholder + }) + : node.addWidget('text', inputSpec.name, defaultVal, () => {}, {}) + + if (typeof inputSpec.dynamicPrompts === 'boolean') { + widget.dynamicPrompts = inputSpec.dynamicPrompts + } + + return widget + } + + return widgetConstructor +} diff --git a/docs/hel-892/crop-split-reference/verified-facts.json b/docs/hel-892/crop-split-reference/verified-facts.json new file mode 100644 index 00000000..1a911b6a --- /dev/null +++ b/docs/hel-892/crop-split-reference/verified-facts.json @@ -0,0 +1,19 @@ +{ + "crop_registry_member": "src/crop.py", + "crop_registry_bytes_match": true, + "registry_package_sha256": "0d39cf047e26f2d5fa08c64561af06d5479278eef15d773a38573a28e398d8c4", + "registry_commit_binding": "unknown; not exposed by API", + "guhai_tree_commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "guhai_license": "unknown; no LICENSE in full fixed tree", + "no_fonts_or_models_fetched": true, + "guhai_discovery": { + "commit": "885cac3dd323d26a77b69ae904a9a344f0dee7d0", + "url": "https://api.github.com/repos/goohai/Goohaitools-comfyui/git/trees/885cac3dd323d26a77b69ae904a9a344f0dee7d0?recursive=1", + "sha256": "570d35a60ce093d2a62d4a6d4575af4e51d577948207cb82963a302a721dcff4", + "local_file": "guhai-tree.json", + "retrieved_at": "2026-10-29T19:36:44.945789+00:00", + "license": "API tree metadata; repository-wide source license unknown", + "tree_truncated": false, + "font_blob_content_fetched": false + } +}