Smart Resolution Calculator (DazzleNodes)
Stop Doing Resolution Math By Hand — This Node Generates the Latent Too
- image
- vae
- fill_image
- mask
- dazzle_options
- dazzle_signal
- megapixels
- width
- height
- seed
- preview
- image
- latent
- info
Every ComfyUI workflow has a moment of spreadsheet energy. You want a 9:16 portrait at around 1.5 megapixels, and suddenly you're doing long division for dimensions divisible by 8, feeding an Empty Latent Image, and hoping your model doesn't quietly complain. Smart Resolution Calculator is the node that kills that whole ritual: tell it what you know - megapixels, width, height, aspect ratio - and it computes the rest, rounds to a sane divisibility, and hands you a ready-to-sample latent on the way out. No separate Empty Latent node required.
Here's the honest pitch: it's grown well past being a calculator. It can fit a reference image to any target size, mix noise patterns into your starting latent, even do light img2img. But at its core it's still the "tell me what you know" node, and that's where you should start.
How it works
The whole thing runs on toggle widgets. Instead of typing numbers into every field, you flip on the dimensions you actually know - megapixels, width, or height - and the node picks the mode. Priority order: width+height beats width+aspect ratio beats height+aspect ratio beats megapixels+aspect ratio. Flip nothing and it defaults to 1.0 MP at your chosen ratio.
The result gets rounded to your divisible_by setting (Exact, 8, 16, 32, or 64; default 16). Worth knowing: different models want different multiples. SDXL is fine at 8 or 16, but Flux conventionally wants multiples of 64 - set divisible_by to 64 and you'll dodge a whole class of artifacts before they appear.
The clever bit is the latent. Instead of you wiring an Empty Latent node, this one asks the connected VAE for its channel count and spatial ratio and builds a matching latent - 4-channel for SD/SDXL/Flux, plus 5D tensors for video VAEs like Wan and HunyuanVideo. That's the part that usually breaks hand-rolled latent nodes.
The inputs that matter
On a first run you'll actually touch four things:
aspect_ratio- 23 presets from 1:1 to 32:9, plus acustom_ratiotoggle andcustom_aspect_ratiotext box for the in-between stuff like 5.2:2.5.divisible_by- default 16; go 64 for Flux,Exactwhen you're matching a specific existing size.scale- a 0–7x multiplier on the computed size, handy for hirez passes without re-typing everything.image+vae- where it gets interesting. Connect an image and it can extract dimensions from it or transform it to your target; connect a VAE and the image gets encoded to a latent for img2img (keep KSampler denoise low, around 0.2).
Of the eight outputs, the two you'll wire into a KSampler are latent and image. megapixels, width, height, and seed are there for downstream math, and info is a plain-text summary of which mode ran and what it computed - hook it to a Show Text node once to confirm you got the calc you expected.
The noise rabbit hole
The deeper feature is spectral blending. With a VAE connected, fill_type picks what the starting noise looks like (noise, random, or five DazNoise patterns if you install the optional dazzle-comfy-plasma-fast pack), and blend_strength + cutoff inject the spatial structure of that pattern into the latent noise - so a blob of plasma nudges where objects land. It's genuinely neat and genuinely fiddly. New here? Leave blend_strength at 0 until the calculator half behaves. And don't confuse it with denoise: blend_strength shapes the noise, while denoise on the KSampler controls how much of an input image survives.
Install
Painless, and the README is honest about it: zero pip dependencies - everything comes from ComfyUI's bundled torch, PIL, and numpy. In ComfyUI Manager, search "Smart Resolution Calculator", "DazzleNodes", or "djdarcy" and install. Or from the terminal:
cd ComfyUI/custom_nodes
git clone https://github.com/djdarcy/ComfyUI-Smart-Resolution-Calc
Restart ComfyUI (or use Manager → Refresh Node Definitions). It shows up in the DazzleNodes menu. The only optional extra worth grabbing is dazzle-comfy-plasma-fast, for the DazNoise fill patterns.
Where people get burned
The classic failure: widget toggles that seem to do nothing. This node uses custom JavaScript widgets, so if flipping a toggle doesn't change the calc, restart ComfyUI, clear the browser cache, and check the console (F12). There's also a debug mode - set COMFY_DEBUG_SMART_RES_CALC=true before launching for Python-side logs, or localStorage.setItem('DEBUG_SMART_RES_CALC','true') for JS-side ones. Latent tensor errors are almost always an outdated ComfyUI or a broken torch install; update both before blaming the node.
One honest caveat: this is a young, ambitious single-developer pack (Dustin Darcy, MIT licensed), so you're early. That's also why the feature surface is bigger than the average resolution node - the older generation, like ControlAltAI's Flux Resolution Calc this one nods to, does one job each. This one tries to do six. Start with the calculator, treat the rest as bonus.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 3:4 (SD Video Portrait) | 23 options: 1:1 (Square - Instagram/Profile), 2:3 (Photo Print 4×6), 3:4 (SD Video Portrait), 3:5 (Elegant Vertical), 4:5 (Instagram Portrait), 5:7 (Photo Print 5×7), +17 |
| divisible_by | COMBO | 16 | 5 options: Exact, 8, 16, 32, 64 |
| custom_ratio | BOOLEAN | false | — |
| mode_statusopt | STRING | Calculating... | Shows current dimension calculation mode (updated automatically, read-only) |
| custom_aspect_ratioopt | STRING | 5.2:2.5 | — |
| batch_sizeopt | INT | 11–64 | — |
| scaleopt | FLOAT | 1.00–7 | — |
| imageopt | IMAGE | Optional input image for dimension extraction and transformation. Without VAE: • Extract dimensions via 'USE IMAGE DIMS' toggle (AR Only or Exact Dims) • Transform to target size (distort, crop/pad, scale/crop, scale/pad) • Output available via IMAGE output pin With VAE: • All above features PLUS • IMAGE output is VAE encoded to LATENT output • Enables img2img/inpainting/outpainting workflows (use low denoise ~0.2) | |
| vaeopt | VAE | Optional VAE for encoding image output to latent. • Connected: Encodes the IMAGE output to latent (for img2img workflows) • Disconnected: Generates empty latent (for txt2img workflows) Connect VAE to enable low-denoise img2img/inpainting/outpainting. | |
| fill_typeopt | COMBO | black | Fill pattern for empty images, padding, and latent generation: • black: Solid black (#000000) • white: Solid white (#FFFFFF) • custom_color: Use fill_color hex value • noise: Gaussian noise (camera-like, centered around gray) • random: Uniform random pixels (TV static, full color range) With DazzleNodes/dazzle-comfy-plasma-fast installed: • DazNoise: Pink — Brightness-biased noise (cube root) • DazNoise: Brown — Extreme brightness-biased noise • DazNoise: Plasma — Organic cloud-like patterns • DazNoise: Greyscale — Monochrome noise mapped to RGB • DazNoise: Gaussian — Wide Gaussian noise (centered gray, std=0.25) When VAE is connected, non-trivial fills (noise, random, DazNoise) are VAE-encoded into the latent output for use as starting latent in KSampler. |
| blend_strengthopt | FLOAT | 0.0000–1 | Spectral blend strength: how much the primary pattern shapes the noise. The primary pattern depends on image_purpose: • dimensions only / image+noise -> fill_type pattern • img2noise / img2img+img2noise -> input image NOT the img2img amount -- that's controlled by 'denoise' on the KSampler. blend_strength shapes the NOISE; denoise controls how much of the input image survives. 0.0 = Pure Gaussian (no shaping) 0.1-0.3 = Subtle structural influence 0.3-0.5 = Moderate (recommended) 0.5-0.7 = Strong (less prompt adherence) 0.7-1.0 = Pattern dominates No effect with fill_type in {black, white, custom_color} when image_purpose is dimensions-only (no pattern to blend). |
| fill_blend_strengthopt | FLOAT | 0.0000–1 | Secondary texture layer: fill_type's contribution to noise character. Only active in image_purpose=img2noise and img2img+img2noise modes, where the image is the primary structural pattern. This knob controls how much fill_type (Plasma, Brown, etc.) participates as a secondary texture in the noise pipeline. 0.0 = fill_type ignored in noise (current img2noise behavior) 0.1-0.2 = Subtle texture flavor 0.3-0.5 = Moderate texture contribution 0.5+ = Strong fill_type character (may compete with image structure) Stage 1: blend(fill_type, Gaussian, fill_blend_strength, cutoff) -> flavored noise Stage 2: blend(image, flavored_noise, blend_strength, cutoff) -> final latent |
| cutoffopt | FLOAT | 0.2000.01–500 | Spectral blend frequency cutoff. Soft Gaussian rolloff center -- not a hard boundary. Values <= 1.0: Nyquist-relative (fraction of max frequency) 0.05-0.10: Large-scale composition only 0.15-0.25: Blob-scale (default 0.20) 0.30-0.50: Blobs + medium detail Values > 1.0: Pixel-space (resolution-independent) e.g., 40 = blend features ~40px wide at any resolution Interacts with blend_strength: raising cutoff increases total pattern influence. Use the 2D pad to visualize. |
| feature_sizeopt | INT | -1-1–4096 | Lock feature size in pixels for resolution-independent workflows. When set (> 0), cutoff auto-adjusts with resolution to maintain this feature size. -1 = disabled (use cutoff directly, original behavior). |
| image_purposeopt | COMBO | img2img | Controls how the connected INPUT image affects the OUTPUT nubs. • img2img: Transform INPUT image per output_image_mode → OUTPUT image. VAE-encode transformed image → OUTPUT latent. • dimensions only: Use INPUT image for dimension/AR extraction only. fill_type pattern → OUTPUT image. Seeded noise → OUTPUT latent. The INPUT image does NOT appear in any output. • img2noise: Use INPUT image's spatial structure to shape noise. fill_type pattern → OUTPUT image. Image-shaped spectral noise → OUTPUT latent. (Composition transfer) • image + noise: Independent output paths. Transform INPUT image → OUTPUT image. Seeded noise from fill_type → OUTPUT latent. (Not VAE-encoded) • img2img + img2noise: Layered mode. Transform INPUT image → OUTPUT image. VAE-encoded image + image-shaped noise → OUTPUT latent. (Self-consistent noise reinforces image composition) |
| output_image_modeopt | COMBO | auto | Image output mode: • auto: Smart default (transform (distort) if image input, empty otherwise) • empty: Generate new image with fill pattern • transform (distort): Scale to exact dimensions (ignores aspect ratio) • transform (crop/pad): No scaling, crop if larger or pad if smaller • transform (scale/crop): Scale to cover target (maintains AR), crop excess • transform (scale/pad): Scale to fit inside target (maintains AR), pad remainder |
| fill_coloropt | STRING | #522525 | Hex color code for custom_color fill type. Format: #RRGGBB (e.g., #FF0000=red, #00FF00=green, #0000FF=blue) With or without # prefix. Only used when fill_type is 'custom_color'. |
| fill_imageopt | IMAGE | Optional custom fill image. When connected, overrides fill_type for padding/empty areas. Connect any noise generator (e.g., DazNoise OmniNoise) for custom fill patterns. The image will be scaled to match target dimensions. | |
| maskopt | MASK | Optional mask to cut out parts of the input image. Mask=1 keeps the image; mask=0 is replaced by fill_image (if connected) or the fill_type pattern. Mask is auto-fit to the final output dimensions (nearest-exact) so it works with any output_image_mode. Ignored when no input image is present or when image_purpose is 'dimensions only'/'img2noise' (those modes do not emit the input image). | |
| dazzle_optionsopt | DAZZLE_OPTIONS | Advanced configuration from DazzleOptions node. Controls spectral normalization algorithm, cutoff curve shape, and other advanced features. Optional — defaults apply without connection. | |
| dazzle_signalopt | DAZZLE_SIGNAL | Orchestration signal from Dazzle Command node. Controls seed behavior (random/lock) based on workflow state (reviewing/proceeding). Optional — no effect without connection. |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| megapixels | FLOAT | — |
| width | INT | — |
| height | INT | — |
| seed | INT | — |
| preview | IMAGE | — |
| image | IMAGE | — |
| latent | LATENT | — |
| info | STRING | — |