From 03ca33cb78788aa9a62874ebde6ae1cf4bb8d176 Mon Sep 17 00:00:00 2001 From: dreevelle <123705989+dreevelle@users.noreply.github.com> Date: Sun, 13 Sep 2026 00:36:42 +0100 Subject: [PATCH] feat: extend the preset list down to 0.15 MP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The floor sat at 0.25 MP, so 16:9's cheapest entry was 768x432 — and that one is K2-only (432 % 32 = 16), leaving 1024x576 as the smallest H3-legal 16:9 in the list. An audio-only H3 render wants 512x288, the n=1 lattice point at alignment 32, where the video canvas is pure overhead. Dropping PRESET_MIN_MP alone re-picks the geometric thinning and silently drops labels — 3:2 1152x768 and 1920x1280 among them — which breaks saved workflows, since the label string is what a graph stores. Raising PRESET_MAX_ENTRIES to 11 in the same step absorbs that: 79 -> 87 entries with every existing label still present and still pointing at the same size. The six entries beyond 512x288 / 288x512 are lattice points the old 9-entry cap had been skipping over. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01K1sGVWw5KU3GD7CrhdZR7M --- README.md | 6 +++++- __init__.py | 11 +++++++---- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f1d2d69..9ece089 100644 --- a/README.md +++ b/README.md @@ -390,7 +390,7 @@ the useful rows are all still there (1024×576, 1536×864, 2048×1152, 2560×144 ### Resolution Preset -One combo of 79 known-good resolutions. Every entry is exactly on its aspect ratio and +One combo of 87 known-good resolutions. Every entry is exactly on its aspect ratio and on the patch grid, so there is nothing to compute and nothing to look up. **Inputs** — `preset`, formatted `ratio · width × height · real MP · compatible models`. @@ -412,6 +412,10 @@ entries, and the coarse grid lands them on canonical sizes — 512, 768, 1024, 1 — instead. Coarse-lattice ratios like 16:9 fall through to grid 16 and keep their full useful set. +The list spans 0.15 to 4.3 MP. The bottom end is there for runs where the canvas is +overhead rather than output — an audio-only MiniMax H3 render, say, where `16:9 · 512 × +288` is the smallest exact 16:9 the model's 32 px grid admits. + Why a list and not a number: with `exact_ratio` on, the valid outputs *are* a discrete lattice. A continuous megapixel input advertises precision that does not exist, and pushes the lookup table out of the node and into your head (or a sticky note next to diff --git a/__init__.py b/__init__.py index 010bd6b..7f5a9cf 100644 --- a/__init__.py +++ b/__init__.py @@ -55,7 +55,7 @@ from typing_extensions import override from comfy_api.latest import ComfyExtension, IO -__version__ = "1.1.1" +__version__ = "1.2.0" # --------------------------------------------------------------------------- @@ -157,10 +157,13 @@ def align_value(value: int, alignment: int, mode: str) -> int: # presets are the lattice, rendered readable -- derived at import time, never # hand-maintained, so they cannot drift from what the solver produces. # --------------------------------------------------------------------------- -PRESET_MIN_MP = 0.25 +# The floor sits just under 512x288 (0.147 MP), the n=1 lattice point for 16:9 +# at alignment 32 -- the smallest exact 16:9 an H3 graph can ask for. Useful for +# audio-only H3 runs, where the video canvas is pure overhead. +PRESET_MIN_MP = 0.14 PRESET_MAX_MP = 4.3 -PRESET_MIN_ENTRIES = 6 # coarsest grid that still offers this many sizes wins -PRESET_MAX_ENTRIES = 9 # thin geometrically beyond this, keeping both ends +PRESET_MIN_ENTRIES = 6 # coarsest grid that still offers this many sizes wins +PRESET_MAX_ENTRIES = 11 # thin geometrically beyond this, keeping both ends # 16:9 and 9:16 lead: the common case for video and for delivery to a screen. PRESET_RATIO_ORDER = [ diff --git a/pyproject.toml b/pyproject.toml index 3947b08..f6fa69f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [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.1" +version = "1.2.0" license = { file = "LICENSE" } readme = "README.md" requires-python = ">=3.10"