From d3e24d18964ddf639bd3d8802afcdc78187fcbc0 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Wed, 26 Aug 2026 17:57:22 +0200 Subject: [PATCH] some cleanup --- README.md | 5 +---- more_math/AudioMathNode.py | 2 +- more_math/ClipMathNode.py | 2 +- more_math/ConditioningMathNode.py | 6 +++--- more_math/FloatMathNode.py | 2 +- more_math/ImageMathNode.py | 2 +- more_math/LatentMathNode.py | 2 +- more_math/MaskMathNode.py | 2 +- more_math/ModelMathNode.py | 2 +- more_math/NoiseMathNode.py | 2 +- more_math/SigmasMathNode.py | 2 +- more_math/StringMathNode.py | 2 +- more_math/VaeMathNode.py | 2 +- more_math/VideoMathNode.py | 8 ++++---- 14 files changed, 19 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 56ce8b6..14a2887 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,6 @@ You can also get the node from comfy manager under the name of More math. ## Functions -> Functions are grouped by purpose. -> The descriptions below reflect the runtime behavior implemented in `UnifiedMathVisitor.py`. - ### 1) Core Math #### 1.1 Elementary & Numeric @@ -416,7 +413,7 @@ ___ - `K` or `key` - name of current layer. For example, `proj_out.bias`, `diffusion_model.blocks.5.attn.out_proj.weight` or `txtfusion.layerwise_blocks.0.prenorm.scale`. - `L` or `layer` - index of current layer - `LC` or `layer_count` - number of layers - - **IMAGE KERNEL**: in `conv`/`convolution` or `ezconv`/`ezconvolution` function kernel input + - **IMAGE KERNEL**: in `conv`/`convolution` or `ezconv`/`ezconvolution` function kernel input - `kX`, `kY` - position in kernel, centered at `0.0` - `kW`, `kernel_width` - kernel width - `kH`, `kernel_height` - kernel height diff --git a/more_math/AudioMathNode.py b/more_math/AudioMathNode.py index 34f3f59..92ba3cf 100644 --- a/more_math/AudioMathNode.py +++ b/more_math/AudioMathNode.py @@ -36,7 +36,7 @@ class AudioMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Audio.Input("values", optional=True), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on weights", ), diff --git a/more_math/ClipMathNode.py b/more_math/ClipMathNode.py index ac0383d..dcf991b 100644 --- a/more_math/ClipMathNode.py +++ b/more_math/ClipMathNode.py @@ -23,7 +23,7 @@ class CLIPMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Clip.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on weights", ), diff --git a/more_math/ConditioningMathNode.py b/more_math/ConditioningMathNode.py index 196df95..44a8687 100644 --- a/more_math/ConditioningMathNode.py +++ b/more_math/ConditioningMathNode.py @@ -26,12 +26,12 @@ class ConditioningMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Conditioning.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", display_name="Tensor expr.", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", display_name="Tensor expr.", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on tensor part of conditioning", ), io.MultiType.Input( - io.String.Input("Expression_pi", display_name="pooled output expr.", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression_pi", display_name="pooled output expr.", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on pooled_input part of conditioning", ), @@ -182,7 +182,7 @@ class ConditioningMathNode(io.ComfyNode): variables_pi[k] = val if val is not None else 0.0 # Execute Expression_pi - rpooled = None + rpooled = None if valid_pooled_keys: tree_pi = None if isinstance(Expression_pi,str): diff --git a/more_math/FloatMathNode.py b/more_math/FloatMathNode.py index 854261c..ce31adc 100644 --- a/more_math/FloatMathNode.py +++ b/more_math/FloatMathNode.py @@ -33,7 +33,7 @@ class FloatMathNode(io.ComfyNode): ), ), io.MultiType.Input( - io.String.Input("FloatFunc", default="a*(1-w)+b*w", multiline=False), + io.String.Input("FloatFunc", default="V0", multiline=False), types=[io.String, MrmthParseTree], tooltip="Expression to use on inputs", ), diff --git a/more_math/ImageMathNode.py b/more_math/ImageMathNode.py index 3fcbed4..55cf66e 100644 --- a/more_math/ImageMathNode.py +++ b/more_math/ImageMathNode.py @@ -27,7 +27,7 @@ class ImageMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Image.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on input images", ), diff --git a/more_math/LatentMathNode.py b/more_math/LatentMathNode.py index 7d92735..80a1d4d 100644 --- a/more_math/LatentMathNode.py +++ b/more_math/LatentMathNode.py @@ -37,7 +37,7 @@ class LatentMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Latent.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on input latents", ), diff --git a/more_math/MaskMathNode.py b/more_math/MaskMathNode.py index 409bd7d..fed527c 100644 --- a/more_math/MaskMathNode.py +++ b/more_math/MaskMathNode.py @@ -27,7 +27,7 @@ class MaskMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Mask.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on input masks", ), diff --git a/more_math/ModelMathNode.py b/more_math/ModelMathNode.py index 09af282..8050979 100644 --- a/more_math/ModelMathNode.py +++ b/more_math/ModelMathNode.py @@ -24,7 +24,7 @@ class ModelMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Model.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on weights", ), diff --git a/more_math/NoiseMathNode.py b/more_math/NoiseMathNode.py index 603c54f..2e1c443 100644 --- a/more_math/NoiseMathNode.py +++ b/more_math/NoiseMathNode.py @@ -32,7 +32,7 @@ class NoiseMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Noise.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Noise", default="a*(1-w)+b*w", multiline=False), + io.String.Input("Noise", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression for noise", ), diff --git a/more_math/SigmasMathNode.py b/more_math/SigmasMathNode.py index 1cf983a..97d4c54 100644 --- a/more_math/SigmasMathNode.py +++ b/more_math/SigmasMathNode.py @@ -25,7 +25,7 @@ class SigmasMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Sigmas.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on input images", ), diff --git a/more_math/StringMathNode.py b/more_math/StringMathNode.py index 6f071ef..3d0eb81 100644 --- a/more_math/StringMathNode.py +++ b/more_math/StringMathNode.py @@ -31,7 +31,7 @@ class StringMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.String.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on weights", ), diff --git a/more_math/VaeMathNode.py b/more_math/VaeMathNode.py index 84d9e0d..26babb4 100644 --- a/more_math/VaeMathNode.py +++ b/more_math/VaeMathNode.py @@ -21,7 +21,7 @@ class VAEMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Vae.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], tooltip="Expression to apply on weights", ), diff --git a/more_math/VideoMathNode.py b/more_math/VideoMathNode.py index a0840c4..ca97a32 100644 --- a/more_math/VideoMathNode.py +++ b/more_math/VideoMathNode.py @@ -25,14 +25,14 @@ class VideoMathNode(io.ComfyNode): io.Autogrow.Input(id="V",template=io.Autogrow.TemplatePrefix(io.Video.Input("values"), prefix="V", min=1, max=50)), io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), io.MultiType.Input( - io.String.Input("Expression", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression", default="V0", multiline=False), types=[io.String,MrmthParseTree], - tooltip="Expression to apply on tensor part of conditioning", + tooltip="Expression to apply on tensor part of video", ), io.MultiType.Input( - io.String.Input("Expression_pi", default="I0*(1-F0)+I1*F0", multiline=False), + io.String.Input("Expression_pi", default="V0", multiline=False), types=[io.String,MrmthParseTree], - tooltip="Expression to apply on pooled_input part of conditioning", + tooltip="Expression to apply on audio part of video", ) , io.Combo.Input( id="length_mismatch",