ZML_XY_LoRA加载器
Test N LoRAs across M weights in one grid — ZML_XY_LoRA加载器
- 模型
- CLIP
- 模型
- CLIP
- 图表信息
ZML_XY_LoRA加载器 is the pack's answer to "which LoRA, at what strength?" It loads several LoRAs from a folder, sweeps each across a range of weights, and outputs the whole matrix as model-list outputs plus a ZML_GRID_INFO payload that tells a grid-drawer node how to label the results. You render once and get the full comparison table.
The mechanism is the interesting part, because it's not just "load a list." You give it a LoRA文件夹路径 (the default E:\Models\Loras is a leftover from the author's own Windows machine - change it), LoRA数量 (how many files to take from the folder, sorted), LoRA权重数量, 权重起始值, and 权重结束值. It linearly interpolates the weights between start and end, then cross-products: N LoRAs × M weights = N×M model outputs, each a freshly-patched model. CLIP is optional - if you connect it, LoRA patches flow to both; if not, it patches the model alone.
The 无LoRA对比 toggle is a genuinely nice touch. Turn it on and it adds one un-LoRA'd baseline image to the grid - but only one, even when there are multiple weight steps, because it reuses the baseline cell instead of wasting a render. The tooltip spells out the math: with 3 LoRAs × 2 weights you get 6 LoRA images + 1 baseline = 7 cells. XY互换 just flips which axis is the LoRA list and which is the weights.
Outputs: 模型 (MODEL list), CLIP (CLIP list), and 图表信息 (the ZML_GRID_INFO object). The first two feed a sampler (each entry renders once - ComfyUI's list semantics, same pattern as ZML_文本列表); the third feeds ZML_XY_图表拼接 (Grid Drawer), which reads the labels and titles and draws the labeled grid for you. That's the whole loop: loader → sampler → grid drawer.
Installing it
Ships in ComfyUI-ZML-Image. ComfyUI Manager → ComfyUI-ZML-Image, or:
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image
Restart. No extra downloads beyond the pack - the heavy lifting uses ComfyUI's own LoRA loader machinery. Chinese UI; English patch at https://github.com/zml-w/ZZZ_ZML_English_Patch.
Common issues
The E:\Models\Loras default is the first thing that bites anyone not on the author's PC - set LoRA文件夹路径 to a real folder or the loader silently ends up with an empty list (the code falls back to a single None entry, which just renders the unpatched model). Only .safetensors, .pt, and .ckpt count, and files are taken in sorted order - so LoRA数量 3 means "first three alphabetically," which may not be the three you meant. Name your files deliberately.
Two more honest notes. First, every weight × LoRA pair is a full model patch, and the model gets cached only by file - the author's code caches the loaded .safetensors between cells, so a 10×5 grid doesn't re-read the same file 50 times. Good. Second, this is the V1 loader; the V2 and V3 variants add per-LoRA txt prompts and a fixed+variable prompt system respectively. If you're starting fresh, it's worth reading those pages before committing - V1 is the no-frills baseline, and the newer ones fold prompt testing into the same grid.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| 模型 | MODEL | — | |
| LoRA文件夹路径 | STRING | E:\Models\Loras | — |
| LoRA数量 | INT | 3 | — |
| LoRA权重数量 | INT | 2 | — |
| 权重起始值 | FLOAT | 0.80-10–10 | — |
| 权重结束值 | FLOAT | 1.00-10–10 | — |
| 无LoRA对比 | BOOLEAN | false | 开启后,会额外跑一次没有LoRA的图,多个权重时不会重复生成无LoRA的图。比如LoRA数量3,权重数量2,那就是2*3=6次有LoRA图,无LoRA的图跑一次,剩下的一个通过复制图像来生成。总共跑2*3+1=7张图。 |
| XY互换 | BOOLEAN | false | — |
| CLIPopt | CLIP | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 模型 | MODEL | — |
| CLIP | CLIP | — |
| 图表信息 | ZML_GRID_INFO | — |