ZML_CLIP文本编码
The CLIP encoder that remembers your prompt (for metadata)
- clip
- 条件
This is a stock CLIP Text Encode with one extra trick: it remembers the exact prompt you typed and stuffs it into the conditioning. That matters because the whole ZML pack is built around "文本块" - text chunks - and its own samplers can pull that prompt back out and write it into the saved image's metadata. Use the ZML_K sampler with this node and your PNGs carry the full prompt, no separate text-block node required.
How it works
Look at the source and it's just the standard dance, then a backdoor. It tokenizes the text, runs clip.encode_from_tokens, and returns the conditioning the normal way - but it also appends "zml_text": text to the conditioning's metadata dictionary. When the ZML sampler later saves the image, it reads that field and writes the prompt into the PNG text chunks. That's the whole node: the same output as the core encoder, plus a hidden label.
One detail worth knowing: the conditioning output is completely standard CONDITIONING, so if you wire this into a stock KSampler instead of a ZML one, the extra field is just ignored. You lose the metadata magic but nothing breaks. It's a drop-in replacement that only pays off when paired with the pack's sampler.
The inputs that matter
- clip - your CLIP model, same as any text encode node.
- text - the prompt, multiline. The author's tooltip is blunt about why it exists: type your prompt here and the ZML_K sampler automatically reads it and injects it into the generated image's metadata. It also supports dynamic prompts, so
{red|blue}style wildcards work if you have the dynamic prompts extension.
The single output, 条件 (CONDITIONING), feeds straight into your sampler's positive or negative input - make two of these nodes, one for each.
Installing
The whole pack comes from one repo:
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image
Then restart ComfyUI. ComfyUI Manager can also install it - search "ComfyUI-ZML-Image" or "ZML". If you're not a Chinese reader, grab the translation patch from https://github.com/zml-w/ZZZ_ZML_English_Patch, because every node in the pack (including this one) ships with Chinese labels. The pack's requirements.txt pulls in torch, torchvision, Pillow, opencv-python, scipy, requests and friends; most of that is already in a normal ComfyUI install, so nothing heavy downloads just for this node.
Where people get burned
The node lives in 图像/ZML_图像/采样器相关 in the node menu, which is easy to miss. And remember: the metadata injection only happens if the downstream sampler is a ZML one - the author ships several, and the ZML_CLIP文本编码 → ZML_K采样器 pairing is the intended path. It's a one-author pack with 160+ nodes and the README openly admits that the nodes the author uses daily are polished while the rest may have bugs. This one is part of the core save-prompt workflow, so it's about as battle-tested as anything in the pack gets.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| text | STRING | 在此输入提示词,ZML_K采样器会自动读取提示词并注入到生成的元数据中。 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 条件 | CONDITIONING | — |