$ show zml-w/ComfyUI-ZML-Image
ComfyUI-ZML-Image is a feature-rich ComfyUI custom node pack (application) providing 160+ nodes with the ZML_ prefix for AI image/video generation workflows. The Python backend (zml_w/*.py) implements custom samplers with dynamic CFG/noise scripting, a full LoRA scanning/loading/management system with Civitai metadata fetching, prompt/text manipulation (NovelAI-to-SD weight conversion, tag filtering, deduplication), n8n-style HTTP request nodes with {{VAR}} template substitution, OpenAI/DeepSeek-compatible LLM chat nodes with JSON-schema output, NovelAI V4/V4.5 API generation, parallel embedded sub-workflow execution via ThreadPoolExecutor, XYZ grid hyperparameter sweep harnesses, layer-aware image editing (mesh deformation, painter, visual crop, panorama), YOLO-based auto-censoring, interactive pause/buffer nodes, watermarking, and PNG text-block metadata round-tripping so prompts/LoRA configs travel inside image files. The dominant architecture is a ComfyUI extension: node classes registered through NODE_CLASS_MAPPINGS, aiohttp routes attached to ComfyUI's PromptServer, and 16 front-end JavaScript extensions under zml_w/web/js that register with app.registerExtension to add custom DOM widgets, modals, and editors (PIXI.js deform editor, Three.js panorama, Cropper.js/Fabric.js painters). Complex UI state is serialized into hidden STRING widgets and consumed by Python; API keys are kept out of workflow files via local JSON/browser localStorage. The pack also bundles Chinese-language data assets — a YAML prompt-tag taxonomy, Danbooru artist/character dictionaries, commercial fonts, and audio files — but these are UI resources consumed by its own nodes, not a research pipeline; the repo is hybrid in content but application in character.
The LLM identified 4 files worth highlighting for reuse:
Executes embedded API-style ComfyUI JSON workflows inside a single node using a ThreadPoolExecutor, with typed variable bundles (text/int/float/seed/image-folder/any), lazy-evaluation gating, cache/VRAM cleanup on completion, and export/import of the nested workflow definition. This nested-execution-with-isolation pattern is non-obvious and could be extracted as a general 'run an embedded workflow fragment' service; the introspection-based node invocation is brittle against ComfyUI changes, but the variable-bundle composition and cleanup design are the genuinely reusable parts.
ZML_SaveImage/ZML_LoadImage embed and read arbitrary structured JSON (the 'comfy_text_block' chunk) in PNG files, enabling prompts, LoRA settings, and style recipes to survive inside generated images without leaking into shared workflow JSON. The PNG chunk read/write logic is compact, self-contained, and could be lifted into any project needing portable image-borne metadata — a clean solution to the prompt-invisibility problem that most ComfyUI save nodes ignore.
An n8n-inspired HTTP request suite: request-builder UI with cURL import, {{VAR}} template substitution resolved against upstream variable bundles, browser/workflow variable scoping, and image-to-Base64 conversion for API payloads. The variable-bundle merge and template-substitution engine is a workflow-automation primitive that generalizes beyond image generation and could be extracted into any ComfyUI or generic DAG context.
XYZ grid nodes for sweeping LoRA weights, prompts, and sampler parameters, connected by a custom ZML_GRID_INFO pass-type that carries layout metadata to a grid drawer supporting multi-image cells and text-wrapped axis labels. This is a well-scoped pattern for building sweep/compare harnesses over batch workflows, and the grid-info channel design is reusable wherever batch results need layout-aware assembly.