MCPcopy Create free account
hub / github.com/Lightricks/ComfyUI-LTXVideo / _render_resolution

Function _render_resolution

sparse_tracks.py:189–199  ·  view source on GitHub ↗

Compute the higher render resolution that preserves aspect ratio.

(width: int, height: int, reference_short_side: int)

Source from the content-addressed store, hash-verified

187
188
189def _render_resolution(width: int, height: int, reference_short_side: int):
190 """Compute the higher render resolution that preserves aspect ratio."""
191 if height <= width:
192 rw = int(width * reference_short_side / height)
193 rh = reference_short_side
194 else:
195 rw = reference_short_side
196 rh = int(height * reference_short_side / width)
197 scale_x = rw / width
198 scale_y = rh / height
199 return rw, rh, scale_x, scale_y
200
201
202_MIN_RADIUS = 2

Callers 1

executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected