Files
Claude e011f81513 Fix aspect-ratio comma ambiguity, add a resolution ceiling, warn on clamps
Fixes from a review of the 1.3.0-1.5.0 work. No shape changes: FLUX 16:9
at 1MP is still 1344x768, and every model's channel count, downscale and
rank are untouched.

- Aspect-ratio parsing treated "," as a separator, so in decimal-comma
  locales "1,5" (meaning 1.5) was silently read as 1:5 = 0.2, a 7.5x
  wrong ratio with no error. Before 1.3.0 this raised a clear ValueError,
  so the rewrite had turned a loud error into a silent wrong answer. The
  comma is rejected again.

- There was no upper bound on dimensions. An extreme aspect ratio could
  emit sizes well past ComfyUI's MAX_RESOLUTION of 16384 - "1000:1" at
  1MP produced 32384 px wide. The latent itself is small, so it does not
  fail at allocation; it fails later in the sampler or VAE decode, far
  from the aspect ratio that caused it. Dimensions are now scaled to fit
  the ceiling, preserving the aspect ratio where the floor allows.

- Both the floor and the new ceiling distort the requested ratio or area,
  so each warns when it bites. The pre-1.3.0 code warned on the floor
  clamp and the rewrite had dropped it, which is inconsistent with the
  standard set elsewhere in the same file (the length-on-image-models
  warning exists for exactly this reason).

- Image families now allocate with dtype=intermediate_dtype(), matching
  EmptyLatentImage and EmptySD3LatentImage. Video families still pass
  only device, matching ComfyUI's video latent nodes. The stated goal was
  to match EmptyLatentImage and only device had been carried over.

Tests grow from 45 to 52, covering the ceiling, both clamp warnings,
comma rejection and the dtype split - the coverage gap that let the two
clamping bugs through in the first place.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbDZTWCvSqbXEX3GHJkSXw
2026-07-29 14:06:59 +00:00
..