📐 尺寸选择器
Pick a resolution preset, get a ready latent — but mind the channel count
- 宽
- 高
- 潜在
- 宽度
- 高度
- 帧数
MuyeSizeSelector is the "stop typing the same resolutions over and over" node. It bundles two jobs that normally live in different places: a resolution picker and a latent generator. You choose a 分辨率预设 from 44 common sizes - everything from 3840×2160 down to 512×512, across 16:9, 9:16, 7:4, 4:3, 3:2, 2:3 and 1:1 - and it outputs 宽度 and 高度 as INTs plus a ready-made 潜在 (LATENT) you can feed straight to your sampler, same shape as ComfyUI's Empty Latent Image. The README sums up the priority ordering as: width/height inputs > 长边覆盖 (long-edge override) > 分辨率预设. So:
- Connect the optional 宽 and 高 ports and they win outright.
- Otherwise set a 长边覆盖 (max long edge) and optionally a 比例覆盖 - a ratio string like
3:2,2.39/1, or even2 3(it's forgiving about separators) - and the node solves the other dimension for you. This is the mode for "I want 1024 on the long edge, 2:3." - Otherwise it just uses the preset as-is.
Three more knobs complete it: 批次大小 (batch), 帧数 (frames, for video - the latent takes a video shape when set), and 因数 which rounds width and height up to a multiple of that number (8 is the classic for latent-friendly sizes). There's also a hard cap at 8192 so a typo can't OOM you.
The trap: 16 latent channels
Here's the thing the README doesn't shout about. The generated latent is always built with 16 channels, and spatial dimensions are divided by 8. That's the Flux-class convention (16-channel VAE, 8× compression). If you're using a Flux model, great - this latent is correct and it replaces Empty Latent Image entirely. If you're on SD 1.5 or SDXL, those models want a 4-channel latent, and feeding this one a 16-channel tensor will fail or produce garbage. For those models, ignore the 潜在 output and use the 宽度/高度 INTs to feed your own Empty Latent Image - you still get the resolution convenience without the channel mismatch. This is the single thing that makes people think the node is broken when it isn't.
Install
ComfyUI Manager → search "muye" → install "ComfyUI-Muye-nodes", restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/muyexiuluo/ComfyUI-Muye-nodes
cd ComfyUI-Muye-nodes
pip install -r requirements.txt
then restart. It uses torch only. The README's manual block references an older ComfyUI_Muye.git URL; use the -nodes one above. Display name is 📐 尺寸选择器, labels are Chinese (分辨率预设 = presets, 长边覆盖 = long-edge, 比例覆盖 = ratio, 因数 = factor). If the node's missing, check the console for [Muye] Failed to load module.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| 分辨率预设 | COMBO | 832x1216 - 2:3 | 44 options: 3840x2160 - 16:9, 2160x3840 - 9:16, 2560x1440 - 16:9, 1440x2560 - 9:16, 2304x1280 - 16:9, 1280x2304 - 9:16, +38 |
| 批次大小 | INT | 11–4096 | — |
| 长边覆盖 | INT | 00–8192 | — |
| 比例覆盖 | STRING | 无 | — |
| 帧数 | INT | 00–1024 | — |
| 因数 | INT | 00–64 | — |
| 宽opt | * | — | |
| 高opt | * | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| 潜在 | LATENT | — |
| 宽度 | INT | — |
| 高度 | INT | — |
| 帧数 | INT | — |