Float rounding fixes

Backend preview code will now accept floats and convert or truncate as
needed.

Fix updateParameter callbacks using out of date, unbounded values
This commit is contained in:
Austin Mroz
2025-04-05 04:11:07 -05:00
committed by AustinMroz
parent 7236c5dff0
commit df55f01d1d
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-videohelpersuite"
description = "Nodes related to video workflows"
version = "1.5.17"
version = "1.5.18"
license = { file = "LICENSE" }
dependencies = ["opencv-python", "imageio-ffmpeg"]
+4 -4
View File
@@ -71,7 +71,7 @@ async def view_video(request):
start_time = 0
if 'start_time' in query:
start_time = float(query['start_time'])
elif int(query.get('skip_first_frames', 0)) > 0:
elif float(query.get('skip_first_frames', 0)) > 0:
start_time = float(query.get('skip_first_frames'))/target_rate
if start_time > 1/modified_rate:
start_time += 1/modified_rate
@@ -87,7 +87,7 @@ async def view_video(request):
post_seek = []
args = [ffmpeg_path, "-v", "error"] + pre_seek + in_args + post_seek
if int(query.get('force_rate',0)) != 0:
if target_rate != 0:
args += ['-r', str(modified_rate)]
if query.get('force_size','Disabled') != "Disabled":
size = query['force_size'].split('x')
@@ -103,8 +103,8 @@ async def view_video(request):
vfilters.append(f"scale={size}")
if len(vfilters) > 0:
args += ["-vf", ",".join(vfilters)]
if int(query.get('frame_load_cap', 0)) > 0:
args += ["-frames:v", query['frame_load_cap']]
if float(query.get('frame_load_cap', 0)) > 0:
args += ["-frames:v", query['frame_load_cap'].split('.')[0]]
#TODO:reconsider adding high frame cap/setting default frame cap on node
if query.get('deadline', 'realtime') == 'good':
deadline = 'good'
+2 -2
View File
@@ -1185,9 +1185,9 @@ function addLoadCommon(nodeType, nodeData) {
//widget.callback adds unused arguements which need culling
const node = this
function update(key) {
return (value) => {
return function(value) {
let params = {}
params[key] = value
params[key] = this.value
node?.updateParameters(params)
}
}