With exact_ratio on, the valid outputs are a discrete lattice, so the
continuous megapixels input advertises precision that does not exist and
pushes the lookup table out of the node and into a sticky note beside the
graph. This adds a third node that is a single combo of 79 known-good
resolutions, each labelled
16:9 · 2048 × 1152 · 2.36 MP · K2+H3+SDXL
with the trailing tag derived from divisibility (grid 16 / 32 / 64), not
a hand-kept table.
The list is generated at import time by build_presets() from the same
lattice_step() the solver uses, so it cannot disagree with solve_exact().
Per ratio it picks the coarsest grid still yielding six sizes: 1:1 has
L=16 and would otherwise contribute 105 near-identical entries, whereas
the coarse grid lands it on canonical squares (512 ... 2048). Coarse
ratios like 16:9 fall through to grid 16 and keep their full set.
Additive only — ResolutionSelectorMP and ResolutionAlignToGrid are
untouched and remain the escape hatch for custom ratios and for sizes
off the preset list.
Verified: ruff clean; comfy node validate passes; all three nodes
register; all 79 presets checked for exact ratio, 16-grid alignment,
correct compat tag, correct megapixels, label/value agreement and
execute() round-trip — zero problems, labels and sizes both unique;
existing solver anchors and all 69 README table rows unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdgKVDqEbD14EJ4RC3GPmg
18 lines
629 B
TOML
18 lines
629 B
TOML
[project]
|
|
name = "comfyui-resolution-tools"
|
|
description = "Resolution maths for latent-space models, done exactly. Real megapixels (10^6, not 1024^2), patch-grid alignment for Krea 2 / MiniMax H3 / Flux / SDXL, and aspect ratios held exact instead of drifting on rounding."
|
|
version = "1.1.0"
|
|
license = { file = "LICENSE" }
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
# Pure stdlib maths; everything else is provided by ComfyUI core.
|
|
dependencies = []
|
|
|
|
[project.urls]
|
|
Repository = "https://github.com/dreevelle/ComfyUI-ResolutionTools"
|
|
|
|
[tool.comfy]
|
|
PublisherId = "dreevelle"
|
|
DisplayName = "ComfyUI-ResolutionTools"
|
|
Icon = ""
|