Drag Resolution (WepeNerd)
Stop typing resolutions — drag a box to set your output size
- width
- height
- aspect_ratio
- info
You know the drill: you open Empty Latent Image, stare at two number boxes, and mentally divide by 64 before the sampler lectures you about it. Drag Resolution (WepeNerd) replaces the arithmetic with a draggable box drawn right on the node. You resize it like a window, and every dimension it emits is snapped to a clean divisor grid so the latent is valid. It's the visual counterpart to the pack's Resolution Suggest node - same idea, but you feel the aspect ratio instead of typing it.
This one is aimed at the "let me just grab a sensible size" workflow. Drag the box until it looks right, pick a preset ratio if you know what you're targeting, and wire the width/height outputs into Empty Latent Image. No calculator tab required.
How it works
Split brain: the visual part is a frontend widget, the math is a backend node. The JavaScript extension (js/wn_drag_resolution.js) draws a canvas with a box, drag handles, and a grid overlay; dragging it updates the node's width/height widgets in real time, snapping to the current divisor. When you queue, the Python resolve() method re-snaps the values and computes the simplified ratio string. So what you see in the box is exactly what reaches your sampler.
The inputs that matter
- width / height - set by the box, or typed directly. The arrow buttons step by the current divisor value, which is a nice touch if you want to nudge one axis without fighting the mouse.
- aspect_ratio - a preset list (1:1, 16:9, 9:16, 4:3, 3:2, 21:9, 5:4, and rotations) that reshapes the box before you drag. Free is the default and means "keep whatever I currently have."
- divisor - the snap grid: 32 (default), 16, 8, or 64. If you're feeding Flux, bump it to 64.
What comes out
Four outputs, three of them useful: width and height as snapped INTs for your latent, and aspect_ratio as a simplified string ("16:9") that you could feed to a dynamic prompt or a conditioning-size node. info is a short human-readable summary of the resolved size.
Installing it
Same pack as the rest - install ComfyUI-WepeNerd once:
cd ComfyUI/custom_nodes
git clone https://github.com/WepeNerd/ComfyUI-WepeNerd.git
cd ComfyUI-WepeNerd
pip install -r requirements.txt
Or search for WepeNerd in ComfyUI Manager. Restart ComfyUI, then hard-refresh the browser (Ctrl+Shift+R) - this is a frontend-heavy node, and a stale JS cache is the most common reason the box doesn't appear. It lives under WepeNerd/Resolution.
Common gotchas
If the drag box doesn't render, it's almost always a cached frontend: hard refresh, and check the browser dev console for JavaScript errors. Also remember the aspect preset only reshapes the box before you drag - once you resize freely it becomes your current custom ratio, so re-pick the preset if you want to re-lock it. And keep an eye on the divisor: at 32 the outputs are always multiples of 32, which is fine for most models, but if your target model insists on 64, the mismatch will come back to bite you in the sampler.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464–8192 | — |
| height | INT | 102464–8192 | — |
| aspect_ratio | COMBO | Free | 12 options: Free, 1:1, 16:9, 9:16, 4:3, 3:4, +6 |
| divisor | COMBO | 32 | 4 options: 32, 16, 8, 64 |
| target_mp | FLOAT | 1.000.01–67 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| aspect_ratio | STRING | — |
| info | STRING | — |