Nodes/ComfyUI-ZML-Image/ZML_变量_图像输入
ComfyUI Node

ZML_变量_图像输入

Feed an actual image into each parallel subworkflow run

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_变量_图像输入
  • 图像
  • 输入变量包
  • 输出变量包
占位符图像

Most of the ZML parallel-variable nodes pass numbers and text into subworkflow runs. This one passes a real image. ZML_变量_图像输入 takes whatever IMAGE tensor you connect - a loaded reference, a generated batch, a frame - wraps it into the variable bundle, and the container substitutes it into the {{占位符}} spot of your API JSON.

The source reveals the one thing to know before you use it: unlike the text and int nodes, which build a list from many lines or a sequence, this node stuffs the input into a single-element list. So a connected batch of images becomes... one bundle entry holding that batch. Every run of the container gets the same image unless you're iterating the batch some other way. The image-folder sibling node (ZML_ParallelVariableImageFolder) is the one that fans a collection of images across runs - this node is for injecting one specific image.

What to set

  • 图像 - IMAGE input. Connect your loader, preview, or sampler output here.
  • 占位符 - STRING, default 图像. The {{name}} marker in your JSON template.
  • 输入变量包 (optional) - merge onto an existing bundle.

Output: 输出变量包 (VAR_BUNDLE). Downstream in the sub-workflow JSON, the ZML_SubflowLoadImage node is how the injected value gets turned back into a proper IMAGE (and MASK) inside the container - it accepts either a tensor directly or a string path, so your template's image slot should reference the placeholder.

When it's worth it

Honestly, narrower than the text/int versions. Its real job is letting one parallel container run the same image-processing task several times - same reference, different API parameters from a text or float list - without loading the image inside each sub-workflow. That's exactly the "32 threads watermarking images" example in the README, where each thread needs the same source image plus its own settings. If you want each run to get a different image from a folder, use the image-folder variable node instead; if you need per-run images and per-run values, wire both into the same bundle.

Install

Part of the ComfyUI-ZML-Image pack (160+ nodes, one install). ComfyUI Manager → search ComfyUI-ZML-Image, or:

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

Restart and you're set. No model files, no extra dependencies for this node - the pack's requirements.txt is the usual torch/numpy/Pillow stack. English users should install the README's translation patch (ZZZ_ZML_English_Patch); the UI is Chinese-first. Start from the shipped 多线程子工作流.json example before building your own JSON template - it shows the placeholder syntax ({{变量名}}) done right, which is the part most people get wrong on the first try.

Categoryimage/ZML_图像/子工作流

Inputs (3)

NameTypeDefaultDescription
图像IMAGE
占位符STRING图像
输入变量包optVAR_BUNDLE

Outputs (1)

NameTypeDescription
输出变量包VAR_BUNDLE