Add use_image_aspect toggle to allow manual aspect with images

When disabled, the aspect_ratio and resolution widgets are respected
even with images connected (reference workflows like MiniMax R2VA).
Default stays True so existing workflows keep auto-detecting aspect
from the input image.
This commit is contained in:
huchukato
2026-09-24 00:31:50 +02:00
parent 5a0b09bf7b
commit bcbe3193f7
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -433,6 +433,7 @@ class ComfyUI_PerfectVideoResolution:
"upscale_method": (["lanczos", "bilinear", "bicubic", "nearest"], {"default": "lanczos"}),
"small_image_mode": (["none", "crop", "pad"], {"default": "none"}),
"pad_color": ("STRING", {"default": "#000000"}),
"use_image_aspect": ("BOOLEAN", {"default": True}),
},
"optional": {
"image": ("IMAGE",),
@@ -463,6 +464,7 @@ class ComfyUI_PerfectVideoResolution:
upscale_method: str,
small_image_mode: str,
pad_color: str,
use_image_aspect: bool,
image=None,
image2=None,
mask=None,
@@ -482,7 +484,7 @@ class ComfyUI_PerfectVideoResolution:
resolved_resolution_label = resolution
target_w, target_h = _parse_resolution(presets, aspect_ratio, resolution, fallback_aspect)
if image_dims is not None:
if image_dims is not None and use_image_aspect:
image_w, image_h = image_dims
resolved_aspect = _best_aspect_ratio(image_w, image_h, aspect_order, fallback_aspect)
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "ComfyUI-PerfectVideoResolution"
description = "Perfect Video Resolution node for ComfyUI — automatically calculates and applies the optimal resolution for video generation models (WAN 2.2, MiniMax H3, LTX) based on aspect ratio and model requirements."
version = "0.1.0"
version = "0.1.1"
license = {file = "LICENSE"}
dependencies = []