From 9f49c6d054bfca83b87ac755cf3fc6b914f01570 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Fri, 27 Feb 2026 12:19:25 +0100 Subject: [PATCH] AI convert size variables to floats --- more_math/AudioMathNode.py | 4 ++-- more_math/GuiderMathNode.py | 16 ++++++++-------- more_math/ImageMathNode.py | 16 ++++++++-------- more_math/LatentMathNode.py | 16 ++++++++-------- more_math/MaskMathNode.py | 12 ++++++------ more_math/NoiseMathNode.py | 10 +++++----- more_math/VideoMathNode.py | 24 ++++++++++++------------ 7 files changed, 49 insertions(+), 49 deletions(-) diff --git a/more_math/AudioMathNode.py b/more_math/AudioMathNode.py index 2bd9077..ee7f88a 100644 --- a/more_math/AudioMathNode.py +++ b/more_math/AudioMathNode.py @@ -111,8 +111,8 @@ class AudioMathNode(io.ComfyNode): "R": sample_rate, "sample_rate": sample_rate, "batch": getIndexTensorAlongDim(a_w, 0), - "T": a_w.shape[0], - "batch_count": a_w.shape[0], + "T": float(a_w.shape[0]), + "batch_count": float(a_w.shape[0]), } | generate_dim_variables(a_w) | V_norm_waveforms | sample_rates v_stacked, v_cnt = get_v_variable(V_norm_waveforms, length_mismatch=length_mismatch) diff --git a/more_math/GuiderMathNode.py b/more_math/GuiderMathNode.py index 7ad7371..506050c 100644 --- a/more_math/GuiderMathNode.py +++ b/more_math/GuiderMathNode.py @@ -134,14 +134,14 @@ class MathGuider: "z": self.F.get("F3", 0.0), "B": getIndexTensorAlongDim(eval_samples, batch_dim), "batch": getIndexTensorAlongDim(eval_samples, batch_dim), - "W": eval_samples.shape[width_dim] if width_dim < ndim else 0, - "width": eval_samples.shape[width_dim] if width_dim < ndim else 0, - "H": eval_samples.shape[height_dim] if height_dim < ndim else 0, - "height": eval_samples.shape[height_dim] if height_dim < ndim else 0, - "T": frame_count, - "batch_count": eval_samples.shape[0], - "N": eval_samples.shape[channel_dim] if channel_dim < ndim else 0, - "channel_count": eval_samples.shape[channel_dim] if channel_dim < ndim else 0, + "W": float(eval_samples.shape[width_dim]) if width_dim < ndim else 0.0, + "width": float(eval_samples.shape[width_dim]) if width_dim < ndim else 0.0, + "H": float(eval_samples.shape[height_dim]) if height_dim < ndim else 0.0, + "height": float(eval_samples.shape[height_dim]) if height_dim < ndim else 0.0, + "T": float(frame_count), + "batch_count": float(eval_samples.shape[0]), + "N": float(eval_samples.shape[channel_dim]) if channel_dim < ndim else 0.0, + "channel_count": float(eval_samples.shape[channel_dim]) if channel_dim < ndim else 0.0, "sigma": sigma.item() if isinstance(sigma,torch.Tensor) else sigma, "seed": seed if seed is not None else 0, "steps": self.steps, diff --git a/more_math/ImageMathNode.py b/more_math/ImageMathNode.py index 5361e4f..c064d14 100644 --- a/more_math/ImageMathNode.py +++ b/more_math/ImageMathNode.py @@ -97,14 +97,14 @@ class ImageMathNode(io.ComfyNode): "batch": getIndexTensorAlongDim(ae, 0), "C": getIndexTensorAlongDim(ae, 1), "channel": getIndexTensorAlongDim(ae, 1), - "W": ae.shape[2], - "width": ae.shape[2], - "H": ae.shape[1], - "height": ae.shape[1], - "T": ae.shape[0], - "batch_count": ae.shape[0], - "N": ae.shape[3], - "channel_count": ae.shape[3], + "W": float(ae.shape[2]), + "width": float(ae.shape[2]), + "H": float(ae.shape[1]), + "height": float(ae.shape[1]), + "T": float(ae.shape[0]), + "batch_count": float(ae.shape[0]), + "N": float(ae.shape[3]), + "channel_count": float(ae.shape[3]), } | generate_dim_variables(ae) # Add all dynamic inputs diff --git a/more_math/LatentMathNode.py b/more_math/LatentMathNode.py index 3bcba23..50cfb3c 100644 --- a/more_math/LatentMathNode.py +++ b/more_math/LatentMathNode.py @@ -151,14 +151,14 @@ class LatentMathNode(io.ComfyNode): "batch": getIndexTensorAlongDim(ae, batch_dim), "C": getIndexTensorAlongDim(ae, channel_dim), "channel": getIndexTensorAlongDim(ae, channel_dim), - "W": ae.shape[width_dim], - "width": ae.shape[width_dim], - "H": ae.shape[height_dim], - "height": ae.shape[height_dim], - "T": frame_count, - "batch_count": ae.shape[batch_dim], - "N": ae.shape[channel_dim], - "channel_count": ae.shape[channel_dim], + "W": float(ae.shape[width_dim]), + "width": float(ae.shape[width_dim]), + "H": float(ae.shape[height_dim]), + "height": float(ae.shape[height_dim]), + "T": float(frame_count), + "batch_count": float(ae.shape[batch_dim]), + "N": float(ae.shape[channel_dim]), + "channel_count": float(ae.shape[channel_dim]), } | generate_dim_variables(ae) if time_dim is not None: diff --git a/more_math/MaskMathNode.py b/more_math/MaskMathNode.py index 7584e79..14527ec 100644 --- a/more_math/MaskMathNode.py +++ b/more_math/MaskMathNode.py @@ -92,12 +92,12 @@ class MaskMathNode(io.ComfyNode): "Y": getIndexTensorAlongDim(ae, 1), "B": getIndexTensorAlongDim(ae, 0), "batch": getIndexTensorAlongDim(ae, 0), - "W": ae.shape[2], - "width": ae.shape[2], - "H": ae.shape[1], - "height": ae.shape[1], - "T": ae.shape[0], - "batch_count": ae.shape[0], + "W": float(ae.shape[2]), + "width": float(ae.shape[2]), + "H": float(ae.shape[1]), + "height": float(ae.shape[1]), + "T": float(ae.shape[0]), + "batch_count": float(ae.shape[0]), } | generate_dim_variables(ae) v_stacked, v_cnt = get_v_variable(V_norm, length_mismatch=length_mismatch) diff --git a/more_math/NoiseMathNode.py b/more_math/NoiseMathNode.py index f724236..db77460 100644 --- a/more_math/NoiseMathNode.py +++ b/more_math/NoiseMathNode.py @@ -97,12 +97,12 @@ class NoiseExecutor: "y": self.F.get("F2", 0.0), "z": self.F.get("F3", 0.0), "B": B, "batch": B, - "X": W, "width": samples.shape[width_dim], - "Y": H, "height": samples.shape[height_dim], + "X": W, "width": float(samples.shape[width_dim]), + "Y": H, "height": float(samples.shape[height_dim]), "C": C, "channel": C, - "W": samples.shape[width_dim], "H": samples.shape[height_dim], "I": samples, - "T": frame_count, "N": samples.shape[channel_dim], - "batch_count": samples.shape[batch_dim], "channel_count": samples.shape[channel_dim], + "W": float(samples.shape[width_dim]), "H": float(samples.shape[height_dim]), "I": samples, + "T": float(frame_count), "N": float(samples.shape[channel_dim]), + "batch_count": float(samples.shape[batch_dim]), "channel_count": float(samples.shape[channel_dim]), "input_latent": samples, } | generate_dim_variables(samples) | vals | self.F diff --git a/more_math/VideoMathNode.py b/more_math/VideoMathNode.py index 63cd208..13caa68 100644 --- a/more_math/VideoMathNode.py +++ b/more_math/VideoMathNode.py @@ -33,8 +33,8 @@ class VideoMathNode(io.ComfyNode): io.String.Input("Expression_pi", default="I0*(1-F0)+I1*F0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on pooled_input part of conditioning", - ), - io.Combo.Input( + ) + , io.Combo.Input( id="length_mismatch", options=["do nothing","error","tile", "pad"], display_name="on size mismatch", @@ -98,14 +98,14 @@ class VideoMathNode(io.ComfyNode): "batch": getIndexTensorAlongDim(ae, 0), "C": getIndexTensorAlongDim(ae, 1), "channel": getIndexTensorAlongDim(ae, 1), - "W": ae.shape[2], - "width": ae.shape[2], - "H": ae.shape[1], - "height": ae.shape[1], - "T": ae.shape[0], - "batch_count": ae.shape[0], - "N": ae.shape[3], - "channel_count": ae.shape[3], + "W": float(ae.shape[2]), + "width": float(ae.shape[2]), + "H": float(ae.shape[1]), + "height": float(ae.shape[1]), + "T": float(ae.shape[0]), + "batch_count": float(ae.shape[0]), + "N": float(ae.shape[3]), + "channel_count": float(ae.shape[3]), } | generate_dim_variables(ae) v_stacked, v_cnt = get_v_variable(V_norm, length_mismatch=length_mismatch) @@ -177,8 +177,8 @@ class VideoMathNode(io.ComfyNode): "R": sample_rate, "sample_rate": sample_rate, "batch": getIndexTensorAlongDim(a_w, 0), - "T": a_w.shape[0], - "batch_count": a_w.shape[0], + "T": float(a_w.shape[0]), + "batch_count": float(a_w.shape[0]), } | generate_dim_variables(a_w) | V_norm_waveforms | sample_rates v_stacked, v_cnt = get_v_variable(V_norm_waveforms, length_mismatch=length_mismatch)