This commit is contained in:
mcDandy
2025-12-08 21:38:59 +01:00
+14 -16
View File
@@ -15,7 +15,7 @@ You can also get the node from comfy manager under the name of More math.
# Features
- functions and variables in math expressions
- Nodes for CONDITIONING, LATENT, IMAGE, NOISE, FLOAT, and AUDIO
- Nodes for CONDITIONING, LATENT, IMAGE, NOISE, FLOAT, VIDEO and AUDIO
## Operators
- Math: `+`, `-`, `*`, `/`, `%`, `^`
@@ -28,7 +28,7 @@ You can also get the node from comfy manager under the name of More math.
- Hyperbolic: `sinh`, `cosh`, `tanh`, `asinh`, `acosh`, `atanh`
- Aggregates: `smin`, `smax` , `snorm` (scalar), `tmin`, `tmax`, `tnorm` (elementwise)
- Other: `floor`, `ceil`, `round`, `gamma`, `clamp`, `sigm` (sigmoid) `fft` (N-D FFT on non-batch/channel dims), `ifft` (Inverse N-D FFT, returns real component), `angle` (in ifft only)
- Shaders: `lerp(a, b, w)`, `step(edge, x)`, `smoothstep(edge0, edge1, x)`, `fract(x)`
- Shaders: `lerp(a, b, w)`, `step(x, edge)`, `smoothstep(x,edge0, edge1)`, `fract(x)`
- ML: `relu(x)`, `softplus(x)`, `gelu(x)`, `sign(x)`
- Tensor: `swap(tensor, dim, index1, index2)` (swaps two slices of a tensor along a dimension)
@@ -36,7 +36,12 @@ You can also get the node from comfy manager under the name of More math.
- **common inputs** (matches node input type):
- `a`, `b`, `c`, `d`
- **Extra floats**:
- `w`, `x`, `y`, `z`
- `w`, `x`, `y`, `z`
- **INSIDE IFFT**
- `F` or `frequency_count` – frequency count (freq domain, iFFT only)
- `K` or `frequency` – isotropic frequency (Euclidean norm of indices, iFFT only)
- `Kx`, `Ky`, `K_dimN` - frequency index for specific dimension
- `Fx`, `Fy`, `F_dimN` - frequency count for specific dimension
- **IMAGE and LATENT**:
- `C` or `channel` - channel of image
- `X` - position X in image. 0 is in top left
@@ -46,19 +51,15 @@ You can also get the node from comfy manager under the name of More math.
- `B` or 'batch' - position in batch
- 'T' or 'batch_count` - number of batches
- `N` or `channel_count` - count of channels
- `F` or `frequency_count` – frequency count (freq domain, iFFT only)
- `K` or `frequency` – isotropic frequency (Euclidean norm of indices, iFFT only)
- `Kx`, `Ky`, `K_dimN` - frequency index for specific dimension
- `Fx`, `Fy`, `F_dimN` - frequency count for specific dimension
- **AUDIO**:
- `B` or 'batch' - position in batch
- `N` or `channel_count` - count of channels
- `C` or `channel` - channel of audio
- `S` or `sample` – current audio sample
- 'T' or 'sample_count` - audio lenght in samples
- `R` or `sample_rate` – sample rate
- `F` – frequency count (freq domain, iFFT only)
- `K` – isotropic frequency (freq domain, iFFT only)
- **VIDEO**
- refer to `IMAGE and LATENT` for visual part (but `batch` is `frame` and `batch_count` is `frame_count`)
- refer to `AUDIO` for sound part
@@ -67,11 +68,8 @@ You can also get the node from comfy manager under the name of More math.
- `I` or `input_latent` – latent used as input to generate noise before noise is generated into it
- **CONDITIONING and FLOAT**
- no additional variables
- `F` or `frequency_count` – frequency count (freq domain, iFFT only)
- `K` or `frequency` – isotropic frequency (Euclidean norm of indices, iFFT only)
- `Kx`, `Ky`, `K_dimN` - frequency index for specific dimension
- `Fx`, `Fy`, `F_dimN` - frequency count for specific dimension
- Constants: `e`, `pi`
## Examples
### Swap Red and Blue Channels
`swap(a, 1, 0, 2)`
*(for ImageMathNode, where dim 1 is Channel)*