[Diffusion] switch to local calculate_dimensions (#13294)

This commit is contained in:
Adarsh Shirawalmath
2025-11-15 11:25:13 +05:30
committed by GitHub
parent 10285ec204
commit c2083116e3
3 changed files with 12 additions and 3 deletions

View File

@@ -801,3 +801,13 @@ def save_decoded_latents_as_video(
os.makedirs(os.path.dirname(output_path), exist_ok=True)
imageio.mimsave(output_path, frames, fps=fps, format="mp4")
def calculate_dimensions(target_area, ratio):
width = math.sqrt(target_area * ratio)
height = width / ratio
width = round(width / 32) * 32
height = round(height / 32) * 32
return width, height, None