增加放大系数

This commit is contained in:
AI_Architect
2026-08-15 07:20:40 +08:00
parent 75709a0fd7
commit 70a9e8646c
+8 -4
View File
@@ -34,15 +34,19 @@ class XB_HailuoH3VideoParams:
"multiple": ("INT", {"default": 32, "min": 8, "max": 128, "step": 4}),
"frames_display": ("STRING", {"default": "Frames: 0", "multiline": False}),
"duration": ("INT", {"default": 8, "min": 4, "max": 15, "step": 1}),
"scale_factor": ("FLOAT", {
"default": 1.0, "min": 1.0, "max": 5.0, "step": 0.1,
"tooltip": "放大系数 — 接入「MiniMax H3 参考编码」的参考值放大"
}),
}
}
RETURN_TYPES = ("INT", "INT", "INT", "INT")
RETURN_NAMES = ("Width", "Height", "Frames", "Scale Size")
RETURN_TYPES = ("INT", "INT", "INT", "FLOAT")
RETURN_NAMES = ("Width", "Height", "Frames", "放大系数")
FUNCTION = "process"
CATEGORY = "XB_ToolBox/Image_Params"
def process(self, aspect_ratio, megapixels, multiple, frames_display, duration):
def process(self, aspect_ratio, megapixels, multiple, frames_display, duration, scale_factor):
# ── 分辨率:官方 ResolutionSelector 公式 ──
w_ratio, h_ratio = ASPECT_RATIOS.get(aspect_ratio, (16, 9))
total_pixels = megapixels * 1024 * 1024
@@ -54,4 +58,4 @@ class XB_HailuoH3VideoParams:
base = max(5, round(duration * 24))
safe_len = base + (5 - (base % 17)) % 17
return (safe_w, safe_h, safe_len, max(safe_w, safe_h))
return (safe_w, safe_h, safe_len, scale_factor)