DD Dimension Calculator
The megapixel math node that should be in every SDXL workflow
- 宽度
- 高度
- 总像素
DD Dimension Calculator is a three-input, three-output arithmetic node that multiplies width by height. That's the entire feature set, and if you think that sounds too trivial to install a node for, you haven't spent an afternoon with a model that cares how many total pixels you're feeding it.
Why it exists
Diffusion models train on a target pixel budget, and the practical rule of thumb is "stay in the model's resolution range." When people talk about a 0.5 or 1.0 megapixel image, they mean width × height - 512×512 is 0.26MP, 1024×1024 is 1.05MP, SDXL's sweet spot is roughly 0.9–1.1MP. Rather than doing that arithmetic in your head for the tenth time while tuning a workflow, you type the width and height into this node and it hands you the 总像素 (Total Pixels) value directly. That's genuinely useful for sanity-checking a resolution against a model's expectations, and for keeping img2img and ControlNet passes inside the same pixel budget so nothing blows up memory.
How it works
Nothing to reverse-engineer here - the source is literally pixels = width * height. Inputs are 宽度 (Width) and 高度 (Height), each an INT in the 1–8192 range. Outputs are width, height, and total pixels, all INTs. Because the outputs are plain integers, you can chain this into a conditional or a converter if you want to gate a workflow on a pixel budget, though that's not what the node itself does.
The honest take
This is the thinnest node in the pack, and it knows it. You're paying for convenience, not capability - if you already have a math node or a display node in your graph, you can reproduce it in two seconds. What it has going for it: it's already installed once you have DD-Nodes, it's typed cleanly as INTs (so no string-parsing games), and it's a nice little breadcrumb for beginners who are still learning why resolution numbers matter. It also pairs naturally with the pack's DD-SimpleLatent or DD-AspectRatioSelector when you're building an empty-latent pipeline and want to see the pixel count at a glance.
Installation
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/Dontdrunk/ComfyUI-DD-Nodes
cd ComfyUI-DD-Nodes && pip install -r requirements.txt
Restart ComfyUI or use ComfyUI Manager (search "ComfyUI-DD-Nodes"). No models, no dependencies beyond the pack's shared requirements. One tiny caveat: it doesn't enforce multiples of 8 or anything model-specific - it's raw multiplication, so feed it dimensions your model can actually use. And as with every node in this pack, labels default to Chinese; there's an English locale available in ComfyUI's settings.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| 宽度 | INT | 5121–8192 | — |
| 高度 | INT | 5121–8192 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 宽度 | INT | — |
| 高度 | INT | — |
| 总像素 | INT | — |