Slider 2D
One drag, two numbers — built for width/height and any XY pair
- X
- Y
Same trick as mxSlider, except this one controls two numbers at once from a single 2D pad - drag around inside it and you get X and Y out the other side. The obvious use is width and height, and the node's own defaults (512/512) make clear that's exactly what it was built for, but it works for any two related values you want to explore together.
Why you'd reach for it
Width and height are usually the two most-tweaked numbers in a graph, and they're almost always adjusted together - bump one, the other needs to follow to keep an aspect ratio, or you're hunting for a resolution your VRAM can actually handle. Two separate number widgets make that fiddly. mxSlider2D gives you one control surface for both, plus a couple of niceties purpose-built for exactly this use case (more on those below).
How it works
It behaves like mxSlider but doubled - an X axis and a Y axis, each independently switchable between INT and FLOAT output. On top of that, the README describes a few display options that live on the node itself rather than as wired inputs:
dots- shows tick marks on the pad matching the current snap grid.frame- draws a border around the control.framealert- the standout one. Set a threshold and the frame changes color the moment X × Y exceeds it; set it to0to turn the feature off. Point it at, say, your safe pixel budget and the node visually flags a resolution combo that's about to choke your GPU, before you even queue.
Shift-click the area showing the X/Y values and it swaps them - a fast way to flip portrait to landscape without re-dragging. Double-click a value to type it in directly, same as mxSlider.
The inputs and outputs that matter
Six required fields, mirroring mxSlider's pattern but per axis:
Xi/Xf- the INT and FLOAT copies of the X value (both default512).Yi/Yf- the INT and FLOAT copies of the Y value (both default512).isfloatX/isfloatY- the per-axis switch deciding whether that axis outputs its int copy or its float copy (0= int,1= float), same logic as mxSlider'sisfloatX.
Two outputs, both wildcard-typed: X and Y. Wire X into a width field and Y into a height field (or wherever a related pair of numbers is wanted) and you're done.
Installing it
ComfyUI Manager: search ComfyUI-mxToolkit (or mxToolkit), install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Smirnov75/ComfyUI-mxToolkit
Restart after. It's one of five nodes in the pack (with Seed, Stop, the single-axis Slider, and an alternative Reroute), all installed together under utils/mxToolkit. No models or extra Python dependencies mentioned in the README - this is graph-logic and canvas UI, nothing inference-related.
Common issues
Same caveat as its single-axis sibling, doubled: dragging, the shift-click XY swap, double-click-to-type, and the framealert color change are all interactive, on-canvas behaviors. Calling this workflow through the API skips all of it - you're just setting Xi/Xf/Yi/Yf/isfloatX/isfloatY directly and reading back X and Y; dots, frame, and framealert have nothing to render against in a headless run, so don't expect them to do anything there.
Also watch the int/float mode per axis independently - it's easy to set one axis to decimals and forget the other, and then wonder why your width is a clean integer but your height has three decimal places. If a downstream node (an Empty Latent Image, say) wants integers on both, double-check isfloatX and isfloatY are both 0 rather than assuming they're linked.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| Xi | INT | 512-4294967296–4294967296 | — |
| Xf | FLOAT | 512.00-4294967296–4294967296 | — |
| Yi | INT | 512-4294967296–4294967296 | — |
| Yf | FLOAT | 512.00-4294967296–4294967296 | — |
| isfloatX | INT | 00–1 | — |
| isfloatY | INT | 00–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| X | * | — |
| Y | * | — |