Nodes/Smart Resolution Calculator/Smart Resolution Calculator (DazzleNodes)
ComfyUI Node

Smart Resolution Calculator (DazzleNodes)

Stop Doing Resolution Math By Hand — This Node Generates the Latent Too

By DazzleNodes·Created 11 months ago·Updated 2 months ago· 8
Smart Resolution Calculator (DazzleNodes)
  • image
  • vae
  • fill_image
  • mask
  • dazzle_options
  • dazzle_signal
  • megapixels
  • width
  • height
  • seed
  • preview
  • image
  • latent
  • info
aspect_ratio3:4 (SD Video Portrait)
divisible_by16
custom_ratiofalse
mode_statusCalculating...
custom_aspect_ratio5.2:2.5
batch_size1
scale1.0
fill_typeblack
blend_strength0.000
fill_blend_strength0.000
cutoff0.200
feature_size-1
image_purposeimg2img
output_image_modeauto
fill_color#522525

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 a custom_ratio toggle and custom_aspect_ratio text box for the in-between stuff like 5.2:2.5.
  • divisible_by - default 16; go 64 for Flux, Exact when 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.

CategoryDazzleNodes

Inputs (21)

NameTypeDefaultDescription
aspect_ratioCOMBO3: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_byCOMBO165 options: Exact, 8, 16, 32, 64
custom_ratioBOOLEANfalse
mode_statusoptSTRINGCalculating...Shows current dimension calculation mode (updated automatically, read-only)
custom_aspect_ratiooptSTRING5.2:2.5
batch_sizeoptINT11–64
scaleoptFLOAT1.00–7
imageoptIMAGEOptional 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)
vaeoptVAEOptional 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_typeoptCOMBOblackFill 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_strengthoptFLOAT0.0000–1Spectral 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_strengthoptFLOAT0.0000–1Secondary 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
cutoffoptFLOAT0.2000.01–500Spectral 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_sizeoptINT-1-1–4096Lock 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_purposeoptCOMBOimg2imgControls 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_modeoptCOMBOautoImage 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_coloroptSTRING#522525Hex 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_imageoptIMAGEOptional 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.
maskoptMASKOptional 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_optionsoptDAZZLE_OPTIONSAdvanced configuration from DazzleOptions node. Controls spectral normalization algorithm, cutoff curve shape, and other advanced features. Optional — defaults apply without connection.
dazzle_signaloptDAZZLE_SIGNALOrchestration signal from Dazzle Command node. Controls seed behavior (random/lock) based on workflow state (reviewing/proceeding). Optional — no effect without connection.

Outputs (8)

NameTypeDescription
megapixelsFLOAT
widthINT
heightINT
seedINT
previewIMAGE
imageIMAGE
latentLATENT
infoSTRING