Nodes/ComfyUI-ZML-Image/ZML_标签化图像加载器V2
ComfyUI Node

ZML_标签化图像加载器V2

The image picker with a real UI, renamed and grown

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_标签化图像加载器V2
    • 图像
    • 文本块
    模式选择
    根目录路径
    selected_files_json{"path": "", "files": []}

    This node used to be called "load image from path v2," and then the author renamed it to 标签化图像加载器V2 - "tagged image loader V2" - because the point isn't really the path loading anymore. It's the UI. V1 of the path loader is a text box with index modes; V2 opens a visual picker in the node so you can click through thumbnails, browse subfolders, and select images by eye instead of by index number. The UI is inspired by the "WeiLin" prompt-tag pack, per the README, and it shows.

    Mechanically it's a frontend-backed node: the Python side exposes API routes (/zml/v2/list_images, /zml/v2/view_thumb, plus more) that list a directory and stream thumbnails to the browser. Your selections end up serialized into a widget called selected_files_json - a JSON blob of {"path": ..., "files": [...]}. The three inputs are:

    • 模式 (mode) - 选择 (select, the UI picker) or 随机 (random, one random image from the folder).
    • 根目录路径 (root path) - the folder to browse. Absolute path; the API resolves it against the ComfyUI root if relative.
    • selected_files_json - the hidden-in-plain-sight state. You can hand-edit it, but normally the UI writes it when you click.

    Outputs are just 图像 (the chosen images, as a list) and 文本块 (the ZML text blocks from those files, joined with blank lines). That's it - deliberately slimmer than V1 because the selection logic moved into the UI.

    Why use this over V1? If you have a folder with hundreds of images and you need to choose which ones load (by looking at them, not by counting), V2 is far better. The README notes the key difference in the author's own words: V1 "doesn't support previewing subfolders," whereas V2 shows thumbnails and lets you navigate. It also reads the pack's text blocks automatically, so your "image + prompt" pairs come back together - that's the core ZML workflow of saving prompts inside images and retrieving them.

    The catches. 随机 mode returns NaN for IS_CHANGED, so it forces a rerun every time - fine for random, but it means the node is always "dirty" in the graph. And because selection state lives in selected_files_json, a workflow saved and reopened restores your picks - which is a feature until it's a stale surprise: if you move the files on disk, the JSON still points at the old names and the loader silently skips missing files, possibly returning a 64×64 black placeholder instead of an error. If you see that, re-pick in the UI or check the path.

    Install is pack-standard:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-ZML-Image
    

    or via Manager, then restart. It sits under ZML 图像 → 工具. The UI is Chinese (English patch available). For a "batch of images I want to pick through visually, with their prompts attached" workflow, this is one of the more pleasant nodes in the whole pack - and it's the kind of thing you either love or ignore entirely.

    Categoryimage/ZML_图像/工具

    Inputs (3)

    NameTypeDefaultDescription
    模式COMBO选择2 options: 选择, 随机
    根目录路径STRING
    selected_files_jsonSTRING{"path": "", "files": []}

    Outputs (2)

    NameTypeDescription
    图像IMAGE
    文本块STRING