forgot to add SIGMAS to readme and pyproject
This commit is contained in:
@@ -19,8 +19,7 @@ You can also get the node from comfy manager under the name of More math.
|
||||
|
||||
- functions and variables in math expressions
|
||||
- Conversion between INT and FLOAT; AUDIO and IMAGE (red - real - strenght of cosine of frequency; blue - imaginary - strenght of sine of frequency; green - log1p of amplitude - just so it looks good to humans)
|
||||
- Nodes for FLOAT, CONDITIONING, LATENT, IMAGE, MASK, NOISE, AUDIO, VIDEO, MODEL, CLIP and VAE
|
||||
|
||||
- Nodes for FLOAT, CONDITIONING, LATENT, IMAGE, MASK, NOISE, AUDIO, VIDEO, MODEL, CLIP, VAE and SIGMAS
|
||||
- Vector Math: Support for List literals `[v1, v2, ...]` and operations between lists/scalars/tensors
|
||||
|
||||
## Operators
|
||||
@@ -36,7 +35,7 @@ You can also get the node from comfy manager under the name of More math.
|
||||
- In imageMath node you can use 3 element list to specify a color of image. You cannot use any imput tensor, doing so will result in behaviour in subpoint 1 in list
|
||||
- **Length Mismatch Handling**: All math nodes (except Model, Clip, Vae which default to broadcast) include a `length_mismatch` option to handle inputs with different batch sizes, sample counts, or list lengths. The target length is determined by the **maximum length** among all provided inputs (`a`, `b`, `c`, `d`).
|
||||
- `tile` (Default): Repeats shorter inputs to match the maximum length.
|
||||
- `error`: Raises a `ValueError` if any input lengths differ. This helps identify unintentional mismatches that should be handled explicitly.
|
||||
- `error`: Raises a `ValueError` if any input lengths differ.
|
||||
- `pad`: Shorter inputs are padded with zeros to match the maximum length.
|
||||
|
||||
## Functions
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ authors = [
|
||||
readme = "README.md"
|
||||
license = {text = "GNU General Public License v3"}
|
||||
classifiers = []
|
||||
description = "Adds math nodes for FLOAT, CONDITIONING, LATENT, IMAGE, MASK, NOISE, AUDIO, VIDEO, MODEL, CLIP and VAE types and allows usage of math expressions with large number of functions and variables, not limited to inputs. List of those is on github of this extension."
|
||||
description = "Adds math nodes for FLOAT, CONDITIONING, LATENT, IMAGE, MASK, NOISE, AUDIO, VIDEO, MODEL, CLIP, VAE and SIGMAS types and allows usage of math expressions with large number of functions and variables, not limited to inputs. List of those is on github of this extension."
|
||||
dependencies = [
|
||||
|
||||
]
|
||||
|
||||
Binary file not shown.
@@ -1,59 +0,0 @@
|
||||
============================= test session starts =============================
|
||||
platform win32 -- Python 3.12.10, pytest-8.4.1, pluggy-1.6.0 -- C:\Users\danda\AppData\Local\Programs\Python\Python312\python.exe
|
||||
cachedir: .pytest_cache
|
||||
rootdir: D:\stability\Data\Packages\ComfyUI\custom_nodes\more_math
|
||||
configfile: pytest.ini
|
||||
plugins: anyio-4.9.0
|
||||
collecting ... collected 8 items
|
||||
|
||||
tests/test_multi_node_mismatch.py::test_image_mismatch_broadcast PASSED [ 12%]
|
||||
tests/test_multi_node_mismatch.py::test_image_mismatch_passthrough PASSED [ 25%]
|
||||
tests/test_multi_node_mismatch.py::test_image_mismatch_pad PASSED [ 37%]
|
||||
tests/test_multi_node_mismatch.py::test_float_list_mismatch_broadcast PASSED [ 50%]
|
||||
tests/test_multi_node_mismatch.py::test_float_list_mismatch_passthrough PASSED [ 62%]
|
||||
tests/test_multi_node_mismatch.py::test_float_list_mismatch_pad PASSED [ 75%]
|
||||
tests/test_multi_node_mismatch.py::test_image_passthrough_variables FAILED [ 87%]
|
||||
tests/test_multi_node_mismatch.py::test_audio_passthrough_variables FAILED [100%]
|
||||
|
||||
================================== FAILURES ===================================
|
||||
______________________ test_image_passthrough_variables _______________________
|
||||
|
||||
def test_image_passthrough_variables():
|
||||
# Verify aliases are accessible in passthrough mode
|
||||
a = torch.ones((2, 64, 64, 3))
|
||||
b = torch.ones((1, 64, 64, 3)) * 0.5
|
||||
|
||||
# Test batch_count (T), width (W), height (H)
|
||||
# result head should be 1 + T (2) + W (64) + H (64) = 131
|
||||
result, = ImageMathNode.execute("a[0] + batch_count + width + height", a, b=b, length_mismatch="passthrough")
|
||||
# batch_count for head is length of head?
|
||||
# Actually ImageMathNode.py uses head_a.shape[0] for variables_head
|
||||
# target_len is 2. b has 1. min_math_len is 1. head_a is a[:1].
|
||||
# variables_head["T"] = head_a.shape[0] = 1.
|
||||
# result[0] = 1 + 1 + 64 + 64 = 130
|
||||
> assert torch.allclose(result[0], torch.tensor(130.0))
|
||||
E assert False
|
||||
E + where False = <built-in method allclose of type object at 0x00007FF9B21F5880>(tensor([[[69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.],\n ...,\n [69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.]],\n\n [[69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.],\n ...,\n [69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.]],\n\n [[69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.],\n ...,\n [69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.]],\n\n ...,\n\n [[69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.],\n ...,\n [69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.]],\n\n [[69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.],\n ...,\n [69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.]],\n\n [[69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.],\n ...,\n [69., 69., 69.],\n [69., 69., 69.],\n [69., 69., 69.]]]), tensor(130.))
|
||||
E + where <built-in method allclose of type object at 0x00007FF9B21F5880> = torch.allclose
|
||||
E + and tensor(130.) = <built-in method tensor of type object at 0x00007FF9B21F5880>(130.0)
|
||||
E + where <built-in method tensor of type object at 0x00007FF9B21F5880> = torch.tensor
|
||||
|
||||
tests\test_multi_node_mismatch.py:69: AssertionError
|
||||
______________________ test_audio_passthrough_variables _______________________
|
||||
|
||||
def test_audio_passthrough_variables():
|
||||
a = torch.ones((1, 2, 100)) # 100 samples
|
||||
b = torch.ones((1, 2, 50)) * 0.5 # 50 samples
|
||||
|
||||
# Test sample_count (T) and sample_rate (R)
|
||||
# head_av.shape[2] is 50.
|
||||
# result[0,0,:50] = 1 + 50 + 44100 = 44151
|
||||
> result_dict, = AudioMathNode.execute("a + sample_count + sample_rate", {"waveform": a, "sample_rate": 44100}, b={"waveform": b, "sample_rate": 44100}, length_mismatch="passthrough")
|
||||
^^^^^^^^^^^^^
|
||||
E NameError: name 'AudioMathNode' is not defined
|
||||
|
||||
tests\test_multi_node_mismatch.py:80: NameError
|
||||
=========================== short test summary info ===========================
|
||||
FAILED tests/test_multi_node_mismatch.py::test_image_passthrough_variables - ...
|
||||
FAILED tests/test_multi_node_mismatch.py::test_audio_passthrough_variables - ...
|
||||
========================= 2 failed, 6 passed in 0.12s =========================
|
||||
Reference in New Issue
Block a user