Commit Graph
4 Commits
Author SHA1 Message Date
dreevelleandClaude Opus 5 2d740a2b80 docs: warn that ComfyUI-Manager deletes through a symlinked dev copy
The working tree was symlinked into custom_nodes for pre-publish testing.
Manager's remove/replace path runs shutil.rmtree on the resolved path, so
it deleted the target's contents rather than unlinking the symlink --
wiping this tree, .git included. Recovered by re-cloning; nothing was
lost because everything was pushed.

Updates the local-environment section to describe the post-publish
arrangement (Manager install under the lowercase registry id) and to
require tearing down any dev symlink before touching Manager.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdgKVDqEbD14EJ4RC3GPmg
2026-08-09 14:32:53 +01:00
dreevelleandClaude Opus 5 877a5ad776 docs: downscale guidance for fixed-canvas delivery
Generating on the exact-ratio lattice and downscaling beats generating
at the delivery size and cropping. 1920x1080 is exactly 16:9 and so is
every lattice row, so the whole table resizes onto it with no crop --
1920x1088 is the only entry needing one, being the only non-16:9 size.
Downscaling is also supersampling, which a 1:1 render plus a trim isn't.

Filter choice measured on a zone plate against an antialiased reference:
lanczos wins (RMSE 0.00298 at 0.9375x), bicubic second. Notably `area`
is ~10x worse than bicubic despite the usual "area is the downscale
filter" advice -- that only holds for large reductions; a box filter at
a non-integer factor near 1 weights unevenly. Documents lanczos's 8-bit
quantisation in comfy/utils.py and when it matters.

Recommends ImageScale over ImageScaleBy: identical code path, but
scale_by's 0.01 step rounds four of seven lattice factors to sizes that
aren't 1080p, and a pinned delivery size is correct for every row
without edits while a hardcoded factor is correct for exactly one.

Adds wiring for both models and the alignment=32 simplification (legal
on Krea 2 and H3 simultaneously).

All 79 table rows verified by parsing them back out of the README:
megapixel rows re-derived through the node, crop rows checked for exact
16:9 and uniform scale, ImageScaleBy rows confirmed to actually produce
the wrong sizes claimed. Zero mismatches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdgKVDqEbD14EJ4RC3GPmg
2026-08-09 14:14:00 +01:00
dreevelleandClaude Opus 5 5970c4000f docs: full 16:9 reference tables for Krea 2 and MiniMax H3
Sweeps to ~4 MP in both modes, in real megapixels.

Exact-ratio tables list the complete lattice (256n x 144n at alignment
16, 512n x 288n at 32) -- there is nothing valid between the rows.
Area-target tables cover 0.2-4.0 MP in the independent-rounding mode for
when a pixel budget matters more than a perfect ratio.

Also adds a portrait/landscape ratio table at ~2.36 MP and per-model
guidance on which row to pick: Krea 2's sanctioned band tops out at
2.36 MP (2048x1152), H3's native canvas is 1.03 MP with 1.33 MP
(1536x864) the highest row worth running by default.

All 69 rows verified by parsing them back out of the README and
re-deriving each through solve_exact / solve_nearest: zero mismatches,
every row on-grid, every exact-ratio row satisfying w*b == h*a.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdgKVDqEbD14EJ4RC3GPmg
2026-08-09 13:59:08 +01:00
dreevelleandClaude Opus 5 2b7a1fecae Initial commit: exact resolution maths for latent-space models
Two nodes addressing distinct problems with ComfyUI's built-in
Resolution Selector (comfy_extras/nodes_resolution.py).

ResolutionSelectorMP
  Core computes `megapixels * 1024 * 1024`, so every target is inflated
  4.86% in area: 2.36 MP at 9:16 yields 1184x2096 = 2.48 real MP. This
  uses 10^6.

  Core also rounds each axis onto the grid independently, which drifts
  the aspect ratio (that same result is 0.5649, not 0.5625). With
  exact_ratio on, this solves instead on the lattice of sizes that are
  simultaneously grid-aligned and exactly on-ratio: for a reduced ratio
  a:b and alignment m those are (a*L*n, b*L*n) where

      L = lcm(m / gcd(a, m), m / gcd(b, m))

  9:16 at m=16 gives the lattice 144n x 256n, and n=8 lands on
  1152x2048 -- exact 9:16, on the grid, 2.36 MP. solve_nearest()
  preserves core's behaviour behind exact_ratio=False for when the
  lattice is too coarse.

ResolutionAlignToGrid
  Snaps arbitrary dimensions onto the grid (1920x1080 -> 1920x1088),
  with round/up/down.

Alignment is vae_spatial_downscale * dit_patch_size, verified against
the ComfyUI source rather than assumed: 16 for Krea 2 (Wan21 inherits
spacial_downscale_ratio 8, patch 2), 32 for MiniMax H3
(spacial_downscale_ratio 16, patch_size (1,2,2)), 64 for SDXL/SD1.5.
Off-grid dimensions get circular-padded by
comfy.ldm.common_dit.pad_to_patch_size -- the pad row is a wrapped copy
of the top of the image, folded into the same patch token as the real
bottom row, which decodes to a band of artifacts along the bottom edge.
Padding is only ever appended, so the artifact is never top/left.

Verified: ruff clean; both schemas construct and both execute() paths
run; a 4000-case fuzz over random ratio/alignment/target triples asserts
w % m == 0, h % m == 0 and w*b == h*a (zero ratio drift); core's formula
reimplemented and reproduces the observed 1184x2096 exactly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdgKVDqEbD14EJ4RC3GPmg
2026-08-09 13:51:36 +01:00