some cleanup

This commit is contained in:
mcDandy
2026-08-26 17:57:22 +02:00
parent 1aa08b814b
commit d3e24d1896
14 changed files with 19 additions and 22 deletions
+1 -4
View File
@@ -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
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+3 -3
View File
@@ -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):
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+1 -1
View File
@@ -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",
),
+4 -4
View File
@@ -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",