ZML_预设分辨率V2
The resolution preset that also lets you type your own
- 宽
- 高
- latent
The V2 of ZML_预设分辨率 adds exactly one thing to the original, and it's the thing you were missing: a "自定义" (custom) preset plus explicit width and height fields. V1 gives you a dropdown of baked-in SDXL sizes and nothing else. V2 gives you the dropdown and the freedom to type 1344x768 because your model wants it and it's not in the list.
Everything else is inherited from V1. Same text-file preset source (zml_w/txt/Preset integer/Preset integer.txt, W,H or Name_W,H per line, # for comments), same latent generation - a zero-filled [batch, 4, H//8, W//8] tensor sized to the chosen resolution - same swap/random/batch options, same three outputs. The practical difference: when you select 自定义, the two new fields define the size; when you pick a named preset, they're ignored. You get both worlds in one node.
The controls that matter
- 预设 - dropdown, 24 options: 自定义 plus the SDXL spread.
- 自定义宽 / 自定义高 - INT, 64–16384, step 8, default 1024 each. Only used when 自定义 is selected. The step-8 constraint keeps you on the multiples diffusion models actually want - don't fight it, just live in the 8s.
- 互换宽高 / 随机模式 / 批次数量 - same as V1. Note random mode draws from the named presets; the custom values participate via the swap toggle, not the random picker.
Outputs: 宽, 高, latent (LATENT).
When V2 beats V1
If your daily driver is SDXL or Wan at the stock sizes, V1 is fine. The moment you're on a model with an odd native resolution - or you're testing "does my model like 1000x1312 or 992x1312" - V2 is the one you want, because 自定义 makes it a proper resolution primitive you can drive from other nodes. The step-8 lock is actually doing you a favor; the KB's plumbing essay notes the whole value-node genre exists to stop you retyping the same number in five places, and this node is that idea with a dropdown bolted on.
The familiar caveats apply: the UI is Chinese-first (grab the README's translation patch), the pack is one person maintaining 160+ nodes so anything odd goes on the GitHub issues page, and if your custom values don't "stick," check you actually selected 自定义 in the dropdown - it's a two-step thing that people miss once.
Install
Same pack as everything else here. ComfyUI Manager → search ComfyUI-ZML-Image, or:
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image
restart. No model downloads, no new dependencies - this node rides on the base torch/Pillow stack ComfyUI already has.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| 预设 | COMBO | 自定义 | 24 options: 自定义, SDXL_768x1344, SDXL_768x1280, SDXL_832x1216, SDXL_832x1152, SDXL_896x1152, +18 |
| 互换宽高opt | BOOLEAN | false | — |
| 随机模式opt | BOOLEAN | false | — |
| 自定义宽opt | INT | 102464–16384 | — |
| 自定义高opt | INT | 102464–16384 | — |
| 批次数量opt | INT | 11–100 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 宽 | INT | — |
| 高 | INT | — |
| latent | LATENT | — |