AI: add recommanded functions
This commit is contained in:
@@ -433,6 +433,17 @@ func1:
|
||||
- kernel_size: odd Sobel kernel size, at least 3 (default: 3)
|
||||
*/
|
||||
| EDGE LPAREN expr (COMMA expr)? RPAREN # EdgeFunc
|
||||
/**
|
||||
distance_transform(mask, [threshold]) - Euclidean distance in pixels from each pixel inside the mask to the nearest pixel outside it; outside pixels are 0. Use distance_transform(1 - mask) for the distance outside the mask
|
||||
- mask: mask or image; values above threshold count as inside
|
||||
- threshold: inside/outside cutoff (default: 0.5)
|
||||
*/
|
||||
| DISTANCE_TRANSFORM LPAREN expr (COMMA expr)? RPAREN # DistanceTransformFunc
|
||||
/**
|
||||
grayscale(image) - replaces the R, G, B entries of the last dimension with their Rec.709 luminance, keeping the shape and extra channels such as alpha
|
||||
- image: colors with R, G, B as the first three entries of the last dimension
|
||||
*/
|
||||
| GRAYSCALE LPAREN expr RPAREN # GrayscaleFunc
|
||||
/**
|
||||
median(x, [dim]) - computes the median globally or along one dimension
|
||||
- x: values (list or tensor)
|
||||
@@ -1082,6 +1093,25 @@ func2:
|
||||
- new: replacement
|
||||
*/
|
||||
| REPLACE LPAREN expr COMMA expr COMMA expr RPAREN # ReplaceFunc
|
||||
/**
|
||||
regex_search(text, pattern) - returns the index of the first match of the regular expression pattern in text, or -1 if there is none
|
||||
- text: text to search in
|
||||
- pattern: Python regular expression
|
||||
*/
|
||||
| REGEX_SEARCH LPAREN expr COMMA expr RPAREN # RegexSearchFunc
|
||||
/**
|
||||
regex_replace(text, pattern, replacement) - replaces every match of the regular expression pattern in text; replacement may refer to groups as \1
|
||||
- text: text to change
|
||||
- pattern: Python regular expression
|
||||
- replacement: replacement text
|
||||
*/
|
||||
| REGEX_REPLACE LPAREN expr COMMA expr COMMA expr RPAREN # RegexReplaceFunc
|
||||
/**
|
||||
format(value, [spec]) - formats numbers as text. spec is a number of decimals or a Python format spec such as ".3e" (default: shortest form, "g"); lists and tensors are formatted per element
|
||||
- value: number, list or tensor
|
||||
- spec: decimal count or format spec text
|
||||
*/
|
||||
| FORMAT LPAREN expr (COMMA expr)? RPAREN # FormatFunc
|
||||
/**
|
||||
int_to_rgb(color) - unpacks 0xRRGGBB integers into 0-1 RGB colors. Tensors get R, G, B stacked in a new last dimension, lists return a list of colors and a number returns a 3-item list
|
||||
- color: packed 0xRRGGBB integer, list or tensor
|
||||
@@ -1213,13 +1243,62 @@ func3:
|
||||
*/
|
||||
| IRFFT LPAREN expr (COMMA expr (COMMA expr)?)? RPAREN # IrfftFunc
|
||||
/**
|
||||
overlay(base, overlay, offset, [opacity]) - overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.
|
||||
overlay(base, overlay, offset, [opacity], [mode]) - overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay. For tensors, mode picks a blend mode like blend()
|
||||
- base: background value, list, text or tensor
|
||||
- overlay: value placed on top of base
|
||||
- offset: position of the overlay's low corner in base, one value per dimension
|
||||
- opacity: 0-1 blend amount; a number or a tensor shaped like overlay (default: 1)
|
||||
- mode: blend mode name for tensors, see blend() (default: "normal")
|
||||
*/
|
||||
| OVERLAY LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # OverlayFunc
|
||||
| OVERLAY LPAREN expr COMMA expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # OverlayFunc
|
||||
/**
|
||||
blend(base, top, mode, [opacity]) - blends top onto base with a blend mode, like layers in an image editor. Shapes broadcast; use overlay() to place a smaller layer at an offset. Modes: normal, multiply, screen, overlay, soft_light, hard_light, darken, lighten, difference, exclusion, add, subtract, color_dodge, color_burn
|
||||
- base: bottom layer
|
||||
- top: top layer
|
||||
- mode: blend mode name, e.g. "screen"
|
||||
- opacity: 0-1 amount of the blended result; a number or a broadcastable tensor (default: 1)
|
||||
*/
|
||||
| BLEND LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # BlendFunc
|
||||
/**
|
||||
interp(x, xs, ys, [mode]) - keyframe interpolation: the value at x of the curve through the points (xs, ys), holding the first/last value outside the keys. Modes: linear (default), smooth (eases in and out of every key), step (holds a value until the next key)
|
||||
- x: position such as a frame index; a number or tensor
|
||||
- xs: key positions
|
||||
- ys: values at the keys; they may be tensors (e.g. images) when x is a number
|
||||
- mode: "linear", "smooth" or "step" (default: "linear")
|
||||
*/
|
||||
| INTERP LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # InterpFunc
|
||||
/**
|
||||
sigm_karras(steps, sigma_min, sigma_max, [rho]) - Karras noise schedule: steps sigmas from sigma_max down to sigma_min, followed by a final 0
|
||||
- steps: number of sampling steps
|
||||
- sigma_min: smallest non-zero sigma
|
||||
- sigma_max: largest sigma
|
||||
- rho: curvature of the schedule (default: 7)
|
||||
*/
|
||||
| SIGM_KARRAS LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # SigmKarrasFunc
|
||||
/**
|
||||
sigm_exponential(steps, sigma_min, sigma_max) - exponential noise schedule (evenly spaced in log sigma), followed by a final 0
|
||||
- steps: number of sampling steps
|
||||
- sigma_min: smallest non-zero sigma
|
||||
- sigma_max: largest sigma
|
||||
*/
|
||||
| SIGM_EXPONENTIAL LPAREN expr COMMA expr COMMA expr RPAREN # SigmExponentialFunc
|
||||
/**
|
||||
sigm_polyexponential(steps, sigma_min, sigma_max, [rho]) - polynomial-in-log-sigma noise schedule, followed by a final 0
|
||||
- steps: number of sampling steps
|
||||
- sigma_min: smallest non-zero sigma
|
||||
- sigma_max: largest sigma
|
||||
- rho: polynomial power; 1 is the exponential schedule (default: 1)
|
||||
*/
|
||||
| SIGM_POLYEXPONENTIAL LPAREN expr COMMA expr COMMA expr (COMMA expr)? RPAREN # SigmPolyexponentialFunc
|
||||
/**
|
||||
sigm_laplace(steps, sigma_min, sigma_max, [mu], [beta]) - Laplace noise schedule of steps sigmas; like ComfyUI's LaplaceScheduler it has no final 0
|
||||
- steps: number of sampling steps
|
||||
- sigma_min: smallest non-zero sigma
|
||||
- sigma_max: largest sigma
|
||||
- mu: location of the Laplace distribution in log sigma (default: 0)
|
||||
- beta: scale of the Laplace distribution (default: 0.5)
|
||||
*/
|
||||
| SIGM_LAPLACE LPAREN expr COMMA expr COMMA expr (COMMA expr (COMMA expr)?)? RPAREN # SigmLaplaceFunc
|
||||
/**
|
||||
linspace(start, stop, count) - creates count evenly spaced values from start to stop (both included). Use range to control the step instead.
|
||||
- start: first value
|
||||
@@ -1250,6 +1329,14 @@ func3:
|
||||
- b: blue channel 0-1
|
||||
*/
|
||||
| RGB_TO_CIELAB LPAREN expr (COMMA expr COMMA expr)? RPAREN # RgbToCielabFunc
|
||||
/**
|
||||
luminance(rgb) / luminance(r, g, b) - Rec.709 luminance 0.2126 R + 0.7152 G + 0.0722 B of gamma-encoded colors. With one argument the first three entries of its last dimension are R, G, B and that dimension is removed
|
||||
- rgb: colors (0-1) with R, G, B in the last dimension, or a 3-item list
|
||||
- r: red channel 0-1
|
||||
- g: green channel 0-1
|
||||
- b: blue channel 0-1
|
||||
*/
|
||||
| LUMINANCE LPAREN expr (COMMA expr COMMA expr)? RPAREN # LuminanceFunc
|
||||
/**
|
||||
rgb_to_hsv(rgb, [degrees]) / rgb_to_hsv(r, g, b, [degrees]) - converts RGB to HSV. With one color argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result. If degrees is truthy, hue is 0-360 instead of 0-1
|
||||
- rgb: colors (0-1) with R, G, B in the last dimension, or a 3-item list
|
||||
@@ -1739,6 +1826,10 @@ ROUND: 'round';
|
||||
GAMMA: 'gamma';
|
||||
POWE: 'pow';
|
||||
SIGM: 'sigm';
|
||||
SIGM_KARRAS: 'sigm_karras';
|
||||
SIGM_EXPONENTIAL: 'sigm_exponential';
|
||||
SIGM_POLYEXPONENTIAL: 'sigm_polyexponential';
|
||||
SIGM_LAPLACE: 'sigm_laplace';
|
||||
CLAMP: 'clamp';
|
||||
SFFT: 'fft';
|
||||
SIFFT: 'ifft';
|
||||
@@ -1747,6 +1838,7 @@ PRNT: 'print';
|
||||
PRINT_SHAPE: 'print_shape' | 'pshp';
|
||||
NVL: 'nvl' | 'nan_to_num';
|
||||
LERP: 'lerp';
|
||||
INTERP: 'interp';
|
||||
SLERP: 'slerp';
|
||||
STEP: 'step';
|
||||
SMOOTHSTEP: 'smoothstep';
|
||||
@@ -1797,6 +1889,8 @@ ERFINV: 'erfinv';
|
||||
ANY: 'any';
|
||||
ALL: 'all';
|
||||
EDGE: 'edge';
|
||||
DISTANCE_TRANSFORM: 'distance_transform';
|
||||
GRAYSCALE: 'grayscale';
|
||||
GAUSSIAN: 'blur' | 'gaussian';
|
||||
MEDIAN: 'median';
|
||||
MODE: 'mode';
|
||||
@@ -1833,6 +1927,7 @@ FLOW_ANG: 'flow_ang' | 'flow_angle';
|
||||
WHERE: 'where';
|
||||
HISTOGRAM: 'histogram' | 'hist';
|
||||
OVERLAY: 'overlay';
|
||||
BLEND: 'blend';
|
||||
PAD: 'pad';
|
||||
CROSS: 'cross';
|
||||
MATMUL: 'matmul';
|
||||
@@ -1877,11 +1972,15 @@ JOIN: 'join';
|
||||
SUBSTRING: 'substring'|'substr';
|
||||
FIND: 'find';
|
||||
REPLACE: 'replace';
|
||||
REGEX_SEARCH: 'regex_search';
|
||||
REGEX_REPLACE: 'regex_replace';
|
||||
FORMAT: 'format';
|
||||
DILATE: 'dilate';
|
||||
ERODE: 'erode';
|
||||
MORPH_OPEN: 'morph_open';
|
||||
MORPH_CLOSE: 'morph_close';
|
||||
RGB_TO_OKLAB: 'rgb_to_oklab';
|
||||
LUMINANCE: 'luminance';
|
||||
RGB_TO_CIELAB: 'rgb_to_cielab';
|
||||
OKLAB_TO_RGB: 'oklab_to_rgb';
|
||||
CIELAB_TO_RGB: 'cielab_to_rgb';
|
||||
|
||||
@@ -2,7 +2,9 @@ import bisect
|
||||
import functools
|
||||
import time
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import scipy.ndimage
|
||||
import torch
|
||||
import math
|
||||
import inspect
|
||||
@@ -10,6 +12,7 @@ import weakref
|
||||
import torch.nn.functional as F
|
||||
from comfy.nested_tensor import NestedTensor
|
||||
from comfy.model_management import throw_exception_if_processing_interrupted
|
||||
from comfy.k_diffusion import sampling as k_sampling
|
||||
from . import optical_flow_utils as ofu
|
||||
from .Func import LambdaFunction
|
||||
from antlr4 import TerminalNode
|
||||
@@ -134,6 +137,29 @@ class ChangeTrackingDict(dict):
|
||||
self._changed_keys = set()
|
||||
|
||||
|
||||
# Blend modes as f(base, top); soft_light uses the Pegtop formula, which stays defined outside 0-1.
|
||||
_BLEND_MODES = {
|
||||
"normal": lambda b, s: s,
|
||||
"multiply": torch.mul,
|
||||
"screen": lambda b, s: b + s - b * s,
|
||||
"overlay": lambda b, s: torch.where(b <= 0.5, 2 * b * s, 1 - 2 * (1 - b) * (1 - s)),
|
||||
"soft_light": lambda b, s: (1 - 2 * s) * b * b + 2 * s * b,
|
||||
"hard_light": lambda b, s: torch.where(s <= 0.5, 2 * b * s, 1 - 2 * (1 - b) * (1 - s)),
|
||||
"darken": torch.minimum,
|
||||
"lighten": torch.maximum,
|
||||
"difference": lambda b, s: (b - s).abs(),
|
||||
"exclusion": lambda b, s: b + s - 2 * b * s,
|
||||
"add": torch.add,
|
||||
"subtract": torch.sub,
|
||||
"color_dodge": lambda b, s: torch.where(s >= 1, torch.ones_like(b), (b / (1 - s).clamp_min(1e-6)).clamp_max(1)),
|
||||
"color_burn": lambda b, s: torch.where(s <= 0, torch.zeros_like(b), 1 - ((1 - b) / s.clamp_min(1e-6)).clamp_max(1)),
|
||||
}
|
||||
|
||||
|
||||
def _rec709_luma(r, g, b):
|
||||
return 0.2126 * r + 0.7152 * g + 0.0722 * b
|
||||
|
||||
|
||||
_FONT_WEIGHT_TIERS = ("thin", "extralight", "light", "regular", "medium", "semibold", "bold", "extrabold", "black")
|
||||
_FONT_STYLE_SUFFIXES = {
|
||||
"thin": ("thin", "hairline", "100"),
|
||||
@@ -1695,6 +1721,77 @@ class UnifiedMathVisitor(MathExprVisitor):
|
||||
return torch.clamp(self._promote_to_tensor(val), self._promote_to_tensor(min_v), self._promote_to_tensor(max_v))
|
||||
return max(min(val, max_v), min_v)
|
||||
|
||||
def visitInterpFunc(self, ctx):
|
||||
x = yield ctx.expr(0)
|
||||
xs = yield ctx.expr(1)
|
||||
ys = yield ctx.expr(2)
|
||||
mode = str((yield ctx.expr(3))).lower() if len(ctx.expr()) > 3 else "linear"
|
||||
if mode not in ("linear", "smooth", "step"):
|
||||
raise ValueError(f"{ctx.start.line}:{ctx.start.column}: interp mode must be linear, smooth or step, got '{mode}'")
|
||||
|
||||
xs = xs.flatten().tolist() if self._is_tensor(xs) else [float(v) for v in xs]
|
||||
ys = list(ys.unbind(0)) if self._is_tensor(ys) else list(ys)
|
||||
if len(xs) != len(ys) or not xs:
|
||||
raise ValueError(f"{ctx.start.line}:{ctx.start.column}: interp needs the same non-zero number of keys and values, got {len(xs)} and {len(ys)}")
|
||||
keys = sorted(zip(xs, ys), key=lambda kv: kv[0])
|
||||
xs = [k for k, _ in keys]
|
||||
ys = [v for _, v in keys]
|
||||
|
||||
if not self._is_tensor(x) or x.numel() == 1:
|
||||
i = bisect.bisect_right(xs, float(x))
|
||||
if i == 0:
|
||||
return ys[0]
|
||||
if i == len(xs) or mode == "step":
|
||||
return ys[i - 1]
|
||||
t = (float(x) - xs[i - 1]) / (xs[i] - xs[i - 1])
|
||||
if mode == "smooth":
|
||||
t = t * t * (3 - 2 * t)
|
||||
a, b = ys[i - 1], ys[i]
|
||||
if self._is_tensor(a) or self._is_tensor(b):
|
||||
return torch.lerp(self._promote_to_tensor(a), self._promote_to_tensor(b), t)
|
||||
return a + (b - a) * t
|
||||
|
||||
if any(self._is_tensor(v) and v.numel() != 1 for v in ys):
|
||||
raise ValueError(f"{ctx.start.line}:{ctx.start.column}: interp values must be numbers when x is a tensor")
|
||||
xs_t = torch.tensor(xs, dtype=torch.float32, device=x.device)
|
||||
ys_t = torch.tensor([float(v) for v in ys], dtype=torch.float32, device=x.device)
|
||||
if len(xs) == 1:
|
||||
return torch.full_like(x, float(ys[0]), dtype=torch.float32)
|
||||
|
||||
xf = x.float().contiguous()
|
||||
i = torch.searchsorted(xs_t, xf, right=True).clamp(1, len(xs) - 1)
|
||||
x0, x1 = xs_t[i - 1], xs_t[i]
|
||||
t = ((xf - x0) / (x1 - x0)).nan_to_num(1.0).clamp(0, 1)
|
||||
if mode == "step":
|
||||
t = (t >= 1).float()
|
||||
elif mode == "smooth":
|
||||
t = t * t * (3 - 2 * t)
|
||||
return torch.lerp(ys_t[i - 1], ys_t[i], t)
|
||||
|
||||
def _schedule_args(self, ctx):
|
||||
steps = self._to_int((yield ctx.expr(0)), ctx, "schedule steps", strict=True)
|
||||
return steps, float((yield ctx.expr(1))), float((yield ctx.expr(2)))
|
||||
|
||||
def visitSigmKarrasFunc(self, ctx):
|
||||
steps, sigma_min, sigma_max = yield from self._schedule_args(ctx)
|
||||
rho = float((yield ctx.expr(3))) if len(ctx.expr()) > 3 else 7.0
|
||||
return k_sampling.get_sigmas_karras(steps, sigma_min, sigma_max, rho, device=self.device)
|
||||
|
||||
def visitSigmExponentialFunc(self, ctx):
|
||||
steps, sigma_min, sigma_max = yield from self._schedule_args(ctx)
|
||||
return k_sampling.get_sigmas_exponential(steps, sigma_min, sigma_max, device=self.device)
|
||||
|
||||
def visitSigmPolyexponentialFunc(self, ctx):
|
||||
steps, sigma_min, sigma_max = yield from self._schedule_args(ctx)
|
||||
rho = float((yield ctx.expr(3))) if len(ctx.expr()) > 3 else 1.0
|
||||
return k_sampling.get_sigmas_polyexponential(steps, sigma_min, sigma_max, rho, device=self.device)
|
||||
|
||||
def visitSigmLaplaceFunc(self, ctx):
|
||||
steps, sigma_min, sigma_max = yield from self._schedule_args(ctx)
|
||||
mu = float((yield ctx.expr(3))) if len(ctx.expr()) > 3 else 0.0
|
||||
beta = float((yield ctx.expr(4))) if len(ctx.expr()) > 4 else 0.5
|
||||
return k_sampling.get_sigmas_laplace(steps, sigma_min, sigma_max, mu, beta, device=self.device)
|
||||
|
||||
def visitLerpFunc(self, ctx):
|
||||
a = (yield ctx.expr(0))
|
||||
b = (yield ctx.expr(1))
|
||||
@@ -3858,6 +3955,18 @@ class UnifiedMathVisitor(MathExprVisitor):
|
||||
return res.squeeze(0).squeeze(0)
|
||||
return res
|
||||
|
||||
def visitDistanceTransformFunc(self, ctx):
|
||||
tsr = self._promote_to_tensor((yield ctx.expr(0)))
|
||||
threshold = float((yield ctx.expr(1))) if len(ctx.expr()) > 1 else 0.5
|
||||
|
||||
def edt_op(x):
|
||||
# scipy's exact EDT runs on CPU; [B, C, H, W] -> one 2D transform per image channel
|
||||
inside = (x > threshold).cpu().numpy()
|
||||
dist = np.stack([[scipy.ndimage.distance_transform_edt(channel) for channel in image] for image in inside])
|
||||
return torch.from_numpy(dist).to(device=x.device, dtype=torch.float32)
|
||||
|
||||
return self._apply_spatial_op(tsr, edt_op, tsr.shape)
|
||||
|
||||
def visitEdgeFunc(self, ctx):
|
||||
tsr_val = yield ctx.expr(0)
|
||||
tsr = self._promote_to_tensor(tsr_val)
|
||||
@@ -4818,6 +4927,14 @@ class UnifiedMathVisitor(MathExprVisitor):
|
||||
else:
|
||||
opacity = 1.0
|
||||
|
||||
blend = None
|
||||
if len(ctx.expr()) > 4:
|
||||
mode = str((yield ctx.expr(4))).lower()
|
||||
if mode != "normal":
|
||||
blend = self._blend_fn(mode, ctx)
|
||||
if isinstance(base, str) or self._is_list(base):
|
||||
raise ValueError(f"{ctx.start.line}:{ctx.start.column}: overlay blend mode '{mode}' needs tensors, got {type(base).__name__}")
|
||||
|
||||
opacity_is_tensor = self._is_tensor(opacity) and opacity.numel() > 1
|
||||
|
||||
if not opacity_is_tensor:
|
||||
@@ -4929,6 +5046,8 @@ class UnifiedMathVisitor(MathExprVisitor):
|
||||
|
||||
result = base.clone()
|
||||
target_region = result[tuple(paste_slices)]
|
||||
if blend is not None:
|
||||
cropped_overlay = blend(target_region, cropped_overlay)
|
||||
|
||||
if opacity_is_tensor:
|
||||
cropped_mask = mask[tuple(crop_slices)]
|
||||
@@ -4941,6 +5060,44 @@ class UnifiedMathVisitor(MathExprVisitor):
|
||||
|
||||
return result.contiguous()
|
||||
|
||||
def _blend_fn(self, mode, ctx):
|
||||
fn = _BLEND_MODES.get(str(mode).lower())
|
||||
if fn is None:
|
||||
raise ValueError(f"{ctx.start.line}:{ctx.start.column}: Unknown blend mode '{mode}'. Modes: {', '.join(_BLEND_MODES)}")
|
||||
return fn
|
||||
|
||||
def visitBlendFunc(self, ctx):
|
||||
base = self._promote_to_tensor((yield ctx.expr(0)))
|
||||
top = self._promote_to_tensor((yield ctx.expr(1)))
|
||||
blend = self._blend_fn((yield ctx.expr(2)), ctx)
|
||||
opacity = (yield ctx.expr(3)) if len(ctx.expr()) > 3 else 1.0
|
||||
|
||||
blended = blend(base, top)
|
||||
return torch.lerp(base.to(blended.dtype), blended, self._promote_to_tensor(opacity).to(blended.dtype))
|
||||
|
||||
def visitRegexSearchFunc(self, ctx):
|
||||
text = str((yield ctx.expr(0)))
|
||||
match = re.search(str((yield ctx.expr(1))), text)
|
||||
return float(match.start()) if match else -1.0
|
||||
|
||||
def visitRegexReplaceFunc(self, ctx):
|
||||
text = str((yield ctx.expr(0)))
|
||||
pattern = str((yield ctx.expr(1)))
|
||||
return re.sub(pattern, str((yield ctx.expr(2))), text)
|
||||
|
||||
def visitFormatFunc(self, ctx):
|
||||
value = yield ctx.expr(0)
|
||||
spec = (yield ctx.expr(1)) if len(ctx.expr()) > 1 else "g"
|
||||
if not isinstance(spec, str):
|
||||
spec = f".{self._to_int(spec, ctx, 'format decimals', strict=True)}f"
|
||||
|
||||
def fmt(v):
|
||||
if self._is_list(v):
|
||||
return [fmt(x) for x in v]
|
||||
return format(v, spec)
|
||||
|
||||
return fmt(value.tolist() if self._is_tensor(value) else value)
|
||||
|
||||
def visitReplaceFunc(self, ctx):
|
||||
val = yield ctx.expr(0)
|
||||
old = yield ctx.expr(1)
|
||||
@@ -5671,6 +5828,23 @@ class UnifiedMathVisitor(MathExprVisitor):
|
||||
|
||||
return self._linear_to_oklab(r, g, b)
|
||||
|
||||
def visitLuminanceFunc(self, ctx):
|
||||
if len(ctx.expr()) == 1:
|
||||
rgb = yield ctx.expr(0)
|
||||
if self._is_list(rgb):
|
||||
return _rec709_luma(*self._rgb_triplet_from_arg(ctx, rgb, "luminance"))
|
||||
rgb = self._promote_to_tensor(rgb)
|
||||
return _rec709_luma(rgb[..., 0], rgb[..., 1], rgb[..., 2])
|
||||
r = self._promote_to_tensor((yield ctx.expr(0)))
|
||||
g = self._promote_to_tensor((yield ctx.expr(1)))
|
||||
b = self._promote_to_tensor((yield ctx.expr(2)))
|
||||
return _rec709_luma(r, g, b)
|
||||
|
||||
def visitGrayscaleFunc(self, ctx):
|
||||
img = self._promote_to_tensor((yield ctx.expr()))
|
||||
luma =_rec709_luma(img[..., 0], img[..., 1], img[..., 2]).unsqueeze(-1)
|
||||
return torch.cat([luma.expand(*luma.shape[:-1], 3), img[..., 3:]], dim=-1)
|
||||
|
||||
def visitRgbToCielabFunc(self, ctx):
|
||||
num_args = len(ctx.expr())
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -47,252 +47,264 @@ ROUND=46
|
||||
GAMMA=47
|
||||
POWE=48
|
||||
SIGM=49
|
||||
CLAMP=50
|
||||
SFFT=51
|
||||
SIFFT=52
|
||||
ANGL=53
|
||||
PRNT=54
|
||||
PRINT_SHAPE=55
|
||||
NVL=56
|
||||
LERP=57
|
||||
SLERP=58
|
||||
STEP=59
|
||||
SMOOTHSTEP=60
|
||||
FRACT=61
|
||||
RELU=62
|
||||
SOFTSIGN=63
|
||||
LEAKY_RELU=64
|
||||
SOFTPLUS=65
|
||||
GELU=66
|
||||
SILU=67
|
||||
SIGN=68
|
||||
DEGREES=69
|
||||
RADIANS=70
|
||||
LOGICAL_NOT=71
|
||||
LOGICAL_AND=72
|
||||
LOGICAL_OR=73
|
||||
HYPOT=74
|
||||
MAP=75
|
||||
EZCONV=76
|
||||
CONV=77
|
||||
SWAP=78
|
||||
TRANSPOSE=79
|
||||
PERM=80
|
||||
RESHAPE=81
|
||||
RANGE=82
|
||||
LINSPACE=83
|
||||
LOGSPACE=84
|
||||
TOPK=85
|
||||
BOTK=86
|
||||
PINV=87
|
||||
INV=88
|
||||
SUM=89
|
||||
MEAN=90
|
||||
STD=91
|
||||
VAR=92
|
||||
PROD=93
|
||||
ISCLOSE=94
|
||||
ALLCLOSE=95
|
||||
QUARTILE=96
|
||||
PERCENTILE=97
|
||||
QUANTILE=98
|
||||
DOT=99
|
||||
MOMENT=100
|
||||
ERF=101
|
||||
ERFC=102
|
||||
ERFINV=103
|
||||
ANY=104
|
||||
ALL=105
|
||||
EDGE=106
|
||||
GAUSSIAN=107
|
||||
MEDIAN=108
|
||||
MODE=109
|
||||
CUMSUM=110
|
||||
CUMPROD=111
|
||||
TOPK_IND=112
|
||||
BOTK_IND=113
|
||||
CUBIC_EASE=114
|
||||
ELASTIC_EASE=115
|
||||
SINE_EASE=116
|
||||
SMOOTHERSTEP=117
|
||||
DIST=118
|
||||
REMAP=119
|
||||
COSSIM=120
|
||||
COUNT=121
|
||||
KEYS=122
|
||||
ENABLE_TRACKING=123
|
||||
DISABLE_TRACKING=124
|
||||
RESET_TRACKING=125
|
||||
GET_CHANGED_KEYS=126
|
||||
GET_ADDED_KEYS=127
|
||||
GET_REMOVED_KEYS=128
|
||||
GET_UNCHANGED_KEYS=129
|
||||
REPEAT=130
|
||||
FLATTEN=131
|
||||
APPEND=132
|
||||
GET_VALUE=133
|
||||
FLOW_APPLY=134
|
||||
BATCH_SHUFFLE=135
|
||||
MOTION_MASK=136
|
||||
FLOW_TO_IMAGE=137
|
||||
FLOW_MAG=138
|
||||
FLOW_ANG=139
|
||||
WHERE=140
|
||||
HISTOGRAM=141
|
||||
OVERLAY=142
|
||||
PAD=143
|
||||
CROSS=144
|
||||
MATMUL=145
|
||||
SOLVE=146
|
||||
MATRIX_RANK=147
|
||||
RIFE=148
|
||||
BNOT=149
|
||||
BITCOUNT=150
|
||||
SHAPE=151
|
||||
BAND=152
|
||||
XOR=153
|
||||
BOR=154
|
||||
TENSOR=155
|
||||
ZEROS=156
|
||||
ONES=157
|
||||
EYE=158
|
||||
ONE_HOT=159
|
||||
MSE=160
|
||||
MAE=161
|
||||
PSNR=162
|
||||
WEIGHTED_MEAN=163
|
||||
HUBER_LOSS=164
|
||||
CROSS_ENTROPY=165
|
||||
ADD_KEY=166
|
||||
REMOVE_KEY=167
|
||||
PUSH=168
|
||||
POP=169
|
||||
CLEAR=170
|
||||
HAS=171
|
||||
GET=172
|
||||
CONCAT=173
|
||||
STACK=174
|
||||
NONZERO=175
|
||||
INT=176
|
||||
FLOAT=177
|
||||
UPPER=178
|
||||
LOWER=179
|
||||
TRIM=180
|
||||
SPLIT=181
|
||||
JOIN=182
|
||||
SUBSTRING=183
|
||||
FIND=184
|
||||
REPLACE=185
|
||||
DILATE=186
|
||||
ERODE=187
|
||||
MORPH_OPEN=188
|
||||
MORPH_CLOSE=189
|
||||
RGB_TO_OKLAB=190
|
||||
RGB_TO_CIELAB=191
|
||||
OKLAB_TO_RGB=192
|
||||
CIELAB_TO_RGB=193
|
||||
RGB_TO_HSV=194
|
||||
HSV_TO_RGB=195
|
||||
INT_TO_RGB=196
|
||||
RGB_TO_INT=197
|
||||
INTERPOLATE_LINEAR=198
|
||||
INTERPOLATE_AREA=199
|
||||
INTERPOLATE_NEAREST=200
|
||||
TEXT_IMAGE=201
|
||||
AS_NESTED=202
|
||||
SVD=203
|
||||
DIAG=204
|
||||
IF=205
|
||||
ELSE=206
|
||||
WHILE=207
|
||||
FOR=208
|
||||
IN=209
|
||||
BREAK=210
|
||||
CONTINUE=211
|
||||
RETURN=212
|
||||
TIMESTAMP=213
|
||||
SORT=214
|
||||
ARGSORT=215
|
||||
ARGMIN=216
|
||||
ARGMAX=217
|
||||
SOFTMAX=218
|
||||
SOFTMIN=219
|
||||
UNIQUE=220
|
||||
FLIP=221
|
||||
STARTSWITH=222
|
||||
ENDSWITH=223
|
||||
SQUEEZE=224
|
||||
UNSQUEEZE=225
|
||||
ROLL=226
|
||||
COV=227
|
||||
CORR=228
|
||||
ENTROPY=229
|
||||
CROP=230
|
||||
NONE=231
|
||||
COORDS=232
|
||||
GATHER=233
|
||||
SCATTER=234
|
||||
SCATTER_ADD=235
|
||||
NOISE=236
|
||||
PINK_NOISE=237
|
||||
BROWN_NOISE=238
|
||||
RAND=239
|
||||
CAUCHY=240
|
||||
EXPONENTIAL=241
|
||||
LOGNORMAL=242
|
||||
BERNOULLI=243
|
||||
POISSON=244
|
||||
GAMMADIST=245
|
||||
BETADIST=246
|
||||
LAPLACEDIST=247
|
||||
GUMBELDIST=248
|
||||
WEIBULLDIST=249
|
||||
CHI2DIST=250
|
||||
STUDENTTDIST=251
|
||||
PERLIN=252
|
||||
CELLULAR=253
|
||||
PLASMA=254
|
||||
RIDGED=255
|
||||
DOMAIN_WARP=256
|
||||
PLUS=257
|
||||
MINUS=258
|
||||
MULT=259
|
||||
DIV=260
|
||||
MOD=261
|
||||
POW=262
|
||||
LSHIFT=263
|
||||
RSHIFT=264
|
||||
GE=265
|
||||
GT=266
|
||||
LE=267
|
||||
LT=268
|
||||
EQ=269
|
||||
EQUEALS=270
|
||||
PLUS_EQ=271
|
||||
MINUS_EQ=272
|
||||
MULT_EQ=273
|
||||
DIV_EQ=274
|
||||
MOD_EQ=275
|
||||
NE=276
|
||||
PIPE=277
|
||||
LPAREN=278
|
||||
RPAREN=279
|
||||
COMMA=280
|
||||
SEMICOLON=281
|
||||
ARROW=282
|
||||
LBRACKET=283
|
||||
RBRACKET=284
|
||||
QUESTION=285
|
||||
COLON=286
|
||||
LBRACE=287
|
||||
RBRACE=288
|
||||
NUMBER=289
|
||||
CONSTANT=290
|
||||
STRING=291
|
||||
VARIABLE=292
|
||||
SL_COMMENT=293
|
||||
ML_COMMENT=294
|
||||
WS=295
|
||||
SIGM_KARRAS=50
|
||||
SIGM_EXPONENTIAL=51
|
||||
SIGM_POLYEXPONENTIAL=52
|
||||
SIGM_LAPLACE=53
|
||||
CLAMP=54
|
||||
SFFT=55
|
||||
SIFFT=56
|
||||
ANGL=57
|
||||
PRNT=58
|
||||
PRINT_SHAPE=59
|
||||
NVL=60
|
||||
LERP=61
|
||||
INTERP=62
|
||||
SLERP=63
|
||||
STEP=64
|
||||
SMOOTHSTEP=65
|
||||
FRACT=66
|
||||
RELU=67
|
||||
SOFTSIGN=68
|
||||
LEAKY_RELU=69
|
||||
SOFTPLUS=70
|
||||
GELU=71
|
||||
SILU=72
|
||||
SIGN=73
|
||||
DEGREES=74
|
||||
RADIANS=75
|
||||
LOGICAL_NOT=76
|
||||
LOGICAL_AND=77
|
||||
LOGICAL_OR=78
|
||||
HYPOT=79
|
||||
MAP=80
|
||||
EZCONV=81
|
||||
CONV=82
|
||||
SWAP=83
|
||||
TRANSPOSE=84
|
||||
PERM=85
|
||||
RESHAPE=86
|
||||
RANGE=87
|
||||
LINSPACE=88
|
||||
LOGSPACE=89
|
||||
TOPK=90
|
||||
BOTK=91
|
||||
PINV=92
|
||||
INV=93
|
||||
SUM=94
|
||||
MEAN=95
|
||||
STD=96
|
||||
VAR=97
|
||||
PROD=98
|
||||
ISCLOSE=99
|
||||
ALLCLOSE=100
|
||||
QUARTILE=101
|
||||
PERCENTILE=102
|
||||
QUANTILE=103
|
||||
DOT=104
|
||||
MOMENT=105
|
||||
ERF=106
|
||||
ERFC=107
|
||||
ERFINV=108
|
||||
ANY=109
|
||||
ALL=110
|
||||
EDGE=111
|
||||
DISTANCE_TRANSFORM=112
|
||||
GRAYSCALE=113
|
||||
GAUSSIAN=114
|
||||
MEDIAN=115
|
||||
MODE=116
|
||||
CUMSUM=117
|
||||
CUMPROD=118
|
||||
TOPK_IND=119
|
||||
BOTK_IND=120
|
||||
CUBIC_EASE=121
|
||||
ELASTIC_EASE=122
|
||||
SINE_EASE=123
|
||||
SMOOTHERSTEP=124
|
||||
DIST=125
|
||||
REMAP=126
|
||||
COSSIM=127
|
||||
COUNT=128
|
||||
KEYS=129
|
||||
ENABLE_TRACKING=130
|
||||
DISABLE_TRACKING=131
|
||||
RESET_TRACKING=132
|
||||
GET_CHANGED_KEYS=133
|
||||
GET_ADDED_KEYS=134
|
||||
GET_REMOVED_KEYS=135
|
||||
GET_UNCHANGED_KEYS=136
|
||||
REPEAT=137
|
||||
FLATTEN=138
|
||||
APPEND=139
|
||||
GET_VALUE=140
|
||||
FLOW_APPLY=141
|
||||
BATCH_SHUFFLE=142
|
||||
MOTION_MASK=143
|
||||
FLOW_TO_IMAGE=144
|
||||
FLOW_MAG=145
|
||||
FLOW_ANG=146
|
||||
WHERE=147
|
||||
HISTOGRAM=148
|
||||
OVERLAY=149
|
||||
BLEND=150
|
||||
PAD=151
|
||||
CROSS=152
|
||||
MATMUL=153
|
||||
SOLVE=154
|
||||
MATRIX_RANK=155
|
||||
RIFE=156
|
||||
BNOT=157
|
||||
BITCOUNT=158
|
||||
SHAPE=159
|
||||
BAND=160
|
||||
XOR=161
|
||||
BOR=162
|
||||
TENSOR=163
|
||||
ZEROS=164
|
||||
ONES=165
|
||||
EYE=166
|
||||
ONE_HOT=167
|
||||
MSE=168
|
||||
MAE=169
|
||||
PSNR=170
|
||||
WEIGHTED_MEAN=171
|
||||
HUBER_LOSS=172
|
||||
CROSS_ENTROPY=173
|
||||
ADD_KEY=174
|
||||
REMOVE_KEY=175
|
||||
PUSH=176
|
||||
POP=177
|
||||
CLEAR=178
|
||||
HAS=179
|
||||
GET=180
|
||||
CONCAT=181
|
||||
STACK=182
|
||||
NONZERO=183
|
||||
INT=184
|
||||
FLOAT=185
|
||||
UPPER=186
|
||||
LOWER=187
|
||||
TRIM=188
|
||||
SPLIT=189
|
||||
JOIN=190
|
||||
SUBSTRING=191
|
||||
FIND=192
|
||||
REPLACE=193
|
||||
REGEX_SEARCH=194
|
||||
REGEX_REPLACE=195
|
||||
FORMAT=196
|
||||
DILATE=197
|
||||
ERODE=198
|
||||
MORPH_OPEN=199
|
||||
MORPH_CLOSE=200
|
||||
RGB_TO_OKLAB=201
|
||||
LUMINANCE=202
|
||||
RGB_TO_CIELAB=203
|
||||
OKLAB_TO_RGB=204
|
||||
CIELAB_TO_RGB=205
|
||||
RGB_TO_HSV=206
|
||||
HSV_TO_RGB=207
|
||||
INT_TO_RGB=208
|
||||
RGB_TO_INT=209
|
||||
INTERPOLATE_LINEAR=210
|
||||
INTERPOLATE_AREA=211
|
||||
INTERPOLATE_NEAREST=212
|
||||
TEXT_IMAGE=213
|
||||
AS_NESTED=214
|
||||
SVD=215
|
||||
DIAG=216
|
||||
IF=217
|
||||
ELSE=218
|
||||
WHILE=219
|
||||
FOR=220
|
||||
IN=221
|
||||
BREAK=222
|
||||
CONTINUE=223
|
||||
RETURN=224
|
||||
TIMESTAMP=225
|
||||
SORT=226
|
||||
ARGSORT=227
|
||||
ARGMIN=228
|
||||
ARGMAX=229
|
||||
SOFTMAX=230
|
||||
SOFTMIN=231
|
||||
UNIQUE=232
|
||||
FLIP=233
|
||||
STARTSWITH=234
|
||||
ENDSWITH=235
|
||||
SQUEEZE=236
|
||||
UNSQUEEZE=237
|
||||
ROLL=238
|
||||
COV=239
|
||||
CORR=240
|
||||
ENTROPY=241
|
||||
CROP=242
|
||||
NONE=243
|
||||
COORDS=244
|
||||
GATHER=245
|
||||
SCATTER=246
|
||||
SCATTER_ADD=247
|
||||
NOISE=248
|
||||
PINK_NOISE=249
|
||||
BROWN_NOISE=250
|
||||
RAND=251
|
||||
CAUCHY=252
|
||||
EXPONENTIAL=253
|
||||
LOGNORMAL=254
|
||||
BERNOULLI=255
|
||||
POISSON=256
|
||||
GAMMADIST=257
|
||||
BETADIST=258
|
||||
LAPLACEDIST=259
|
||||
GUMBELDIST=260
|
||||
WEIBULLDIST=261
|
||||
CHI2DIST=262
|
||||
STUDENTTDIST=263
|
||||
PERLIN=264
|
||||
CELLULAR=265
|
||||
PLASMA=266
|
||||
RIDGED=267
|
||||
DOMAIN_WARP=268
|
||||
PLUS=269
|
||||
MINUS=270
|
||||
MULT=271
|
||||
DIV=272
|
||||
MOD=273
|
||||
POW=274
|
||||
LSHIFT=275
|
||||
RSHIFT=276
|
||||
GE=277
|
||||
GT=278
|
||||
LE=279
|
||||
LT=280
|
||||
EQ=281
|
||||
EQUEALS=282
|
||||
PLUS_EQ=283
|
||||
MINUS_EQ=284
|
||||
MULT_EQ=285
|
||||
DIV_EQ=286
|
||||
MOD_EQ=287
|
||||
NE=288
|
||||
PIPE=289
|
||||
LPAREN=290
|
||||
RPAREN=291
|
||||
COMMA=292
|
||||
SEMICOLON=293
|
||||
ARROW=294
|
||||
LBRACKET=295
|
||||
RBRACKET=296
|
||||
QUESTION=297
|
||||
COLON=298
|
||||
LBRACE=299
|
||||
RBRACE=300
|
||||
NUMBER=301
|
||||
CONSTANT=302
|
||||
STRING=303
|
||||
VARIABLE=304
|
||||
SL_COMMENT=305
|
||||
ML_COMMENT=306
|
||||
WS=307
|
||||
'sin'=1
|
||||
'cos'=2
|
||||
'tan'=3
|
||||
@@ -342,176 +354,188 @@ WS=295
|
||||
'gamma'=47
|
||||
'pow'=48
|
||||
'sigm'=49
|
||||
'clamp'=50
|
||||
'fft'=51
|
||||
'ifft'=52
|
||||
'angle'=53
|
||||
'print'=54
|
||||
'lerp'=57
|
||||
'slerp'=58
|
||||
'step'=59
|
||||
'smoothstep'=60
|
||||
'fract'=61
|
||||
'relu'=62
|
||||
'softsign'=63
|
||||
'leaky_relu'=64
|
||||
'softplus'=65
|
||||
'gelu'=66
|
||||
'silu'=67
|
||||
'sign'=68
|
||||
'degrees'=69
|
||||
'radians'=70
|
||||
'logical_not'=71
|
||||
'logical_and'=72
|
||||
'logical_or'=73
|
||||
'hypot'=74
|
||||
'map'=75
|
||||
'swap'=78
|
||||
'range'=82
|
||||
'linspace'=83
|
||||
'logspace'=84
|
||||
'topk'=85
|
||||
'botk'=86
|
||||
'pinv'=87
|
||||
'inv'=88
|
||||
'sum'=89
|
||||
'mean'=90
|
||||
'std'=91
|
||||
'var'=92
|
||||
'prod'=93
|
||||
'isclose'=94
|
||||
'allclose'=95
|
||||
'quantile'=98
|
||||
'dot'=99
|
||||
'moment'=100
|
||||
'erf'=101
|
||||
'erfc'=102
|
||||
'erfinv'=103
|
||||
'any'=104
|
||||
'all'=105
|
||||
'edge'=106
|
||||
'median'=108
|
||||
'mode'=109
|
||||
'cumsum'=110
|
||||
'cumprod'=111
|
||||
'smootherstep'=117
|
||||
'remap'=119
|
||||
'keys'=122
|
||||
'repeat'=130
|
||||
'flatten'=131
|
||||
'append'=132
|
||||
'get_value'=133
|
||||
'flow_apply'=134
|
||||
'motion_mask'=136
|
||||
'flow_to_image'=137
|
||||
'where'=140
|
||||
'overlay'=142
|
||||
'pad'=143
|
||||
'cross'=144
|
||||
'matmul'=145
|
||||
'solve'=146
|
||||
'matrix_rank'=147
|
||||
'rife'=148
|
||||
'shape'=151
|
||||
'tensor'=155
|
||||
'zeros'=156
|
||||
'ones'=157
|
||||
'eye'=158
|
||||
'one_hot'=159
|
||||
'mse'=160
|
||||
'mae'=161
|
||||
'psnr'=162
|
||||
'weighted_mean'=163
|
||||
'huber_loss'=164
|
||||
'cross_entropy'=165
|
||||
'add_key'=166
|
||||
'stack_push'=168
|
||||
'stack_pop'=169
|
||||
'stack_clear'=170
|
||||
'stack_has'=171
|
||||
'stack_get'=172
|
||||
'stack'=174
|
||||
'nonzero'=175
|
||||
'int'=176
|
||||
'float'=177
|
||||
'upper'=178
|
||||
'lower'=179
|
||||
'trim'=180
|
||||
'split'=181
|
||||
'join'=182
|
||||
'find'=184
|
||||
'replace'=185
|
||||
'dilate'=186
|
||||
'erode'=187
|
||||
'morph_open'=188
|
||||
'morph_close'=189
|
||||
'rgb_to_oklab'=190
|
||||
'rgb_to_cielab'=191
|
||||
'oklab_to_rgb'=192
|
||||
'cielab_to_rgb'=193
|
||||
'rgb_to_hsv'=194
|
||||
'hsv_to_rgb'=195
|
||||
'int_to_rgb'=196
|
||||
'rgb_to_int'=197
|
||||
'interpolate_linear'=198
|
||||
'interpolate_area'=199
|
||||
'text_image'=201
|
||||
'if'=205
|
||||
'else'=206
|
||||
'while'=207
|
||||
'for'=208
|
||||
'in'=209
|
||||
'break'=210
|
||||
'continue'=211
|
||||
'return'=212
|
||||
'sort'=214
|
||||
'argsort'=215
|
||||
'argmin'=216
|
||||
'argmax'=217
|
||||
'softmax'=218
|
||||
'softmin'=219
|
||||
'unique'=220
|
||||
'flip'=221
|
||||
'startswith'=222
|
||||
'endswith'=223
|
||||
'squeeze'=224
|
||||
'unsqueeze'=225
|
||||
'roll'=226
|
||||
'cov'=227
|
||||
'entropy'=229
|
||||
'crop'=230
|
||||
'gather'=233
|
||||
'scatter'=234
|
||||
'scatter_add'=235
|
||||
'+'=257
|
||||
'-'=258
|
||||
'*'=259
|
||||
'/'=260
|
||||
'%'=261
|
||||
'^'=262
|
||||
'<<'=263
|
||||
'>>'=264
|
||||
'>='=265
|
||||
'>'=266
|
||||
'<='=267
|
||||
'<'=268
|
||||
'=='=269
|
||||
'='=270
|
||||
'+='=271
|
||||
'-='=272
|
||||
'*='=273
|
||||
'/='=274
|
||||
'%='=275
|
||||
'!='=276
|
||||
'|'=277
|
||||
'('=278
|
||||
')'=279
|
||||
','=280
|
||||
';'=281
|
||||
'->'=282
|
||||
'['=283
|
||||
']'=284
|
||||
'?'=285
|
||||
':'=286
|
||||
'{'=287
|
||||
'}'=288
|
||||
'sigm_karras'=50
|
||||
'sigm_exponential'=51
|
||||
'sigm_polyexponential'=52
|
||||
'sigm_laplace'=53
|
||||
'clamp'=54
|
||||
'fft'=55
|
||||
'ifft'=56
|
||||
'angle'=57
|
||||
'print'=58
|
||||
'lerp'=61
|
||||
'interp'=62
|
||||
'slerp'=63
|
||||
'step'=64
|
||||
'smoothstep'=65
|
||||
'fract'=66
|
||||
'relu'=67
|
||||
'softsign'=68
|
||||
'leaky_relu'=69
|
||||
'softplus'=70
|
||||
'gelu'=71
|
||||
'silu'=72
|
||||
'sign'=73
|
||||
'degrees'=74
|
||||
'radians'=75
|
||||
'logical_not'=76
|
||||
'logical_and'=77
|
||||
'logical_or'=78
|
||||
'hypot'=79
|
||||
'map'=80
|
||||
'swap'=83
|
||||
'range'=87
|
||||
'linspace'=88
|
||||
'logspace'=89
|
||||
'topk'=90
|
||||
'botk'=91
|
||||
'pinv'=92
|
||||
'inv'=93
|
||||
'sum'=94
|
||||
'mean'=95
|
||||
'std'=96
|
||||
'var'=97
|
||||
'prod'=98
|
||||
'isclose'=99
|
||||
'allclose'=100
|
||||
'quantile'=103
|
||||
'dot'=104
|
||||
'moment'=105
|
||||
'erf'=106
|
||||
'erfc'=107
|
||||
'erfinv'=108
|
||||
'any'=109
|
||||
'all'=110
|
||||
'edge'=111
|
||||
'distance_transform'=112
|
||||
'grayscale'=113
|
||||
'median'=115
|
||||
'mode'=116
|
||||
'cumsum'=117
|
||||
'cumprod'=118
|
||||
'smootherstep'=124
|
||||
'remap'=126
|
||||
'keys'=129
|
||||
'repeat'=137
|
||||
'flatten'=138
|
||||
'append'=139
|
||||
'get_value'=140
|
||||
'flow_apply'=141
|
||||
'motion_mask'=143
|
||||
'flow_to_image'=144
|
||||
'where'=147
|
||||
'overlay'=149
|
||||
'blend'=150
|
||||
'pad'=151
|
||||
'cross'=152
|
||||
'matmul'=153
|
||||
'solve'=154
|
||||
'matrix_rank'=155
|
||||
'rife'=156
|
||||
'shape'=159
|
||||
'tensor'=163
|
||||
'zeros'=164
|
||||
'ones'=165
|
||||
'eye'=166
|
||||
'one_hot'=167
|
||||
'mse'=168
|
||||
'mae'=169
|
||||
'psnr'=170
|
||||
'weighted_mean'=171
|
||||
'huber_loss'=172
|
||||
'cross_entropy'=173
|
||||
'add_key'=174
|
||||
'stack_push'=176
|
||||
'stack_pop'=177
|
||||
'stack_clear'=178
|
||||
'stack_has'=179
|
||||
'stack_get'=180
|
||||
'stack'=182
|
||||
'nonzero'=183
|
||||
'int'=184
|
||||
'float'=185
|
||||
'upper'=186
|
||||
'lower'=187
|
||||
'trim'=188
|
||||
'split'=189
|
||||
'join'=190
|
||||
'find'=192
|
||||
'replace'=193
|
||||
'regex_search'=194
|
||||
'regex_replace'=195
|
||||
'format'=196
|
||||
'dilate'=197
|
||||
'erode'=198
|
||||
'morph_open'=199
|
||||
'morph_close'=200
|
||||
'rgb_to_oklab'=201
|
||||
'luminance'=202
|
||||
'rgb_to_cielab'=203
|
||||
'oklab_to_rgb'=204
|
||||
'cielab_to_rgb'=205
|
||||
'rgb_to_hsv'=206
|
||||
'hsv_to_rgb'=207
|
||||
'int_to_rgb'=208
|
||||
'rgb_to_int'=209
|
||||
'interpolate_linear'=210
|
||||
'interpolate_area'=211
|
||||
'text_image'=213
|
||||
'if'=217
|
||||
'else'=218
|
||||
'while'=219
|
||||
'for'=220
|
||||
'in'=221
|
||||
'break'=222
|
||||
'continue'=223
|
||||
'return'=224
|
||||
'sort'=226
|
||||
'argsort'=227
|
||||
'argmin'=228
|
||||
'argmax'=229
|
||||
'softmax'=230
|
||||
'softmin'=231
|
||||
'unique'=232
|
||||
'flip'=233
|
||||
'startswith'=234
|
||||
'endswith'=235
|
||||
'squeeze'=236
|
||||
'unsqueeze'=237
|
||||
'roll'=238
|
||||
'cov'=239
|
||||
'entropy'=241
|
||||
'crop'=242
|
||||
'gather'=245
|
||||
'scatter'=246
|
||||
'scatter_add'=247
|
||||
'+'=269
|
||||
'-'=270
|
||||
'*'=271
|
||||
'/'=272
|
||||
'%'=273
|
||||
'^'=274
|
||||
'<<'=275
|
||||
'>>'=276
|
||||
'>='=277
|
||||
'>'=278
|
||||
'<='=279
|
||||
'<'=280
|
||||
'=='=281
|
||||
'='=282
|
||||
'+='=283
|
||||
'-='=284
|
||||
'*='=285
|
||||
'/='=286
|
||||
'%='=287
|
||||
'!='=288
|
||||
'|'=289
|
||||
'('=290
|
||||
')'=291
|
||||
','=292
|
||||
';'=293
|
||||
'->'=294
|
||||
'['=295
|
||||
']'=296
|
||||
'?'=297
|
||||
':'=298
|
||||
'{'=299
|
||||
'}'=300
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1756
-1667
File diff suppressed because it is too large
Load Diff
@@ -47,252 +47,264 @@ ROUND=46
|
||||
GAMMA=47
|
||||
POWE=48
|
||||
SIGM=49
|
||||
CLAMP=50
|
||||
SFFT=51
|
||||
SIFFT=52
|
||||
ANGL=53
|
||||
PRNT=54
|
||||
PRINT_SHAPE=55
|
||||
NVL=56
|
||||
LERP=57
|
||||
SLERP=58
|
||||
STEP=59
|
||||
SMOOTHSTEP=60
|
||||
FRACT=61
|
||||
RELU=62
|
||||
SOFTSIGN=63
|
||||
LEAKY_RELU=64
|
||||
SOFTPLUS=65
|
||||
GELU=66
|
||||
SILU=67
|
||||
SIGN=68
|
||||
DEGREES=69
|
||||
RADIANS=70
|
||||
LOGICAL_NOT=71
|
||||
LOGICAL_AND=72
|
||||
LOGICAL_OR=73
|
||||
HYPOT=74
|
||||
MAP=75
|
||||
EZCONV=76
|
||||
CONV=77
|
||||
SWAP=78
|
||||
TRANSPOSE=79
|
||||
PERM=80
|
||||
RESHAPE=81
|
||||
RANGE=82
|
||||
LINSPACE=83
|
||||
LOGSPACE=84
|
||||
TOPK=85
|
||||
BOTK=86
|
||||
PINV=87
|
||||
INV=88
|
||||
SUM=89
|
||||
MEAN=90
|
||||
STD=91
|
||||
VAR=92
|
||||
PROD=93
|
||||
ISCLOSE=94
|
||||
ALLCLOSE=95
|
||||
QUARTILE=96
|
||||
PERCENTILE=97
|
||||
QUANTILE=98
|
||||
DOT=99
|
||||
MOMENT=100
|
||||
ERF=101
|
||||
ERFC=102
|
||||
ERFINV=103
|
||||
ANY=104
|
||||
ALL=105
|
||||
EDGE=106
|
||||
GAUSSIAN=107
|
||||
MEDIAN=108
|
||||
MODE=109
|
||||
CUMSUM=110
|
||||
CUMPROD=111
|
||||
TOPK_IND=112
|
||||
BOTK_IND=113
|
||||
CUBIC_EASE=114
|
||||
ELASTIC_EASE=115
|
||||
SINE_EASE=116
|
||||
SMOOTHERSTEP=117
|
||||
DIST=118
|
||||
REMAP=119
|
||||
COSSIM=120
|
||||
COUNT=121
|
||||
KEYS=122
|
||||
ENABLE_TRACKING=123
|
||||
DISABLE_TRACKING=124
|
||||
RESET_TRACKING=125
|
||||
GET_CHANGED_KEYS=126
|
||||
GET_ADDED_KEYS=127
|
||||
GET_REMOVED_KEYS=128
|
||||
GET_UNCHANGED_KEYS=129
|
||||
REPEAT=130
|
||||
FLATTEN=131
|
||||
APPEND=132
|
||||
GET_VALUE=133
|
||||
FLOW_APPLY=134
|
||||
BATCH_SHUFFLE=135
|
||||
MOTION_MASK=136
|
||||
FLOW_TO_IMAGE=137
|
||||
FLOW_MAG=138
|
||||
FLOW_ANG=139
|
||||
WHERE=140
|
||||
HISTOGRAM=141
|
||||
OVERLAY=142
|
||||
PAD=143
|
||||
CROSS=144
|
||||
MATMUL=145
|
||||
SOLVE=146
|
||||
MATRIX_RANK=147
|
||||
RIFE=148
|
||||
BNOT=149
|
||||
BITCOUNT=150
|
||||
SHAPE=151
|
||||
BAND=152
|
||||
XOR=153
|
||||
BOR=154
|
||||
TENSOR=155
|
||||
ZEROS=156
|
||||
ONES=157
|
||||
EYE=158
|
||||
ONE_HOT=159
|
||||
MSE=160
|
||||
MAE=161
|
||||
PSNR=162
|
||||
WEIGHTED_MEAN=163
|
||||
HUBER_LOSS=164
|
||||
CROSS_ENTROPY=165
|
||||
ADD_KEY=166
|
||||
REMOVE_KEY=167
|
||||
PUSH=168
|
||||
POP=169
|
||||
CLEAR=170
|
||||
HAS=171
|
||||
GET=172
|
||||
CONCAT=173
|
||||
STACK=174
|
||||
NONZERO=175
|
||||
INT=176
|
||||
FLOAT=177
|
||||
UPPER=178
|
||||
LOWER=179
|
||||
TRIM=180
|
||||
SPLIT=181
|
||||
JOIN=182
|
||||
SUBSTRING=183
|
||||
FIND=184
|
||||
REPLACE=185
|
||||
DILATE=186
|
||||
ERODE=187
|
||||
MORPH_OPEN=188
|
||||
MORPH_CLOSE=189
|
||||
RGB_TO_OKLAB=190
|
||||
RGB_TO_CIELAB=191
|
||||
OKLAB_TO_RGB=192
|
||||
CIELAB_TO_RGB=193
|
||||
RGB_TO_HSV=194
|
||||
HSV_TO_RGB=195
|
||||
INT_TO_RGB=196
|
||||
RGB_TO_INT=197
|
||||
INTERPOLATE_LINEAR=198
|
||||
INTERPOLATE_AREA=199
|
||||
INTERPOLATE_NEAREST=200
|
||||
TEXT_IMAGE=201
|
||||
AS_NESTED=202
|
||||
SVD=203
|
||||
DIAG=204
|
||||
IF=205
|
||||
ELSE=206
|
||||
WHILE=207
|
||||
FOR=208
|
||||
IN=209
|
||||
BREAK=210
|
||||
CONTINUE=211
|
||||
RETURN=212
|
||||
TIMESTAMP=213
|
||||
SORT=214
|
||||
ARGSORT=215
|
||||
ARGMIN=216
|
||||
ARGMAX=217
|
||||
SOFTMAX=218
|
||||
SOFTMIN=219
|
||||
UNIQUE=220
|
||||
FLIP=221
|
||||
STARTSWITH=222
|
||||
ENDSWITH=223
|
||||
SQUEEZE=224
|
||||
UNSQUEEZE=225
|
||||
ROLL=226
|
||||
COV=227
|
||||
CORR=228
|
||||
ENTROPY=229
|
||||
CROP=230
|
||||
NONE=231
|
||||
COORDS=232
|
||||
GATHER=233
|
||||
SCATTER=234
|
||||
SCATTER_ADD=235
|
||||
NOISE=236
|
||||
PINK_NOISE=237
|
||||
BROWN_NOISE=238
|
||||
RAND=239
|
||||
CAUCHY=240
|
||||
EXPONENTIAL=241
|
||||
LOGNORMAL=242
|
||||
BERNOULLI=243
|
||||
POISSON=244
|
||||
GAMMADIST=245
|
||||
BETADIST=246
|
||||
LAPLACEDIST=247
|
||||
GUMBELDIST=248
|
||||
WEIBULLDIST=249
|
||||
CHI2DIST=250
|
||||
STUDENTTDIST=251
|
||||
PERLIN=252
|
||||
CELLULAR=253
|
||||
PLASMA=254
|
||||
RIDGED=255
|
||||
DOMAIN_WARP=256
|
||||
PLUS=257
|
||||
MINUS=258
|
||||
MULT=259
|
||||
DIV=260
|
||||
MOD=261
|
||||
POW=262
|
||||
LSHIFT=263
|
||||
RSHIFT=264
|
||||
GE=265
|
||||
GT=266
|
||||
LE=267
|
||||
LT=268
|
||||
EQ=269
|
||||
EQUEALS=270
|
||||
PLUS_EQ=271
|
||||
MINUS_EQ=272
|
||||
MULT_EQ=273
|
||||
DIV_EQ=274
|
||||
MOD_EQ=275
|
||||
NE=276
|
||||
PIPE=277
|
||||
LPAREN=278
|
||||
RPAREN=279
|
||||
COMMA=280
|
||||
SEMICOLON=281
|
||||
ARROW=282
|
||||
LBRACKET=283
|
||||
RBRACKET=284
|
||||
QUESTION=285
|
||||
COLON=286
|
||||
LBRACE=287
|
||||
RBRACE=288
|
||||
NUMBER=289
|
||||
CONSTANT=290
|
||||
STRING=291
|
||||
VARIABLE=292
|
||||
SL_COMMENT=293
|
||||
ML_COMMENT=294
|
||||
WS=295
|
||||
SIGM_KARRAS=50
|
||||
SIGM_EXPONENTIAL=51
|
||||
SIGM_POLYEXPONENTIAL=52
|
||||
SIGM_LAPLACE=53
|
||||
CLAMP=54
|
||||
SFFT=55
|
||||
SIFFT=56
|
||||
ANGL=57
|
||||
PRNT=58
|
||||
PRINT_SHAPE=59
|
||||
NVL=60
|
||||
LERP=61
|
||||
INTERP=62
|
||||
SLERP=63
|
||||
STEP=64
|
||||
SMOOTHSTEP=65
|
||||
FRACT=66
|
||||
RELU=67
|
||||
SOFTSIGN=68
|
||||
LEAKY_RELU=69
|
||||
SOFTPLUS=70
|
||||
GELU=71
|
||||
SILU=72
|
||||
SIGN=73
|
||||
DEGREES=74
|
||||
RADIANS=75
|
||||
LOGICAL_NOT=76
|
||||
LOGICAL_AND=77
|
||||
LOGICAL_OR=78
|
||||
HYPOT=79
|
||||
MAP=80
|
||||
EZCONV=81
|
||||
CONV=82
|
||||
SWAP=83
|
||||
TRANSPOSE=84
|
||||
PERM=85
|
||||
RESHAPE=86
|
||||
RANGE=87
|
||||
LINSPACE=88
|
||||
LOGSPACE=89
|
||||
TOPK=90
|
||||
BOTK=91
|
||||
PINV=92
|
||||
INV=93
|
||||
SUM=94
|
||||
MEAN=95
|
||||
STD=96
|
||||
VAR=97
|
||||
PROD=98
|
||||
ISCLOSE=99
|
||||
ALLCLOSE=100
|
||||
QUARTILE=101
|
||||
PERCENTILE=102
|
||||
QUANTILE=103
|
||||
DOT=104
|
||||
MOMENT=105
|
||||
ERF=106
|
||||
ERFC=107
|
||||
ERFINV=108
|
||||
ANY=109
|
||||
ALL=110
|
||||
EDGE=111
|
||||
DISTANCE_TRANSFORM=112
|
||||
GRAYSCALE=113
|
||||
GAUSSIAN=114
|
||||
MEDIAN=115
|
||||
MODE=116
|
||||
CUMSUM=117
|
||||
CUMPROD=118
|
||||
TOPK_IND=119
|
||||
BOTK_IND=120
|
||||
CUBIC_EASE=121
|
||||
ELASTIC_EASE=122
|
||||
SINE_EASE=123
|
||||
SMOOTHERSTEP=124
|
||||
DIST=125
|
||||
REMAP=126
|
||||
COSSIM=127
|
||||
COUNT=128
|
||||
KEYS=129
|
||||
ENABLE_TRACKING=130
|
||||
DISABLE_TRACKING=131
|
||||
RESET_TRACKING=132
|
||||
GET_CHANGED_KEYS=133
|
||||
GET_ADDED_KEYS=134
|
||||
GET_REMOVED_KEYS=135
|
||||
GET_UNCHANGED_KEYS=136
|
||||
REPEAT=137
|
||||
FLATTEN=138
|
||||
APPEND=139
|
||||
GET_VALUE=140
|
||||
FLOW_APPLY=141
|
||||
BATCH_SHUFFLE=142
|
||||
MOTION_MASK=143
|
||||
FLOW_TO_IMAGE=144
|
||||
FLOW_MAG=145
|
||||
FLOW_ANG=146
|
||||
WHERE=147
|
||||
HISTOGRAM=148
|
||||
OVERLAY=149
|
||||
BLEND=150
|
||||
PAD=151
|
||||
CROSS=152
|
||||
MATMUL=153
|
||||
SOLVE=154
|
||||
MATRIX_RANK=155
|
||||
RIFE=156
|
||||
BNOT=157
|
||||
BITCOUNT=158
|
||||
SHAPE=159
|
||||
BAND=160
|
||||
XOR=161
|
||||
BOR=162
|
||||
TENSOR=163
|
||||
ZEROS=164
|
||||
ONES=165
|
||||
EYE=166
|
||||
ONE_HOT=167
|
||||
MSE=168
|
||||
MAE=169
|
||||
PSNR=170
|
||||
WEIGHTED_MEAN=171
|
||||
HUBER_LOSS=172
|
||||
CROSS_ENTROPY=173
|
||||
ADD_KEY=174
|
||||
REMOVE_KEY=175
|
||||
PUSH=176
|
||||
POP=177
|
||||
CLEAR=178
|
||||
HAS=179
|
||||
GET=180
|
||||
CONCAT=181
|
||||
STACK=182
|
||||
NONZERO=183
|
||||
INT=184
|
||||
FLOAT=185
|
||||
UPPER=186
|
||||
LOWER=187
|
||||
TRIM=188
|
||||
SPLIT=189
|
||||
JOIN=190
|
||||
SUBSTRING=191
|
||||
FIND=192
|
||||
REPLACE=193
|
||||
REGEX_SEARCH=194
|
||||
REGEX_REPLACE=195
|
||||
FORMAT=196
|
||||
DILATE=197
|
||||
ERODE=198
|
||||
MORPH_OPEN=199
|
||||
MORPH_CLOSE=200
|
||||
RGB_TO_OKLAB=201
|
||||
LUMINANCE=202
|
||||
RGB_TO_CIELAB=203
|
||||
OKLAB_TO_RGB=204
|
||||
CIELAB_TO_RGB=205
|
||||
RGB_TO_HSV=206
|
||||
HSV_TO_RGB=207
|
||||
INT_TO_RGB=208
|
||||
RGB_TO_INT=209
|
||||
INTERPOLATE_LINEAR=210
|
||||
INTERPOLATE_AREA=211
|
||||
INTERPOLATE_NEAREST=212
|
||||
TEXT_IMAGE=213
|
||||
AS_NESTED=214
|
||||
SVD=215
|
||||
DIAG=216
|
||||
IF=217
|
||||
ELSE=218
|
||||
WHILE=219
|
||||
FOR=220
|
||||
IN=221
|
||||
BREAK=222
|
||||
CONTINUE=223
|
||||
RETURN=224
|
||||
TIMESTAMP=225
|
||||
SORT=226
|
||||
ARGSORT=227
|
||||
ARGMIN=228
|
||||
ARGMAX=229
|
||||
SOFTMAX=230
|
||||
SOFTMIN=231
|
||||
UNIQUE=232
|
||||
FLIP=233
|
||||
STARTSWITH=234
|
||||
ENDSWITH=235
|
||||
SQUEEZE=236
|
||||
UNSQUEEZE=237
|
||||
ROLL=238
|
||||
COV=239
|
||||
CORR=240
|
||||
ENTROPY=241
|
||||
CROP=242
|
||||
NONE=243
|
||||
COORDS=244
|
||||
GATHER=245
|
||||
SCATTER=246
|
||||
SCATTER_ADD=247
|
||||
NOISE=248
|
||||
PINK_NOISE=249
|
||||
BROWN_NOISE=250
|
||||
RAND=251
|
||||
CAUCHY=252
|
||||
EXPONENTIAL=253
|
||||
LOGNORMAL=254
|
||||
BERNOULLI=255
|
||||
POISSON=256
|
||||
GAMMADIST=257
|
||||
BETADIST=258
|
||||
LAPLACEDIST=259
|
||||
GUMBELDIST=260
|
||||
WEIBULLDIST=261
|
||||
CHI2DIST=262
|
||||
STUDENTTDIST=263
|
||||
PERLIN=264
|
||||
CELLULAR=265
|
||||
PLASMA=266
|
||||
RIDGED=267
|
||||
DOMAIN_WARP=268
|
||||
PLUS=269
|
||||
MINUS=270
|
||||
MULT=271
|
||||
DIV=272
|
||||
MOD=273
|
||||
POW=274
|
||||
LSHIFT=275
|
||||
RSHIFT=276
|
||||
GE=277
|
||||
GT=278
|
||||
LE=279
|
||||
LT=280
|
||||
EQ=281
|
||||
EQUEALS=282
|
||||
PLUS_EQ=283
|
||||
MINUS_EQ=284
|
||||
MULT_EQ=285
|
||||
DIV_EQ=286
|
||||
MOD_EQ=287
|
||||
NE=288
|
||||
PIPE=289
|
||||
LPAREN=290
|
||||
RPAREN=291
|
||||
COMMA=292
|
||||
SEMICOLON=293
|
||||
ARROW=294
|
||||
LBRACKET=295
|
||||
RBRACKET=296
|
||||
QUESTION=297
|
||||
COLON=298
|
||||
LBRACE=299
|
||||
RBRACE=300
|
||||
NUMBER=301
|
||||
CONSTANT=302
|
||||
STRING=303
|
||||
VARIABLE=304
|
||||
SL_COMMENT=305
|
||||
ML_COMMENT=306
|
||||
WS=307
|
||||
'sin'=1
|
||||
'cos'=2
|
||||
'tan'=3
|
||||
@@ -342,176 +354,188 @@ WS=295
|
||||
'gamma'=47
|
||||
'pow'=48
|
||||
'sigm'=49
|
||||
'clamp'=50
|
||||
'fft'=51
|
||||
'ifft'=52
|
||||
'angle'=53
|
||||
'print'=54
|
||||
'lerp'=57
|
||||
'slerp'=58
|
||||
'step'=59
|
||||
'smoothstep'=60
|
||||
'fract'=61
|
||||
'relu'=62
|
||||
'softsign'=63
|
||||
'leaky_relu'=64
|
||||
'softplus'=65
|
||||
'gelu'=66
|
||||
'silu'=67
|
||||
'sign'=68
|
||||
'degrees'=69
|
||||
'radians'=70
|
||||
'logical_not'=71
|
||||
'logical_and'=72
|
||||
'logical_or'=73
|
||||
'hypot'=74
|
||||
'map'=75
|
||||
'swap'=78
|
||||
'range'=82
|
||||
'linspace'=83
|
||||
'logspace'=84
|
||||
'topk'=85
|
||||
'botk'=86
|
||||
'pinv'=87
|
||||
'inv'=88
|
||||
'sum'=89
|
||||
'mean'=90
|
||||
'std'=91
|
||||
'var'=92
|
||||
'prod'=93
|
||||
'isclose'=94
|
||||
'allclose'=95
|
||||
'quantile'=98
|
||||
'dot'=99
|
||||
'moment'=100
|
||||
'erf'=101
|
||||
'erfc'=102
|
||||
'erfinv'=103
|
||||
'any'=104
|
||||
'all'=105
|
||||
'edge'=106
|
||||
'median'=108
|
||||
'mode'=109
|
||||
'cumsum'=110
|
||||
'cumprod'=111
|
||||
'smootherstep'=117
|
||||
'remap'=119
|
||||
'keys'=122
|
||||
'repeat'=130
|
||||
'flatten'=131
|
||||
'append'=132
|
||||
'get_value'=133
|
||||
'flow_apply'=134
|
||||
'motion_mask'=136
|
||||
'flow_to_image'=137
|
||||
'where'=140
|
||||
'overlay'=142
|
||||
'pad'=143
|
||||
'cross'=144
|
||||
'matmul'=145
|
||||
'solve'=146
|
||||
'matrix_rank'=147
|
||||
'rife'=148
|
||||
'shape'=151
|
||||
'tensor'=155
|
||||
'zeros'=156
|
||||
'ones'=157
|
||||
'eye'=158
|
||||
'one_hot'=159
|
||||
'mse'=160
|
||||
'mae'=161
|
||||
'psnr'=162
|
||||
'weighted_mean'=163
|
||||
'huber_loss'=164
|
||||
'cross_entropy'=165
|
||||
'add_key'=166
|
||||
'stack_push'=168
|
||||
'stack_pop'=169
|
||||
'stack_clear'=170
|
||||
'stack_has'=171
|
||||
'stack_get'=172
|
||||
'stack'=174
|
||||
'nonzero'=175
|
||||
'int'=176
|
||||
'float'=177
|
||||
'upper'=178
|
||||
'lower'=179
|
||||
'trim'=180
|
||||
'split'=181
|
||||
'join'=182
|
||||
'find'=184
|
||||
'replace'=185
|
||||
'dilate'=186
|
||||
'erode'=187
|
||||
'morph_open'=188
|
||||
'morph_close'=189
|
||||
'rgb_to_oklab'=190
|
||||
'rgb_to_cielab'=191
|
||||
'oklab_to_rgb'=192
|
||||
'cielab_to_rgb'=193
|
||||
'rgb_to_hsv'=194
|
||||
'hsv_to_rgb'=195
|
||||
'int_to_rgb'=196
|
||||
'rgb_to_int'=197
|
||||
'interpolate_linear'=198
|
||||
'interpolate_area'=199
|
||||
'text_image'=201
|
||||
'if'=205
|
||||
'else'=206
|
||||
'while'=207
|
||||
'for'=208
|
||||
'in'=209
|
||||
'break'=210
|
||||
'continue'=211
|
||||
'return'=212
|
||||
'sort'=214
|
||||
'argsort'=215
|
||||
'argmin'=216
|
||||
'argmax'=217
|
||||
'softmax'=218
|
||||
'softmin'=219
|
||||
'unique'=220
|
||||
'flip'=221
|
||||
'startswith'=222
|
||||
'endswith'=223
|
||||
'squeeze'=224
|
||||
'unsqueeze'=225
|
||||
'roll'=226
|
||||
'cov'=227
|
||||
'entropy'=229
|
||||
'crop'=230
|
||||
'gather'=233
|
||||
'scatter'=234
|
||||
'scatter_add'=235
|
||||
'+'=257
|
||||
'-'=258
|
||||
'*'=259
|
||||
'/'=260
|
||||
'%'=261
|
||||
'^'=262
|
||||
'<<'=263
|
||||
'>>'=264
|
||||
'>='=265
|
||||
'>'=266
|
||||
'<='=267
|
||||
'<'=268
|
||||
'=='=269
|
||||
'='=270
|
||||
'+='=271
|
||||
'-='=272
|
||||
'*='=273
|
||||
'/='=274
|
||||
'%='=275
|
||||
'!='=276
|
||||
'|'=277
|
||||
'('=278
|
||||
')'=279
|
||||
','=280
|
||||
';'=281
|
||||
'->'=282
|
||||
'['=283
|
||||
']'=284
|
||||
'?'=285
|
||||
':'=286
|
||||
'{'=287
|
||||
'}'=288
|
||||
'sigm_karras'=50
|
||||
'sigm_exponential'=51
|
||||
'sigm_polyexponential'=52
|
||||
'sigm_laplace'=53
|
||||
'clamp'=54
|
||||
'fft'=55
|
||||
'ifft'=56
|
||||
'angle'=57
|
||||
'print'=58
|
||||
'lerp'=61
|
||||
'interp'=62
|
||||
'slerp'=63
|
||||
'step'=64
|
||||
'smoothstep'=65
|
||||
'fract'=66
|
||||
'relu'=67
|
||||
'softsign'=68
|
||||
'leaky_relu'=69
|
||||
'softplus'=70
|
||||
'gelu'=71
|
||||
'silu'=72
|
||||
'sign'=73
|
||||
'degrees'=74
|
||||
'radians'=75
|
||||
'logical_not'=76
|
||||
'logical_and'=77
|
||||
'logical_or'=78
|
||||
'hypot'=79
|
||||
'map'=80
|
||||
'swap'=83
|
||||
'range'=87
|
||||
'linspace'=88
|
||||
'logspace'=89
|
||||
'topk'=90
|
||||
'botk'=91
|
||||
'pinv'=92
|
||||
'inv'=93
|
||||
'sum'=94
|
||||
'mean'=95
|
||||
'std'=96
|
||||
'var'=97
|
||||
'prod'=98
|
||||
'isclose'=99
|
||||
'allclose'=100
|
||||
'quantile'=103
|
||||
'dot'=104
|
||||
'moment'=105
|
||||
'erf'=106
|
||||
'erfc'=107
|
||||
'erfinv'=108
|
||||
'any'=109
|
||||
'all'=110
|
||||
'edge'=111
|
||||
'distance_transform'=112
|
||||
'grayscale'=113
|
||||
'median'=115
|
||||
'mode'=116
|
||||
'cumsum'=117
|
||||
'cumprod'=118
|
||||
'smootherstep'=124
|
||||
'remap'=126
|
||||
'keys'=129
|
||||
'repeat'=137
|
||||
'flatten'=138
|
||||
'append'=139
|
||||
'get_value'=140
|
||||
'flow_apply'=141
|
||||
'motion_mask'=143
|
||||
'flow_to_image'=144
|
||||
'where'=147
|
||||
'overlay'=149
|
||||
'blend'=150
|
||||
'pad'=151
|
||||
'cross'=152
|
||||
'matmul'=153
|
||||
'solve'=154
|
||||
'matrix_rank'=155
|
||||
'rife'=156
|
||||
'shape'=159
|
||||
'tensor'=163
|
||||
'zeros'=164
|
||||
'ones'=165
|
||||
'eye'=166
|
||||
'one_hot'=167
|
||||
'mse'=168
|
||||
'mae'=169
|
||||
'psnr'=170
|
||||
'weighted_mean'=171
|
||||
'huber_loss'=172
|
||||
'cross_entropy'=173
|
||||
'add_key'=174
|
||||
'stack_push'=176
|
||||
'stack_pop'=177
|
||||
'stack_clear'=178
|
||||
'stack_has'=179
|
||||
'stack_get'=180
|
||||
'stack'=182
|
||||
'nonzero'=183
|
||||
'int'=184
|
||||
'float'=185
|
||||
'upper'=186
|
||||
'lower'=187
|
||||
'trim'=188
|
||||
'split'=189
|
||||
'join'=190
|
||||
'find'=192
|
||||
'replace'=193
|
||||
'regex_search'=194
|
||||
'regex_replace'=195
|
||||
'format'=196
|
||||
'dilate'=197
|
||||
'erode'=198
|
||||
'morph_open'=199
|
||||
'morph_close'=200
|
||||
'rgb_to_oklab'=201
|
||||
'luminance'=202
|
||||
'rgb_to_cielab'=203
|
||||
'oklab_to_rgb'=204
|
||||
'cielab_to_rgb'=205
|
||||
'rgb_to_hsv'=206
|
||||
'hsv_to_rgb'=207
|
||||
'int_to_rgb'=208
|
||||
'rgb_to_int'=209
|
||||
'interpolate_linear'=210
|
||||
'interpolate_area'=211
|
||||
'text_image'=213
|
||||
'if'=217
|
||||
'else'=218
|
||||
'while'=219
|
||||
'for'=220
|
||||
'in'=221
|
||||
'break'=222
|
||||
'continue'=223
|
||||
'return'=224
|
||||
'sort'=226
|
||||
'argsort'=227
|
||||
'argmin'=228
|
||||
'argmax'=229
|
||||
'softmax'=230
|
||||
'softmin'=231
|
||||
'unique'=232
|
||||
'flip'=233
|
||||
'startswith'=234
|
||||
'endswith'=235
|
||||
'squeeze'=236
|
||||
'unsqueeze'=237
|
||||
'roll'=238
|
||||
'cov'=239
|
||||
'entropy'=241
|
||||
'crop'=242
|
||||
'gather'=245
|
||||
'scatter'=246
|
||||
'scatter_add'=247
|
||||
'+'=269
|
||||
'-'=270
|
||||
'*'=271
|
||||
'/'=272
|
||||
'%'=273
|
||||
'^'=274
|
||||
'<<'=275
|
||||
'>>'=276
|
||||
'>='=277
|
||||
'>'=278
|
||||
'<='=279
|
||||
'<'=280
|
||||
'=='=281
|
||||
'='=282
|
||||
'+='=283
|
||||
'-='=284
|
||||
'*='=285
|
||||
'/='=286
|
||||
'%='=287
|
||||
'!='=288
|
||||
'|'=289
|
||||
'('=290
|
||||
')'=291
|
||||
','=292
|
||||
';'=293
|
||||
'->'=294
|
||||
'['=295
|
||||
']'=296
|
||||
'?'=297
|
||||
':'=298
|
||||
'{'=299
|
||||
'}'=300
|
||||
|
||||
@@ -1250,6 +1250,24 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#DistanceTransformFunc.
|
||||
def enterDistanceTransformFunc(self, ctx:MathExprParser.DistanceTransformFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#DistanceTransformFunc.
|
||||
def exitDistanceTransformFunc(self, ctx:MathExprParser.DistanceTransformFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#GrayscaleFunc.
|
||||
def enterGrayscaleFunc(self, ctx:MathExprParser.GrayscaleFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#GrayscaleFunc.
|
||||
def exitGrayscaleFunc(self, ctx:MathExprParser.GrayscaleFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#MedianFunc.
|
||||
def enterMedianFunc(self, ctx:MathExprParser.MedianFuncContext):
|
||||
pass
|
||||
@@ -2222,6 +2240,33 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#RegexSearchFunc.
|
||||
def enterRegexSearchFunc(self, ctx:MathExprParser.RegexSearchFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#RegexSearchFunc.
|
||||
def exitRegexSearchFunc(self, ctx:MathExprParser.RegexSearchFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#RegexReplaceFunc.
|
||||
def enterRegexReplaceFunc(self, ctx:MathExprParser.RegexReplaceFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#RegexReplaceFunc.
|
||||
def exitRegexReplaceFunc(self, ctx:MathExprParser.RegexReplaceFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#FormatFunc.
|
||||
def enterFormatFunc(self, ctx:MathExprParser.FormatFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#FormatFunc.
|
||||
def exitFormatFunc(self, ctx:MathExprParser.FormatFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#Int_to_rgbFunc.
|
||||
def enterInt_to_rgbFunc(self, ctx:MathExprParser.Int_to_rgbFuncContext):
|
||||
pass
|
||||
@@ -2402,6 +2447,60 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#BlendFunc.
|
||||
def enterBlendFunc(self, ctx:MathExprParser.BlendFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#BlendFunc.
|
||||
def exitBlendFunc(self, ctx:MathExprParser.BlendFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#InterpFunc.
|
||||
def enterInterpFunc(self, ctx:MathExprParser.InterpFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#InterpFunc.
|
||||
def exitInterpFunc(self, ctx:MathExprParser.InterpFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmKarrasFunc.
|
||||
def enterSigmKarrasFunc(self, ctx:MathExprParser.SigmKarrasFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmKarrasFunc.
|
||||
def exitSigmKarrasFunc(self, ctx:MathExprParser.SigmKarrasFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmExponentialFunc.
|
||||
def enterSigmExponentialFunc(self, ctx:MathExprParser.SigmExponentialFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmExponentialFunc.
|
||||
def exitSigmExponentialFunc(self, ctx:MathExprParser.SigmExponentialFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmPolyexponentialFunc.
|
||||
def enterSigmPolyexponentialFunc(self, ctx:MathExprParser.SigmPolyexponentialFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmPolyexponentialFunc.
|
||||
def exitSigmPolyexponentialFunc(self, ctx:MathExprParser.SigmPolyexponentialFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmLaplaceFunc.
|
||||
def enterSigmLaplaceFunc(self, ctx:MathExprParser.SigmLaplaceFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmLaplaceFunc.
|
||||
def exitSigmLaplaceFunc(self, ctx:MathExprParser.SigmLaplaceFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#LinspaceFunc.
|
||||
def enterLinspaceFunc(self, ctx:MathExprParser.LinspaceFuncContext):
|
||||
pass
|
||||
@@ -2438,6 +2537,15 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#LuminanceFunc.
|
||||
def enterLuminanceFunc(self, ctx:MathExprParser.LuminanceFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#LuminanceFunc.
|
||||
def exitLuminanceFunc(self, ctx:MathExprParser.LuminanceFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#RgbToHsvFunc.
|
||||
def enterRgbToHsvFunc(self, ctx:MathExprParser.RgbToHsvFuncContext):
|
||||
pass
|
||||
|
||||
+4867
-4033
File diff suppressed because it is too large
Load Diff
@@ -699,6 +699,16 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#DistanceTransformFunc.
|
||||
def visitDistanceTransformFunc(self, ctx:MathExprParser.DistanceTransformFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#GrayscaleFunc.
|
||||
def visitGrayscaleFunc(self, ctx:MathExprParser.GrayscaleFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#MedianFunc.
|
||||
def visitMedianFunc(self, ctx:MathExprParser.MedianFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
@@ -1239,6 +1249,21 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#RegexSearchFunc.
|
||||
def visitRegexSearchFunc(self, ctx:MathExprParser.RegexSearchFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#RegexReplaceFunc.
|
||||
def visitRegexReplaceFunc(self, ctx:MathExprParser.RegexReplaceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#FormatFunc.
|
||||
def visitFormatFunc(self, ctx:MathExprParser.FormatFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#Int_to_rgbFunc.
|
||||
def visitInt_to_rgbFunc(self, ctx:MathExprParser.Int_to_rgbFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
@@ -1339,6 +1364,36 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#BlendFunc.
|
||||
def visitBlendFunc(self, ctx:MathExprParser.BlendFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#InterpFunc.
|
||||
def visitInterpFunc(self, ctx:MathExprParser.InterpFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmKarrasFunc.
|
||||
def visitSigmKarrasFunc(self, ctx:MathExprParser.SigmKarrasFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmExponentialFunc.
|
||||
def visitSigmExponentialFunc(self, ctx:MathExprParser.SigmExponentialFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmPolyexponentialFunc.
|
||||
def visitSigmPolyexponentialFunc(self, ctx:MathExprParser.SigmPolyexponentialFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmLaplaceFunc.
|
||||
def visitSigmLaplaceFunc(self, ctx:MathExprParser.SigmLaplaceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#LinspaceFunc.
|
||||
def visitLinspaceFunc(self, ctx:MathExprParser.LinspaceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
@@ -1359,6 +1414,11 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#LuminanceFunc.
|
||||
def visitLuminanceFunc(self, ctx:MathExprParser.LuminanceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#RgbToHsvFunc.
|
||||
def visitRgbToHsvFunc(self, ctx:MathExprParser.RgbToHsvFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
@@ -6,7 +6,7 @@ INBUILT_CONSTANTS = {
|
||||
'e', 'E', 'pi', 'PI'
|
||||
}
|
||||
INBUILT_FUNCTIONS = {
|
||||
'abs', 'acos', 'acosh', 'add_key', 'added_keys', 'all', 'allclose', 'angle', 'any', 'append', 'argmax', 'argmin', 'argsort', 'as_nested', 'as_nested_tensor', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'band', 'batch_shuffle', 'bitcount', 'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'blur', 'bnot', 'bor', 'botk', 'botk_ind', 'botk_indices', 'brown', 'brown_noise', 'bxor', 'cat', 'cbrt', 'ceil', 'cellular', 'cellular_noise', 'changed_keys', 'cielab_to_rgb', 'clamp', 'cnt', 'concat', 'concatenate', 'conv', 'convolution', 'coordinates', 'coords', 'corr', 'correlation', 'cos', 'cosh', 'cosine_similarity', 'cossim', 'count', 'cov', 'crop', 'cross', 'cross_entropy', 'cubic', 'cubic_ease', 'cumprod', 'cumsum', 'degrees', 'det', 'diag', 'diagonal_matrix', 'dilate', 'disable_tracking', 'dist', 'distance', 'domain_warp', 'domain_warp_noise', 'dot', 'edge', 'elastic', 'elastic_ease', 'enable_tracking', 'endswith', 'entropy', 'erf', 'erfc', 'erfinv', 'erode', 'exp', 'expm1', 'eye', 'ezconv', 'ezconvolution', 'fft', 'find', 'flatten', 'flip', 'float', 'floor', 'flow_ang', 'flow_angle', 'flow_apply', 'flow_mag', 'flow_magnitude', 'flow_to_image', 'fract', 'gamma', 'gather', 'gaussian', 'gelu', 'get_added_keys', 'get_changed_keys', 'get_removed_keys', 'get_unchanged_keys', 'get_value', 'group_norm', 'hist', 'histogram', 'hsv_to_rgb', 'huber_loss', 'hypot', 'ifft', 'int', 'int_to_rgb', 'interpolate_area', 'interpolate_linear', 'interpolate_nearest', 'interpolate_nearest_exact', 'inv', 'irfft', 'isclose', 'isfinite', 'isinf', 'isnan', 'join', 'keys', 'leaky_relu', 'length', 'lerp', 'linspace', 'ln', 'log', 'log1p', 'log2', 'logaddexp', 'logical_and', 'logical_not', 'logical_or', 'logspace', 'logsumexp', 'lower', 'mae', 'map', 'matmul', 'matrix_rank', 'mean', 'median', 'mode', 'moment', 'morph_close', 'morph_open', 'motion_mask', 'mse', 'nan_to_num', 'noise', 'nonzero', 'norm', 'normalize', 'now', 'nvl', 'oklab_to_rgb', 'one_hot', 'ones', 'outer', 'overlay', 'pad', 'percentile', 'perlin', 'perlin_noise', 'perm', 'permute', 'pink', 'pink_noise', 'pinv', 'plasma', 'plasma_noise', 'popcnt', 'popcount', 'pow', 'prcnt', 'print', 'print_shape', 'prod', 'pshp', 'psnr', 'quantile', 'quartil', 'quartile', 'radians', 'rand', 'randb', 'randbeta', 'randc', 'randchi2', 'rande', 'randg', 'randgumbel', 'randl', 'randln', 'randn', 'random_bernoulli', 'random_beta', 'random_cauchy', 'random_chi2', 'random_exponential', 'random_gamma', 'random_gumbel', 'random_laplace', 'random_log_normal', 'random_normal', 'random_poisson', 'random_studentt', 'random_uniform', 'random_weibull', 'randp', 'randt', 'randu', 'randw', 'range', 'reciprocal', 'relu', 'remap', 'remove_key', 'removed_keys', 'repeat', 'replace', 'reset_tracking', 'reshape', 'rfft', 'rgb_to_cielab', 'rgb_to_hsv', 'rgb_to_int', 'rgb_to_oklab', 'ridged', 'ridged_noise', 'rife', 'rm_key', 'roll', 'round', 'rshp', 'scatter', 'scatter_add', 'select', 'shape', 'shuffle', 'sigm', 'sign', 'silu', 'sin', 'sinc', 'sine', 'sine_ease', 'singular_value_decomposition', 'sinh', 'slerp', 'smax', 'smin', 'smootherstep', 'smoothstep', 'snorm', 'softmax', 'softmin', 'softplus', 'softsign', 'solve', 'sort', 'split', 'sqrt', 'squeeze', 'stack', 'stack_clear', 'stack_get', 'stack_has', 'stack_pop', 'stack_push', 'startswith', 'std', 'step', 'substr', 'substring', 'sum', 'svd', 'swap', 'swapaxes', 'tan', 'tanh', 'tensor', 'text_image', 'timestamp', 'tmax', 'tmin', 'tnorm', 'topk', 'topk_ind', 'topk_indices', 'trace', 'track_off', 'track_on', 'track_reset', 'transpose', 'trim', 'turbulence', 'unchanged_keys', 'unique', 'unsqueeze', 'upper', 'var', 'voronoi', 'voronoi_noise', 'weighted_mean', 'where', 'worley', 'zeros'
|
||||
'abs', 'acos', 'acosh', 'add_key', 'added_keys', 'all', 'allclose', 'angle', 'any', 'append', 'argmax', 'argmin', 'argsort', 'as_nested', 'as_nested_tensor', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'band', 'batch_shuffle', 'bitcount', 'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'blend', 'blur', 'bnot', 'bor', 'botk', 'botk_ind', 'botk_indices', 'brown', 'brown_noise', 'bxor', 'cat', 'cbrt', 'ceil', 'cellular', 'cellular_noise', 'changed_keys', 'cielab_to_rgb', 'clamp', 'cnt', 'concat', 'concatenate', 'conv', 'convolution', 'coordinates', 'coords', 'corr', 'correlation', 'cos', 'cosh', 'cosine_similarity', 'cossim', 'count', 'cov', 'crop', 'cross', 'cross_entropy', 'cubic', 'cubic_ease', 'cumprod', 'cumsum', 'degrees', 'det', 'diag', 'diagonal_matrix', 'dilate', 'disable_tracking', 'dist', 'distance', 'distance_transform', 'domain_warp', 'domain_warp_noise', 'dot', 'edge', 'elastic', 'elastic_ease', 'enable_tracking', 'endswith', 'entropy', 'erf', 'erfc', 'erfinv', 'erode', 'exp', 'expm1', 'eye', 'ezconv', 'ezconvolution', 'fft', 'find', 'flatten', 'flip', 'float', 'floor', 'flow_ang', 'flow_angle', 'flow_apply', 'flow_mag', 'flow_magnitude', 'flow_to_image', 'format', 'fract', 'gamma', 'gather', 'gaussian', 'gelu', 'get_added_keys', 'get_changed_keys', 'get_removed_keys', 'get_unchanged_keys', 'get_value', 'grayscale', 'group_norm', 'hist', 'histogram', 'hsv_to_rgb', 'huber_loss', 'hypot', 'ifft', 'int', 'int_to_rgb', 'interp', 'interpolate_area', 'interpolate_linear', 'interpolate_nearest', 'interpolate_nearest_exact', 'inv', 'irfft', 'isclose', 'isfinite', 'isinf', 'isnan', 'join', 'keys', 'leaky_relu', 'length', 'lerp', 'linspace', 'ln', 'log', 'log1p', 'log2', 'logaddexp', 'logical_and', 'logical_not', 'logical_or', 'logspace', 'logsumexp', 'lower', 'luminance', 'mae', 'map', 'matmul', 'matrix_rank', 'mean', 'median', 'mode', 'moment', 'morph_close', 'morph_open', 'motion_mask', 'mse', 'nan_to_num', 'noise', 'nonzero', 'norm', 'normalize', 'now', 'nvl', 'oklab_to_rgb', 'one_hot', 'ones', 'outer', 'overlay', 'pad', 'percentile', 'perlin', 'perlin_noise', 'perm', 'permute', 'pink', 'pink_noise', 'pinv', 'plasma', 'plasma_noise', 'popcnt', 'popcount', 'pow', 'prcnt', 'print', 'print_shape', 'prod', 'pshp', 'psnr', 'quantile', 'quartil', 'quartile', 'radians', 'rand', 'randb', 'randbeta', 'randc', 'randchi2', 'rande', 'randg', 'randgumbel', 'randl', 'randln', 'randn', 'random_bernoulli', 'random_beta', 'random_cauchy', 'random_chi2', 'random_exponential', 'random_gamma', 'random_gumbel', 'random_laplace', 'random_log_normal', 'random_normal', 'random_poisson', 'random_studentt', 'random_uniform', 'random_weibull', 'randp', 'randt', 'randu', 'randw', 'range', 'reciprocal', 'regex_replace', 'regex_search', 'relu', 'remap', 'remove_key', 'removed_keys', 'repeat', 'replace', 'reset_tracking', 'reshape', 'rfft', 'rgb_to_cielab', 'rgb_to_hsv', 'rgb_to_int', 'rgb_to_oklab', 'ridged', 'ridged_noise', 'rife', 'rm_key', 'roll', 'round', 'rshp', 'scatter', 'scatter_add', 'select', 'shape', 'shuffle', 'sigm', 'sigm_exponential', 'sigm_karras', 'sigm_laplace', 'sigm_polyexponential', 'sign', 'silu', 'sin', 'sinc', 'sine', 'sine_ease', 'singular_value_decomposition', 'sinh', 'slerp', 'smax', 'smin', 'smootherstep', 'smoothstep', 'snorm', 'softmax', 'softmin', 'softplus', 'softsign', 'solve', 'sort', 'split', 'sqrt', 'squeeze', 'stack', 'stack_clear', 'stack_get', 'stack_has', 'stack_pop', 'stack_push', 'startswith', 'std', 'step', 'substr', 'substring', 'sum', 'svd', 'swap', 'swapaxes', 'tan', 'tanh', 'tensor', 'text_image', 'timestamp', 'tmax', 'tmin', 'tnorm', 'topk', 'topk_ind', 'topk_indices', 'trace', 'track_off', 'track_on', 'track_reset', 'transpose', 'trim', 'turbulence', 'unchanged_keys', 'unique', 'unsqueeze', 'upper', 'var', 'voronoi', 'voronoi_noise', 'weighted_mean', 'where', 'worley', 'zeros'
|
||||
}
|
||||
|
||||
INBUILT_FUNCTION_META = {
|
||||
@@ -59,6 +59,10 @@ INBUILT_FUNCTION_META = {
|
||||
'gamma': {'min_args': 1, 'max_args': 1, 'signature': 'gamma(x)', 'forms': [['x']], 'description': 'computes the gamma function (per element)', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
|
||||
'pow': {'min_args': 2, 'max_args': 2, 'signature': 'pow(base, exponent)', 'forms': [['base', 'exponent']], 'description': 'computes base raised to the power of exponent', 'details': '', 'params': {'base': 'number, list or tensor to raise', 'exponent': 'power to raise base to; tensors broadcast'}, 'aliases': []},
|
||||
'sigm': {'min_args': 1, 'max_args': 1, 'signature': 'sigm(x)', 'forms': [['x']], 'description': 'applies the sigmoid function: 1 / (1 + exp(-x))', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element'}, 'aliases': []},
|
||||
'sigm_karras': {'min_args': 3, 'max_args': 4, 'signature': 'sigm_karras(steps, sigma_min, sigma_max, [rho])', 'forms': [['steps', 'sigma_min', 'sigma_max', '[rho]']], 'description': 'Karras noise schedule: steps sigmas from sigma_max down to sigma_min, followed by a final 0', 'details': '', 'params': {'steps': 'number of sampling steps', 'sigma_min': 'smallest non-zero sigma', 'sigma_max': 'largest sigma', 'rho': 'curvature of the schedule (default: 7)'}, 'aliases': []},
|
||||
'sigm_exponential': {'min_args': 3, 'max_args': 3, 'signature': 'sigm_exponential(steps, sigma_min, sigma_max)', 'forms': [['steps', 'sigma_min', 'sigma_max']], 'description': 'exponential noise schedule (evenly spaced in log sigma), followed by a final 0', 'details': '', 'params': {'steps': 'number of sampling steps', 'sigma_min': 'smallest non-zero sigma', 'sigma_max': 'largest sigma'}, 'aliases': []},
|
||||
'sigm_polyexponential': {'min_args': 3, 'max_args': 4, 'signature': 'sigm_polyexponential(steps, sigma_min, sigma_max, [rho])', 'forms': [['steps', 'sigma_min', 'sigma_max', '[rho]']], 'description': 'polynomial-in-log-sigma noise schedule, followed by a final 0', 'details': '', 'params': {'steps': 'number of sampling steps', 'sigma_min': 'smallest non-zero sigma', 'sigma_max': 'largest sigma', 'rho': 'polynomial power; 1 is the exponential schedule (default: 1)'}, 'aliases': []},
|
||||
'sigm_laplace': {'min_args': 3, 'max_args': 5, 'signature': 'sigm_laplace(steps, sigma_min, sigma_max, [mu], [beta])', 'forms': [['steps', 'sigma_min', 'sigma_max', '[mu]', '[beta]']], 'description': 'Laplace noise schedule of steps sigmas; like ComfyUI\'s LaplaceScheduler it has no final 0', 'details': '', 'params': {'steps': 'number of sampling steps', 'sigma_min': 'smallest non-zero sigma', 'sigma_max': 'largest sigma', 'mu': 'location of the Laplace distribution in log sigma (default: 0)', 'beta': 'scale of the Laplace distribution (default: 0.5)'}, 'aliases': []},
|
||||
'clamp': {'min_args': 3, 'max_args': 3, 'signature': 'clamp(x, min, max)', 'forms': [['x', 'min', 'max']], 'description': 'clamps x between min and max per element', 'details': '', 'params': {'x': 'number, list or tensor; applied to each element', 'min': 'lower bound', 'max': 'upper bound'}, 'aliases': []},
|
||||
'fft': {'min_args': 1, 'max_args': 1, 'signature': 'fft(x)', 'forms': [['x']], 'description': 'computes fast Fourier transform of x', 'details': '', 'params': {'x': 'tensor, transformed over all dimensions'}, 'aliases': []},
|
||||
'ifft': {'min_args': 1, 'max_args': 2, 'signature': 'ifft(x, [shape])', 'forms': [['x', '[shape]']], 'description': 'inverse fast Fourier transform of x. shape (defaults to the node\'s tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.', 'details': '', 'params': {'x': 'spectrum to transform back; may use the K/Kx/Ky/frequency variables', 'shape': 'shape used for the K/Kx/Ky frequency variables (default: the node\'s input shape)'}, 'aliases': []},
|
||||
@@ -69,6 +73,7 @@ INBUILT_FUNCTION_META = {
|
||||
'nvl': {'min_args': 4, 'max_args': 4, 'signature': 'nvl(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'params': {'x': 'values to clean', 'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, 'aliases': ['nan_to_num']},
|
||||
'nan_to_num': {'min_args': 4, 'max_args': 4, 'signature': 'nan_to_num(x, nan, pos_inf, neg_inf)', 'forms': [['x', 'nan', 'pos_inf', 'neg_inf']], 'description': 'replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)', 'details': '', 'params': {'x': 'values to clean', 'nan': 'replacement for NaN', 'pos_inf': 'replacement for +infinity', 'neg_inf': 'replacement for -infinity'}, 'aliases': ['nvl']},
|
||||
'lerp': {'min_args': 3, 'max_args': 3, 'signature': 'lerp(a, b, t)', 'forms': [['a', 'b', 't']], 'description': 'linear interpolation between a and b by t per element. t can be float or tensor.', 'details': '', 'params': {'a': 'value at t = 0', 'b': 'value at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)'}, 'aliases': []},
|
||||
'interp': {'min_args': 3, 'max_args': 4, 'signature': 'interp(x, xs, ys, [mode])', 'forms': [['x', 'xs', 'ys', '[mode]']], 'description': 'keyframe interpolation: the value at x of the curve through the points (xs, ys), holding the first/last value outside the keys. Modes: linear (default), smooth (eases in and out of every key), step (holds a value until the next key)', 'details': '', 'params': {'x': 'position such as a frame index; a number or tensor', 'xs': 'key positions', 'ys': 'values at the keys; they may be tensors (e.g. images) when x is a number', 'mode': '"linear", "smooth" or "step" (default: "linear")'}, 'aliases': []},
|
||||
'slerp': {'min_args': 3, 'max_args': 4, 'signature': 'slerp(a, b, t, [dim])', 'forms': [['a', 'b', 't', '[dim]']], 'description': 'interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.', 'details': '', 'params': {'a': 'vectors at t = 0', 'b': 'vectors at t = 1', 't': 'progress from 0 (gives a) to 1 (gives b)', 'dim': 'dimension holding the vector components (default: all elements form one vector)'}, 'aliases': []},
|
||||
'step': {'min_args': 2, 'max_args': 2, 'signature': 'step(x, edge)', 'forms': [['x', 'edge']], 'description': 'returns 0 if x < edge, else 1', 'details': '', 'params': {'x': 'values to test (number, list or tensor)', 'edge': 'threshold; the result is 1 where x >= edge, otherwise 0'}, 'aliases': []},
|
||||
'smoothstep': {'min_args': 3, 'max_args': 3, 'signature': 'smoothstep(x, edge0, edge1)', 'forms': [['x', 'edge0', 'edge1']], 'description': 'smooth interpolation between edge0 and edge1', 'details': '', 'params': {'x': 'input values', 'edge0': 'value mapped to 0', 'edge1': 'value mapped to 1'}, 'aliases': []},
|
||||
@@ -125,6 +130,8 @@ INBUILT_FUNCTION_META = {
|
||||
'any': {'min_args': 1, 'max_args': 1, 'signature': 'any(x)', 'forms': [['x']], 'description': 'returns 1 if any element of x is non-zero otherwise 0', 'details': '', 'params': {'x': 'values to test (number, list or tensor)'}, 'aliases': []},
|
||||
'all': {'min_args': 1, 'max_args': 1, 'signature': 'all(x)', 'forms': [['x']], 'description': 'returns 1 if all elements of x are non-zero otherwise 0', 'details': '', 'params': {'x': 'values to test (number, list or tensor)'}, 'aliases': []},
|
||||
'edge': {'min_args': 1, 'max_args': 2, 'signature': 'edge(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).', 'details': '', 'params': {'x': 'image or tensor', 'kernel_size': 'odd Sobel kernel size, at least 3 (default: 3)'}, 'aliases': []},
|
||||
'distance_transform': {'min_args': 1, 'max_args': 2, 'signature': 'distance_transform(mask, [threshold])', 'forms': [['mask', '[threshold]']], 'description': 'Euclidean distance in pixels from each pixel inside the mask to the nearest pixel outside it; outside pixels are 0. Use distance_transform(1 - mask) for the distance outside the mask', 'details': '', 'params': {'mask': 'mask or image; values above threshold count as inside', 'threshold': 'inside/outside cutoff (default: 0.5)'}, 'aliases': []},
|
||||
'grayscale': {'min_args': 1, 'max_args': 1, 'signature': 'grayscale(image)', 'forms': [['image']], 'description': 'replaces the R, G, B entries of the last dimension with their Rec.709 luminance, keeping the shape and extra channels such as alpha', 'details': '', 'params': {'image': 'colors with R, G, B as the first three entries of the last dimension'}, 'aliases': []},
|
||||
'blur': {'min_args': 2, 'max_args': 3, 'signature': 'blur(x, sigma, [auto_channels])', 'forms': [['x', 'sigma', '[auto_channels]']], 'description': 'applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy', 'details': '', 'params': {'x': 'image or tensor to blur', 'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'auto_channels': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, 'aliases': ['gaussian']},
|
||||
'gaussian': {'min_args': 2, 'max_args': 3, 'signature': 'gaussian(x, sigma, [auto_channels])', 'forms': [['x', 'sigma', '[auto_channels]']], 'description': 'applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy', 'details': '', 'params': {'x': 'image or tensor to blur', 'sigma': 'blur strength as the standard deviation in elements; 0 or less returns x unchanged', 'auto_channels': 'truthy to find the channel dimension automatically; otherwise channels must be last (default: false)'}, 'aliases': ['blur']},
|
||||
'median': {'min_args': 1, 'max_args': 2, 'signature': 'median(x, [dim])', 'forms': [['x', '[dim]']], 'description': 'computes the median globally or along one dimension', 'details': '', 'params': {'x': 'values (list or tensor)', 'dim': 'dimension to reduce (default: all elements)'}, 'aliases': []},
|
||||
@@ -182,7 +189,8 @@ INBUILT_FUNCTION_META = {
|
||||
'where': {'min_args': 3, 'max_args': 3, 'signature': 'where(condition, if_true, if_false)', 'forms': [['condition', 'if_true', 'if_false']], 'description': 'returns if_true where condition is non-zero, otherwise if_false. Runs per element', 'details': '', 'params': {'condition': 'non-zero selects if_true, zero selects if_false', 'if_true': 'value used where condition is non-zero', 'if_false': 'value used where condition is zero'}, 'aliases': []},
|
||||
'histogram': {'min_args': 4, 'max_args': 4, 'signature': 'histogram(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'params': {'x': 'values; flattened', 'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, 'aliases': ['hist']},
|
||||
'hist': {'min_args': 4, 'max_args': 4, 'signature': 'hist(x, bins, min, max)', 'forms': [['x', 'bins', 'min', 'max']], 'description': 'counts the elements of flatten(x) in bins equal-width bins over [min, max]', 'details': '', 'params': {'x': 'values; flattened', 'bins': 'number of equal-width bins', 'min': 'lower edge of the first bin', 'max': 'upper edge of the last bin'}, 'aliases': ['histogram']},
|
||||
'overlay': {'min_args': 3, 'max_args': 4, 'signature': 'overlay(base, overlay, offset, [opacity])', 'forms': [['base', 'overlay', 'offset', '[opacity]']], 'description': 'overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.', 'details': '', 'params': {'base': 'background value, list, text or tensor', 'overlay': 'value placed on top of base', 'offset': 'position of the overlay\'s low corner in base, one value per dimension', 'opacity': '0-1 blend amount; a number or a tensor shaped like overlay (default: 1)'}, 'aliases': []},
|
||||
'overlay': {'min_args': 3, 'max_args': 5, 'signature': 'overlay(base, overlay, offset, [opacity], [mode])', 'forms': [['base', 'overlay', 'offset', '[opacity]', '[mode]']], 'description': 'overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay. For tensors, mode picks a blend mode like blend()', 'details': '', 'params': {'base': 'background value, list, text or tensor', 'overlay': 'value placed on top of base', 'offset': 'position of the overlay\'s low corner in base, one value per dimension', 'opacity': '0-1 blend amount; a number or a tensor shaped like overlay (default: 1)', 'mode': 'blend mode name for tensors, see blend() (default: "normal")'}, 'aliases': []},
|
||||
'blend': {'min_args': 3, 'max_args': 4, 'signature': 'blend(base, top, mode, [opacity])', 'forms': [['base', 'top', 'mode', '[opacity]']], 'description': 'blends top onto base with a blend mode, like layers in an image editor. Shapes broadcast; use overlay() to place a smaller layer at an offset. Modes: normal, multiply, screen, overlay, soft_light, hard_light, darken, lighten, difference, exclusion, add, subtract, color_dodge, color_burn', 'details': '', 'params': {'base': 'bottom layer', 'top': 'top layer', 'mode': 'blend mode name, e.g. "screen"', 'opacity': '0-1 amount of the blended result; a number or a broadcastable tensor (default: 1)'}, 'aliases': []},
|
||||
'pad': {'min_args': 2, 'max_args': 2, 'signature': 'pad(x, padding)', 'forms': [['x', 'padding']], 'description': 'pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)', 'details': '', 'params': {'x': 'tensor to pad', 'padding': 'amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]'}, 'aliases': []},
|
||||
'cross': {'min_args': 2, 'max_args': 2, 'signature': 'cross(x, y)', 'forms': [['x', 'y']], 'description': 'computes the cross product of x and y. Last dimension must be 3', 'details': '', 'params': {'x': 'vectors with 3 components in the last dimension', 'y': 'vectors with 3 components in the last dimension'}, 'aliases': []},
|
||||
'matmul': {'min_args': 2, 'max_args': 2, 'signature': 'matmul(x, y)', 'forms': [['x', 'y']], 'description': 'computes the matrix multiplication of x and y', 'details': '', 'params': {'x': 'left matrix or batch of matrices', 'y': 'right matrix or batch of matrices'}, 'aliases': []},
|
||||
@@ -236,11 +244,15 @@ INBUILT_FUNCTION_META = {
|
||||
'substr': {'min_args': 2, 'max_args': 3, 'signature': 'substr(text, start, [length])', 'forms': [['text', 'start', '[length]']], 'description': 'returns length characters of text starting at start. If length is not supplied, it returns the rest of the string', 'details': '', 'params': {'text': 'source text', 'start': 'index of the first character', 'length': 'number of characters (default: the rest of the text)'}, 'aliases': ['substring']},
|
||||
'find': {'min_args': 2, 'max_args': 2, 'signature': 'find(text, search)', 'forms': [['text', 'search']], 'description': 'returns the index of the first occurrence of search in text, or -1 if it is not found', 'details': '', 'params': {'text': 'text to search in', 'search': 'text to look for'}, 'aliases': []},
|
||||
'replace': {'min_args': 3, 'max_args': 3, 'signature': 'replace(value, old, new)', 'forms': [['value', 'old', 'new']], 'description': 'replaces every occurrence of old with new; works on text, lists and tensors', 'details': '', 'params': {'value': 'text, list or tensor', 'old': 'text or value to look for', 'new': 'replacement'}, 'aliases': []},
|
||||
'regex_search': {'min_args': 2, 'max_args': 2, 'signature': 'regex_search(text, pattern)', 'forms': [['text', 'pattern']], 'description': 'returns the index of the first match of the regular expression pattern in text, or -1 if there is none', 'details': '', 'params': {'text': 'text to search in', 'pattern': 'Python regular expression'}, 'aliases': []},
|
||||
'regex_replace': {'min_args': 3, 'max_args': 3, 'signature': 'regex_replace(text, pattern, replacement)', 'forms': [['text', 'pattern', 'replacement']], 'description': 'replaces every match of the regular expression pattern in text; replacement may refer to groups as \\1', 'details': '', 'params': {'text': 'text to change', 'pattern': 'Python regular expression', 'replacement': 'replacement text'}, 'aliases': []},
|
||||
'format': {'min_args': 1, 'max_args': 2, 'signature': 'format(value, [spec])', 'forms': [['value', '[spec]']], 'description': 'formats numbers as text. spec is a number of decimals or a Python format spec such as ".3e" (default: shortest form, "g"); lists and tensors are formatted per element', 'details': '', 'params': {'value': 'number, list or tensor', 'spec': 'decimal count or format spec text'}, 'aliases': []},
|
||||
'dilate': {'min_args': 1, 'max_args': 2, 'signature': 'dilate(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological dilation to x with a square kernel (default size 3).', 'details': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'erode': {'min_args': 1, 'max_args': 2, 'signature': 'erode(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological erosion to x with a square kernel (default size 3).', 'details': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'morph_open': {'min_args': 1, 'max_args': 2, 'signature': 'morph_open(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).', 'details': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'morph_close': {'min_args': 1, 'max_args': 2, 'signature': 'morph_close(x, [kernel_size])', 'forms': [['x', '[kernel_size]']], 'description': 'applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).', 'details': '', 'params': {'x': 'mask or image with values 0-1', 'kernel_size': 'size of the square kernel (default: 3)'}, 'aliases': []},
|
||||
'rgb_to_oklab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {'rgb': 'sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list', 'r': 'red channel 0-1', 'g': 'green channel 0-1', 'b': 'blue channel 0-1'}, 'aliases': []},
|
||||
'luminance': {'min_args': 1, 'max_args': 3, 'signature': 'luminance(rgb) / luminance(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'Rec.709 luminance 0.2126 R + 0.7152 G + 0.0722 B of gamma-encoded colors. With one argument the first three entries of its last dimension are R, G, B and that dimension is removed', 'details': '', 'params': {'rgb': 'colors (0-1) with R, G, B in the last dimension, or a 3-item list', 'r': 'red channel 0-1', 'g': 'green channel 0-1', 'b': 'blue channel 0-1'}, 'aliases': []},
|
||||
'rgb_to_cielab': {'min_args': 1, 'max_args': 3, 'signature': 'rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)', 'forms': [['rgb'], ['r', 'g', 'b']], 'description': 'converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {'rgb': 'sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list', 'r': 'red channel 0-1', 'g': 'green channel 0-1', 'b': 'blue channel 0-1'}, 'aliases': []},
|
||||
'oklab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)', 'forms': [['oklab'], ['l', 'a', 'b']], 'description': 'converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {'oklab': 'OKLab colors with L, a, b in the last dimension, or a 3-item list', 'l': 'lightness', 'a': 'green-red axis', 'b': 'blue-yellow axis'}, 'aliases': []},
|
||||
'cielab_to_rgb': {'min_args': 1, 'max_args': 3, 'signature': 'cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)', 'forms': [['cielab'], ['l', 'a', 'b']], 'description': 'converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result', 'details': '', 'params': {'cielab': 'CIELAB colors / 100 with L, a, b in the last dimension, or a 3-item list', 'l': 'lightness / 100 (0-1)', 'a': 'green-red axis / 100', 'b': 'blue-yellow axis / 100'}, 'aliases': []},
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -47,252 +47,264 @@ ROUND=46
|
||||
GAMMA=47
|
||||
POWE=48
|
||||
SIGM=49
|
||||
CLAMP=50
|
||||
SFFT=51
|
||||
SIFFT=52
|
||||
ANGL=53
|
||||
PRNT=54
|
||||
PRINT_SHAPE=55
|
||||
NVL=56
|
||||
LERP=57
|
||||
SLERP=58
|
||||
STEP=59
|
||||
SMOOTHSTEP=60
|
||||
FRACT=61
|
||||
RELU=62
|
||||
SOFTSIGN=63
|
||||
LEAKY_RELU=64
|
||||
SOFTPLUS=65
|
||||
GELU=66
|
||||
SILU=67
|
||||
SIGN=68
|
||||
DEGREES=69
|
||||
RADIANS=70
|
||||
LOGICAL_NOT=71
|
||||
LOGICAL_AND=72
|
||||
LOGICAL_OR=73
|
||||
HYPOT=74
|
||||
MAP=75
|
||||
EZCONV=76
|
||||
CONV=77
|
||||
SWAP=78
|
||||
TRANSPOSE=79
|
||||
PERM=80
|
||||
RESHAPE=81
|
||||
RANGE=82
|
||||
LINSPACE=83
|
||||
LOGSPACE=84
|
||||
TOPK=85
|
||||
BOTK=86
|
||||
PINV=87
|
||||
INV=88
|
||||
SUM=89
|
||||
MEAN=90
|
||||
STD=91
|
||||
VAR=92
|
||||
PROD=93
|
||||
ISCLOSE=94
|
||||
ALLCLOSE=95
|
||||
QUARTILE=96
|
||||
PERCENTILE=97
|
||||
QUANTILE=98
|
||||
DOT=99
|
||||
MOMENT=100
|
||||
ERF=101
|
||||
ERFC=102
|
||||
ERFINV=103
|
||||
ANY=104
|
||||
ALL=105
|
||||
EDGE=106
|
||||
GAUSSIAN=107
|
||||
MEDIAN=108
|
||||
MODE=109
|
||||
CUMSUM=110
|
||||
CUMPROD=111
|
||||
TOPK_IND=112
|
||||
BOTK_IND=113
|
||||
CUBIC_EASE=114
|
||||
ELASTIC_EASE=115
|
||||
SINE_EASE=116
|
||||
SMOOTHERSTEP=117
|
||||
DIST=118
|
||||
REMAP=119
|
||||
COSSIM=120
|
||||
COUNT=121
|
||||
KEYS=122
|
||||
ENABLE_TRACKING=123
|
||||
DISABLE_TRACKING=124
|
||||
RESET_TRACKING=125
|
||||
GET_CHANGED_KEYS=126
|
||||
GET_ADDED_KEYS=127
|
||||
GET_REMOVED_KEYS=128
|
||||
GET_UNCHANGED_KEYS=129
|
||||
REPEAT=130
|
||||
FLATTEN=131
|
||||
APPEND=132
|
||||
GET_VALUE=133
|
||||
FLOW_APPLY=134
|
||||
BATCH_SHUFFLE=135
|
||||
MOTION_MASK=136
|
||||
FLOW_TO_IMAGE=137
|
||||
FLOW_MAG=138
|
||||
FLOW_ANG=139
|
||||
WHERE=140
|
||||
HISTOGRAM=141
|
||||
OVERLAY=142
|
||||
PAD=143
|
||||
CROSS=144
|
||||
MATMUL=145
|
||||
SOLVE=146
|
||||
MATRIX_RANK=147
|
||||
RIFE=148
|
||||
BNOT=149
|
||||
BITCOUNT=150
|
||||
SHAPE=151
|
||||
BAND=152
|
||||
XOR=153
|
||||
BOR=154
|
||||
TENSOR=155
|
||||
ZEROS=156
|
||||
ONES=157
|
||||
EYE=158
|
||||
ONE_HOT=159
|
||||
MSE=160
|
||||
MAE=161
|
||||
PSNR=162
|
||||
WEIGHTED_MEAN=163
|
||||
HUBER_LOSS=164
|
||||
CROSS_ENTROPY=165
|
||||
ADD_KEY=166
|
||||
REMOVE_KEY=167
|
||||
PUSH=168
|
||||
POP=169
|
||||
CLEAR=170
|
||||
HAS=171
|
||||
GET=172
|
||||
CONCAT=173
|
||||
STACK=174
|
||||
NONZERO=175
|
||||
INT=176
|
||||
FLOAT=177
|
||||
UPPER=178
|
||||
LOWER=179
|
||||
TRIM=180
|
||||
SPLIT=181
|
||||
JOIN=182
|
||||
SUBSTRING=183
|
||||
FIND=184
|
||||
REPLACE=185
|
||||
DILATE=186
|
||||
ERODE=187
|
||||
MORPH_OPEN=188
|
||||
MORPH_CLOSE=189
|
||||
RGB_TO_OKLAB=190
|
||||
RGB_TO_CIELAB=191
|
||||
OKLAB_TO_RGB=192
|
||||
CIELAB_TO_RGB=193
|
||||
RGB_TO_HSV=194
|
||||
HSV_TO_RGB=195
|
||||
INT_TO_RGB=196
|
||||
RGB_TO_INT=197
|
||||
INTERPOLATE_LINEAR=198
|
||||
INTERPOLATE_AREA=199
|
||||
INTERPOLATE_NEAREST=200
|
||||
TEXT_IMAGE=201
|
||||
AS_NESTED=202
|
||||
SVD=203
|
||||
DIAG=204
|
||||
IF=205
|
||||
ELSE=206
|
||||
WHILE=207
|
||||
FOR=208
|
||||
IN=209
|
||||
BREAK=210
|
||||
CONTINUE=211
|
||||
RETURN=212
|
||||
TIMESTAMP=213
|
||||
SORT=214
|
||||
ARGSORT=215
|
||||
ARGMIN=216
|
||||
ARGMAX=217
|
||||
SOFTMAX=218
|
||||
SOFTMIN=219
|
||||
UNIQUE=220
|
||||
FLIP=221
|
||||
STARTSWITH=222
|
||||
ENDSWITH=223
|
||||
SQUEEZE=224
|
||||
UNSQUEEZE=225
|
||||
ROLL=226
|
||||
COV=227
|
||||
CORR=228
|
||||
ENTROPY=229
|
||||
CROP=230
|
||||
NONE=231
|
||||
COORDS=232
|
||||
GATHER=233
|
||||
SCATTER=234
|
||||
SCATTER_ADD=235
|
||||
NOISE=236
|
||||
PINK_NOISE=237
|
||||
BROWN_NOISE=238
|
||||
RAND=239
|
||||
CAUCHY=240
|
||||
EXPONENTIAL=241
|
||||
LOGNORMAL=242
|
||||
BERNOULLI=243
|
||||
POISSON=244
|
||||
GAMMADIST=245
|
||||
BETADIST=246
|
||||
LAPLACEDIST=247
|
||||
GUMBELDIST=248
|
||||
WEIBULLDIST=249
|
||||
CHI2DIST=250
|
||||
STUDENTTDIST=251
|
||||
PERLIN=252
|
||||
CELLULAR=253
|
||||
PLASMA=254
|
||||
RIDGED=255
|
||||
DOMAIN_WARP=256
|
||||
PLUS=257
|
||||
MINUS=258
|
||||
MULT=259
|
||||
DIV=260
|
||||
MOD=261
|
||||
POW=262
|
||||
LSHIFT=263
|
||||
RSHIFT=264
|
||||
GE=265
|
||||
GT=266
|
||||
LE=267
|
||||
LT=268
|
||||
EQ=269
|
||||
EQUEALS=270
|
||||
PLUS_EQ=271
|
||||
MINUS_EQ=272
|
||||
MULT_EQ=273
|
||||
DIV_EQ=274
|
||||
MOD_EQ=275
|
||||
NE=276
|
||||
PIPE=277
|
||||
LPAREN=278
|
||||
RPAREN=279
|
||||
COMMA=280
|
||||
SEMICOLON=281
|
||||
ARROW=282
|
||||
LBRACKET=283
|
||||
RBRACKET=284
|
||||
QUESTION=285
|
||||
COLON=286
|
||||
LBRACE=287
|
||||
RBRACE=288
|
||||
NUMBER=289
|
||||
CONSTANT=290
|
||||
STRING=291
|
||||
VARIABLE=292
|
||||
SL_COMMENT=293
|
||||
ML_COMMENT=294
|
||||
WS=295
|
||||
SIGM_KARRAS=50
|
||||
SIGM_EXPONENTIAL=51
|
||||
SIGM_POLYEXPONENTIAL=52
|
||||
SIGM_LAPLACE=53
|
||||
CLAMP=54
|
||||
SFFT=55
|
||||
SIFFT=56
|
||||
ANGL=57
|
||||
PRNT=58
|
||||
PRINT_SHAPE=59
|
||||
NVL=60
|
||||
LERP=61
|
||||
INTERP=62
|
||||
SLERP=63
|
||||
STEP=64
|
||||
SMOOTHSTEP=65
|
||||
FRACT=66
|
||||
RELU=67
|
||||
SOFTSIGN=68
|
||||
LEAKY_RELU=69
|
||||
SOFTPLUS=70
|
||||
GELU=71
|
||||
SILU=72
|
||||
SIGN=73
|
||||
DEGREES=74
|
||||
RADIANS=75
|
||||
LOGICAL_NOT=76
|
||||
LOGICAL_AND=77
|
||||
LOGICAL_OR=78
|
||||
HYPOT=79
|
||||
MAP=80
|
||||
EZCONV=81
|
||||
CONV=82
|
||||
SWAP=83
|
||||
TRANSPOSE=84
|
||||
PERM=85
|
||||
RESHAPE=86
|
||||
RANGE=87
|
||||
LINSPACE=88
|
||||
LOGSPACE=89
|
||||
TOPK=90
|
||||
BOTK=91
|
||||
PINV=92
|
||||
INV=93
|
||||
SUM=94
|
||||
MEAN=95
|
||||
STD=96
|
||||
VAR=97
|
||||
PROD=98
|
||||
ISCLOSE=99
|
||||
ALLCLOSE=100
|
||||
QUARTILE=101
|
||||
PERCENTILE=102
|
||||
QUANTILE=103
|
||||
DOT=104
|
||||
MOMENT=105
|
||||
ERF=106
|
||||
ERFC=107
|
||||
ERFINV=108
|
||||
ANY=109
|
||||
ALL=110
|
||||
EDGE=111
|
||||
DISTANCE_TRANSFORM=112
|
||||
GRAYSCALE=113
|
||||
GAUSSIAN=114
|
||||
MEDIAN=115
|
||||
MODE=116
|
||||
CUMSUM=117
|
||||
CUMPROD=118
|
||||
TOPK_IND=119
|
||||
BOTK_IND=120
|
||||
CUBIC_EASE=121
|
||||
ELASTIC_EASE=122
|
||||
SINE_EASE=123
|
||||
SMOOTHERSTEP=124
|
||||
DIST=125
|
||||
REMAP=126
|
||||
COSSIM=127
|
||||
COUNT=128
|
||||
KEYS=129
|
||||
ENABLE_TRACKING=130
|
||||
DISABLE_TRACKING=131
|
||||
RESET_TRACKING=132
|
||||
GET_CHANGED_KEYS=133
|
||||
GET_ADDED_KEYS=134
|
||||
GET_REMOVED_KEYS=135
|
||||
GET_UNCHANGED_KEYS=136
|
||||
REPEAT=137
|
||||
FLATTEN=138
|
||||
APPEND=139
|
||||
GET_VALUE=140
|
||||
FLOW_APPLY=141
|
||||
BATCH_SHUFFLE=142
|
||||
MOTION_MASK=143
|
||||
FLOW_TO_IMAGE=144
|
||||
FLOW_MAG=145
|
||||
FLOW_ANG=146
|
||||
WHERE=147
|
||||
HISTOGRAM=148
|
||||
OVERLAY=149
|
||||
BLEND=150
|
||||
PAD=151
|
||||
CROSS=152
|
||||
MATMUL=153
|
||||
SOLVE=154
|
||||
MATRIX_RANK=155
|
||||
RIFE=156
|
||||
BNOT=157
|
||||
BITCOUNT=158
|
||||
SHAPE=159
|
||||
BAND=160
|
||||
XOR=161
|
||||
BOR=162
|
||||
TENSOR=163
|
||||
ZEROS=164
|
||||
ONES=165
|
||||
EYE=166
|
||||
ONE_HOT=167
|
||||
MSE=168
|
||||
MAE=169
|
||||
PSNR=170
|
||||
WEIGHTED_MEAN=171
|
||||
HUBER_LOSS=172
|
||||
CROSS_ENTROPY=173
|
||||
ADD_KEY=174
|
||||
REMOVE_KEY=175
|
||||
PUSH=176
|
||||
POP=177
|
||||
CLEAR=178
|
||||
HAS=179
|
||||
GET=180
|
||||
CONCAT=181
|
||||
STACK=182
|
||||
NONZERO=183
|
||||
INT=184
|
||||
FLOAT=185
|
||||
UPPER=186
|
||||
LOWER=187
|
||||
TRIM=188
|
||||
SPLIT=189
|
||||
JOIN=190
|
||||
SUBSTRING=191
|
||||
FIND=192
|
||||
REPLACE=193
|
||||
REGEX_SEARCH=194
|
||||
REGEX_REPLACE=195
|
||||
FORMAT=196
|
||||
DILATE=197
|
||||
ERODE=198
|
||||
MORPH_OPEN=199
|
||||
MORPH_CLOSE=200
|
||||
RGB_TO_OKLAB=201
|
||||
LUMINANCE=202
|
||||
RGB_TO_CIELAB=203
|
||||
OKLAB_TO_RGB=204
|
||||
CIELAB_TO_RGB=205
|
||||
RGB_TO_HSV=206
|
||||
HSV_TO_RGB=207
|
||||
INT_TO_RGB=208
|
||||
RGB_TO_INT=209
|
||||
INTERPOLATE_LINEAR=210
|
||||
INTERPOLATE_AREA=211
|
||||
INTERPOLATE_NEAREST=212
|
||||
TEXT_IMAGE=213
|
||||
AS_NESTED=214
|
||||
SVD=215
|
||||
DIAG=216
|
||||
IF=217
|
||||
ELSE=218
|
||||
WHILE=219
|
||||
FOR=220
|
||||
IN=221
|
||||
BREAK=222
|
||||
CONTINUE=223
|
||||
RETURN=224
|
||||
TIMESTAMP=225
|
||||
SORT=226
|
||||
ARGSORT=227
|
||||
ARGMIN=228
|
||||
ARGMAX=229
|
||||
SOFTMAX=230
|
||||
SOFTMIN=231
|
||||
UNIQUE=232
|
||||
FLIP=233
|
||||
STARTSWITH=234
|
||||
ENDSWITH=235
|
||||
SQUEEZE=236
|
||||
UNSQUEEZE=237
|
||||
ROLL=238
|
||||
COV=239
|
||||
CORR=240
|
||||
ENTROPY=241
|
||||
CROP=242
|
||||
NONE=243
|
||||
COORDS=244
|
||||
GATHER=245
|
||||
SCATTER=246
|
||||
SCATTER_ADD=247
|
||||
NOISE=248
|
||||
PINK_NOISE=249
|
||||
BROWN_NOISE=250
|
||||
RAND=251
|
||||
CAUCHY=252
|
||||
EXPONENTIAL=253
|
||||
LOGNORMAL=254
|
||||
BERNOULLI=255
|
||||
POISSON=256
|
||||
GAMMADIST=257
|
||||
BETADIST=258
|
||||
LAPLACEDIST=259
|
||||
GUMBELDIST=260
|
||||
WEIBULLDIST=261
|
||||
CHI2DIST=262
|
||||
STUDENTTDIST=263
|
||||
PERLIN=264
|
||||
CELLULAR=265
|
||||
PLASMA=266
|
||||
RIDGED=267
|
||||
DOMAIN_WARP=268
|
||||
PLUS=269
|
||||
MINUS=270
|
||||
MULT=271
|
||||
DIV=272
|
||||
MOD=273
|
||||
POW=274
|
||||
LSHIFT=275
|
||||
RSHIFT=276
|
||||
GE=277
|
||||
GT=278
|
||||
LE=279
|
||||
LT=280
|
||||
EQ=281
|
||||
EQUEALS=282
|
||||
PLUS_EQ=283
|
||||
MINUS_EQ=284
|
||||
MULT_EQ=285
|
||||
DIV_EQ=286
|
||||
MOD_EQ=287
|
||||
NE=288
|
||||
PIPE=289
|
||||
LPAREN=290
|
||||
RPAREN=291
|
||||
COMMA=292
|
||||
SEMICOLON=293
|
||||
ARROW=294
|
||||
LBRACKET=295
|
||||
RBRACKET=296
|
||||
QUESTION=297
|
||||
COLON=298
|
||||
LBRACE=299
|
||||
RBRACE=300
|
||||
NUMBER=301
|
||||
CONSTANT=302
|
||||
STRING=303
|
||||
VARIABLE=304
|
||||
SL_COMMENT=305
|
||||
ML_COMMENT=306
|
||||
WS=307
|
||||
'sin'=1
|
||||
'cos'=2
|
||||
'tan'=3
|
||||
@@ -342,176 +354,188 @@ WS=295
|
||||
'gamma'=47
|
||||
'pow'=48
|
||||
'sigm'=49
|
||||
'clamp'=50
|
||||
'fft'=51
|
||||
'ifft'=52
|
||||
'angle'=53
|
||||
'print'=54
|
||||
'lerp'=57
|
||||
'slerp'=58
|
||||
'step'=59
|
||||
'smoothstep'=60
|
||||
'fract'=61
|
||||
'relu'=62
|
||||
'softsign'=63
|
||||
'leaky_relu'=64
|
||||
'softplus'=65
|
||||
'gelu'=66
|
||||
'silu'=67
|
||||
'sign'=68
|
||||
'degrees'=69
|
||||
'radians'=70
|
||||
'logical_not'=71
|
||||
'logical_and'=72
|
||||
'logical_or'=73
|
||||
'hypot'=74
|
||||
'map'=75
|
||||
'swap'=78
|
||||
'range'=82
|
||||
'linspace'=83
|
||||
'logspace'=84
|
||||
'topk'=85
|
||||
'botk'=86
|
||||
'pinv'=87
|
||||
'inv'=88
|
||||
'sum'=89
|
||||
'mean'=90
|
||||
'std'=91
|
||||
'var'=92
|
||||
'prod'=93
|
||||
'isclose'=94
|
||||
'allclose'=95
|
||||
'quantile'=98
|
||||
'dot'=99
|
||||
'moment'=100
|
||||
'erf'=101
|
||||
'erfc'=102
|
||||
'erfinv'=103
|
||||
'any'=104
|
||||
'all'=105
|
||||
'edge'=106
|
||||
'median'=108
|
||||
'mode'=109
|
||||
'cumsum'=110
|
||||
'cumprod'=111
|
||||
'smootherstep'=117
|
||||
'remap'=119
|
||||
'keys'=122
|
||||
'repeat'=130
|
||||
'flatten'=131
|
||||
'append'=132
|
||||
'get_value'=133
|
||||
'flow_apply'=134
|
||||
'motion_mask'=136
|
||||
'flow_to_image'=137
|
||||
'where'=140
|
||||
'overlay'=142
|
||||
'pad'=143
|
||||
'cross'=144
|
||||
'matmul'=145
|
||||
'solve'=146
|
||||
'matrix_rank'=147
|
||||
'rife'=148
|
||||
'shape'=151
|
||||
'tensor'=155
|
||||
'zeros'=156
|
||||
'ones'=157
|
||||
'eye'=158
|
||||
'one_hot'=159
|
||||
'mse'=160
|
||||
'mae'=161
|
||||
'psnr'=162
|
||||
'weighted_mean'=163
|
||||
'huber_loss'=164
|
||||
'cross_entropy'=165
|
||||
'add_key'=166
|
||||
'stack_push'=168
|
||||
'stack_pop'=169
|
||||
'stack_clear'=170
|
||||
'stack_has'=171
|
||||
'stack_get'=172
|
||||
'stack'=174
|
||||
'nonzero'=175
|
||||
'int'=176
|
||||
'float'=177
|
||||
'upper'=178
|
||||
'lower'=179
|
||||
'trim'=180
|
||||
'split'=181
|
||||
'join'=182
|
||||
'find'=184
|
||||
'replace'=185
|
||||
'dilate'=186
|
||||
'erode'=187
|
||||
'morph_open'=188
|
||||
'morph_close'=189
|
||||
'rgb_to_oklab'=190
|
||||
'rgb_to_cielab'=191
|
||||
'oklab_to_rgb'=192
|
||||
'cielab_to_rgb'=193
|
||||
'rgb_to_hsv'=194
|
||||
'hsv_to_rgb'=195
|
||||
'int_to_rgb'=196
|
||||
'rgb_to_int'=197
|
||||
'interpolate_linear'=198
|
||||
'interpolate_area'=199
|
||||
'text_image'=201
|
||||
'if'=205
|
||||
'else'=206
|
||||
'while'=207
|
||||
'for'=208
|
||||
'in'=209
|
||||
'break'=210
|
||||
'continue'=211
|
||||
'return'=212
|
||||
'sort'=214
|
||||
'argsort'=215
|
||||
'argmin'=216
|
||||
'argmax'=217
|
||||
'softmax'=218
|
||||
'softmin'=219
|
||||
'unique'=220
|
||||
'flip'=221
|
||||
'startswith'=222
|
||||
'endswith'=223
|
||||
'squeeze'=224
|
||||
'unsqueeze'=225
|
||||
'roll'=226
|
||||
'cov'=227
|
||||
'entropy'=229
|
||||
'crop'=230
|
||||
'gather'=233
|
||||
'scatter'=234
|
||||
'scatter_add'=235
|
||||
'+'=257
|
||||
'-'=258
|
||||
'*'=259
|
||||
'/'=260
|
||||
'%'=261
|
||||
'^'=262
|
||||
'<<'=263
|
||||
'>>'=264
|
||||
'>='=265
|
||||
'>'=266
|
||||
'<='=267
|
||||
'<'=268
|
||||
'=='=269
|
||||
'='=270
|
||||
'+='=271
|
||||
'-='=272
|
||||
'*='=273
|
||||
'/='=274
|
||||
'%='=275
|
||||
'!='=276
|
||||
'|'=277
|
||||
'('=278
|
||||
')'=279
|
||||
','=280
|
||||
';'=281
|
||||
'->'=282
|
||||
'['=283
|
||||
']'=284
|
||||
'?'=285
|
||||
':'=286
|
||||
'{'=287
|
||||
'}'=288
|
||||
'sigm_karras'=50
|
||||
'sigm_exponential'=51
|
||||
'sigm_polyexponential'=52
|
||||
'sigm_laplace'=53
|
||||
'clamp'=54
|
||||
'fft'=55
|
||||
'ifft'=56
|
||||
'angle'=57
|
||||
'print'=58
|
||||
'lerp'=61
|
||||
'interp'=62
|
||||
'slerp'=63
|
||||
'step'=64
|
||||
'smoothstep'=65
|
||||
'fract'=66
|
||||
'relu'=67
|
||||
'softsign'=68
|
||||
'leaky_relu'=69
|
||||
'softplus'=70
|
||||
'gelu'=71
|
||||
'silu'=72
|
||||
'sign'=73
|
||||
'degrees'=74
|
||||
'radians'=75
|
||||
'logical_not'=76
|
||||
'logical_and'=77
|
||||
'logical_or'=78
|
||||
'hypot'=79
|
||||
'map'=80
|
||||
'swap'=83
|
||||
'range'=87
|
||||
'linspace'=88
|
||||
'logspace'=89
|
||||
'topk'=90
|
||||
'botk'=91
|
||||
'pinv'=92
|
||||
'inv'=93
|
||||
'sum'=94
|
||||
'mean'=95
|
||||
'std'=96
|
||||
'var'=97
|
||||
'prod'=98
|
||||
'isclose'=99
|
||||
'allclose'=100
|
||||
'quantile'=103
|
||||
'dot'=104
|
||||
'moment'=105
|
||||
'erf'=106
|
||||
'erfc'=107
|
||||
'erfinv'=108
|
||||
'any'=109
|
||||
'all'=110
|
||||
'edge'=111
|
||||
'distance_transform'=112
|
||||
'grayscale'=113
|
||||
'median'=115
|
||||
'mode'=116
|
||||
'cumsum'=117
|
||||
'cumprod'=118
|
||||
'smootherstep'=124
|
||||
'remap'=126
|
||||
'keys'=129
|
||||
'repeat'=137
|
||||
'flatten'=138
|
||||
'append'=139
|
||||
'get_value'=140
|
||||
'flow_apply'=141
|
||||
'motion_mask'=143
|
||||
'flow_to_image'=144
|
||||
'where'=147
|
||||
'overlay'=149
|
||||
'blend'=150
|
||||
'pad'=151
|
||||
'cross'=152
|
||||
'matmul'=153
|
||||
'solve'=154
|
||||
'matrix_rank'=155
|
||||
'rife'=156
|
||||
'shape'=159
|
||||
'tensor'=163
|
||||
'zeros'=164
|
||||
'ones'=165
|
||||
'eye'=166
|
||||
'one_hot'=167
|
||||
'mse'=168
|
||||
'mae'=169
|
||||
'psnr'=170
|
||||
'weighted_mean'=171
|
||||
'huber_loss'=172
|
||||
'cross_entropy'=173
|
||||
'add_key'=174
|
||||
'stack_push'=176
|
||||
'stack_pop'=177
|
||||
'stack_clear'=178
|
||||
'stack_has'=179
|
||||
'stack_get'=180
|
||||
'stack'=182
|
||||
'nonzero'=183
|
||||
'int'=184
|
||||
'float'=185
|
||||
'upper'=186
|
||||
'lower'=187
|
||||
'trim'=188
|
||||
'split'=189
|
||||
'join'=190
|
||||
'find'=192
|
||||
'replace'=193
|
||||
'regex_search'=194
|
||||
'regex_replace'=195
|
||||
'format'=196
|
||||
'dilate'=197
|
||||
'erode'=198
|
||||
'morph_open'=199
|
||||
'morph_close'=200
|
||||
'rgb_to_oklab'=201
|
||||
'luminance'=202
|
||||
'rgb_to_cielab'=203
|
||||
'oklab_to_rgb'=204
|
||||
'cielab_to_rgb'=205
|
||||
'rgb_to_hsv'=206
|
||||
'hsv_to_rgb'=207
|
||||
'int_to_rgb'=208
|
||||
'rgb_to_int'=209
|
||||
'interpolate_linear'=210
|
||||
'interpolate_area'=211
|
||||
'text_image'=213
|
||||
'if'=217
|
||||
'else'=218
|
||||
'while'=219
|
||||
'for'=220
|
||||
'in'=221
|
||||
'break'=222
|
||||
'continue'=223
|
||||
'return'=224
|
||||
'sort'=226
|
||||
'argsort'=227
|
||||
'argmin'=228
|
||||
'argmax'=229
|
||||
'softmax'=230
|
||||
'softmin'=231
|
||||
'unique'=232
|
||||
'flip'=233
|
||||
'startswith'=234
|
||||
'endswith'=235
|
||||
'squeeze'=236
|
||||
'unsqueeze'=237
|
||||
'roll'=238
|
||||
'cov'=239
|
||||
'entropy'=241
|
||||
'crop'=242
|
||||
'gather'=245
|
||||
'scatter'=246
|
||||
'scatter_add'=247
|
||||
'+'=269
|
||||
'-'=270
|
||||
'*'=271
|
||||
'/'=272
|
||||
'%'=273
|
||||
'^'=274
|
||||
'<<'=275
|
||||
'>>'=276
|
||||
'>='=277
|
||||
'>'=278
|
||||
'<='=279
|
||||
'<'=280
|
||||
'=='=281
|
||||
'='=282
|
||||
'+='=283
|
||||
'-='=284
|
||||
'*='=285
|
||||
'/='=286
|
||||
'%='=287
|
||||
'!='=288
|
||||
'|'=289
|
||||
'('=290
|
||||
')'=291
|
||||
','=292
|
||||
';'=293
|
||||
'->'=294
|
||||
'['=295
|
||||
']'=296
|
||||
'?'=297
|
||||
':'=298
|
||||
'{'=299
|
||||
'}'=300
|
||||
|
||||
File diff suppressed because one or more lines are too long
+2027
-1917
File diff suppressed because it is too large
Load Diff
@@ -47,252 +47,264 @@ ROUND=46
|
||||
GAMMA=47
|
||||
POWE=48
|
||||
SIGM=49
|
||||
CLAMP=50
|
||||
SFFT=51
|
||||
SIFFT=52
|
||||
ANGL=53
|
||||
PRNT=54
|
||||
PRINT_SHAPE=55
|
||||
NVL=56
|
||||
LERP=57
|
||||
SLERP=58
|
||||
STEP=59
|
||||
SMOOTHSTEP=60
|
||||
FRACT=61
|
||||
RELU=62
|
||||
SOFTSIGN=63
|
||||
LEAKY_RELU=64
|
||||
SOFTPLUS=65
|
||||
GELU=66
|
||||
SILU=67
|
||||
SIGN=68
|
||||
DEGREES=69
|
||||
RADIANS=70
|
||||
LOGICAL_NOT=71
|
||||
LOGICAL_AND=72
|
||||
LOGICAL_OR=73
|
||||
HYPOT=74
|
||||
MAP=75
|
||||
EZCONV=76
|
||||
CONV=77
|
||||
SWAP=78
|
||||
TRANSPOSE=79
|
||||
PERM=80
|
||||
RESHAPE=81
|
||||
RANGE=82
|
||||
LINSPACE=83
|
||||
LOGSPACE=84
|
||||
TOPK=85
|
||||
BOTK=86
|
||||
PINV=87
|
||||
INV=88
|
||||
SUM=89
|
||||
MEAN=90
|
||||
STD=91
|
||||
VAR=92
|
||||
PROD=93
|
||||
ISCLOSE=94
|
||||
ALLCLOSE=95
|
||||
QUARTILE=96
|
||||
PERCENTILE=97
|
||||
QUANTILE=98
|
||||
DOT=99
|
||||
MOMENT=100
|
||||
ERF=101
|
||||
ERFC=102
|
||||
ERFINV=103
|
||||
ANY=104
|
||||
ALL=105
|
||||
EDGE=106
|
||||
GAUSSIAN=107
|
||||
MEDIAN=108
|
||||
MODE=109
|
||||
CUMSUM=110
|
||||
CUMPROD=111
|
||||
TOPK_IND=112
|
||||
BOTK_IND=113
|
||||
CUBIC_EASE=114
|
||||
ELASTIC_EASE=115
|
||||
SINE_EASE=116
|
||||
SMOOTHERSTEP=117
|
||||
DIST=118
|
||||
REMAP=119
|
||||
COSSIM=120
|
||||
COUNT=121
|
||||
KEYS=122
|
||||
ENABLE_TRACKING=123
|
||||
DISABLE_TRACKING=124
|
||||
RESET_TRACKING=125
|
||||
GET_CHANGED_KEYS=126
|
||||
GET_ADDED_KEYS=127
|
||||
GET_REMOVED_KEYS=128
|
||||
GET_UNCHANGED_KEYS=129
|
||||
REPEAT=130
|
||||
FLATTEN=131
|
||||
APPEND=132
|
||||
GET_VALUE=133
|
||||
FLOW_APPLY=134
|
||||
BATCH_SHUFFLE=135
|
||||
MOTION_MASK=136
|
||||
FLOW_TO_IMAGE=137
|
||||
FLOW_MAG=138
|
||||
FLOW_ANG=139
|
||||
WHERE=140
|
||||
HISTOGRAM=141
|
||||
OVERLAY=142
|
||||
PAD=143
|
||||
CROSS=144
|
||||
MATMUL=145
|
||||
SOLVE=146
|
||||
MATRIX_RANK=147
|
||||
RIFE=148
|
||||
BNOT=149
|
||||
BITCOUNT=150
|
||||
SHAPE=151
|
||||
BAND=152
|
||||
XOR=153
|
||||
BOR=154
|
||||
TENSOR=155
|
||||
ZEROS=156
|
||||
ONES=157
|
||||
EYE=158
|
||||
ONE_HOT=159
|
||||
MSE=160
|
||||
MAE=161
|
||||
PSNR=162
|
||||
WEIGHTED_MEAN=163
|
||||
HUBER_LOSS=164
|
||||
CROSS_ENTROPY=165
|
||||
ADD_KEY=166
|
||||
REMOVE_KEY=167
|
||||
PUSH=168
|
||||
POP=169
|
||||
CLEAR=170
|
||||
HAS=171
|
||||
GET=172
|
||||
CONCAT=173
|
||||
STACK=174
|
||||
NONZERO=175
|
||||
INT=176
|
||||
FLOAT=177
|
||||
UPPER=178
|
||||
LOWER=179
|
||||
TRIM=180
|
||||
SPLIT=181
|
||||
JOIN=182
|
||||
SUBSTRING=183
|
||||
FIND=184
|
||||
REPLACE=185
|
||||
DILATE=186
|
||||
ERODE=187
|
||||
MORPH_OPEN=188
|
||||
MORPH_CLOSE=189
|
||||
RGB_TO_OKLAB=190
|
||||
RGB_TO_CIELAB=191
|
||||
OKLAB_TO_RGB=192
|
||||
CIELAB_TO_RGB=193
|
||||
RGB_TO_HSV=194
|
||||
HSV_TO_RGB=195
|
||||
INT_TO_RGB=196
|
||||
RGB_TO_INT=197
|
||||
INTERPOLATE_LINEAR=198
|
||||
INTERPOLATE_AREA=199
|
||||
INTERPOLATE_NEAREST=200
|
||||
TEXT_IMAGE=201
|
||||
AS_NESTED=202
|
||||
SVD=203
|
||||
DIAG=204
|
||||
IF=205
|
||||
ELSE=206
|
||||
WHILE=207
|
||||
FOR=208
|
||||
IN=209
|
||||
BREAK=210
|
||||
CONTINUE=211
|
||||
RETURN=212
|
||||
TIMESTAMP=213
|
||||
SORT=214
|
||||
ARGSORT=215
|
||||
ARGMIN=216
|
||||
ARGMAX=217
|
||||
SOFTMAX=218
|
||||
SOFTMIN=219
|
||||
UNIQUE=220
|
||||
FLIP=221
|
||||
STARTSWITH=222
|
||||
ENDSWITH=223
|
||||
SQUEEZE=224
|
||||
UNSQUEEZE=225
|
||||
ROLL=226
|
||||
COV=227
|
||||
CORR=228
|
||||
ENTROPY=229
|
||||
CROP=230
|
||||
NONE=231
|
||||
COORDS=232
|
||||
GATHER=233
|
||||
SCATTER=234
|
||||
SCATTER_ADD=235
|
||||
NOISE=236
|
||||
PINK_NOISE=237
|
||||
BROWN_NOISE=238
|
||||
RAND=239
|
||||
CAUCHY=240
|
||||
EXPONENTIAL=241
|
||||
LOGNORMAL=242
|
||||
BERNOULLI=243
|
||||
POISSON=244
|
||||
GAMMADIST=245
|
||||
BETADIST=246
|
||||
LAPLACEDIST=247
|
||||
GUMBELDIST=248
|
||||
WEIBULLDIST=249
|
||||
CHI2DIST=250
|
||||
STUDENTTDIST=251
|
||||
PERLIN=252
|
||||
CELLULAR=253
|
||||
PLASMA=254
|
||||
RIDGED=255
|
||||
DOMAIN_WARP=256
|
||||
PLUS=257
|
||||
MINUS=258
|
||||
MULT=259
|
||||
DIV=260
|
||||
MOD=261
|
||||
POW=262
|
||||
LSHIFT=263
|
||||
RSHIFT=264
|
||||
GE=265
|
||||
GT=266
|
||||
LE=267
|
||||
LT=268
|
||||
EQ=269
|
||||
EQUEALS=270
|
||||
PLUS_EQ=271
|
||||
MINUS_EQ=272
|
||||
MULT_EQ=273
|
||||
DIV_EQ=274
|
||||
MOD_EQ=275
|
||||
NE=276
|
||||
PIPE=277
|
||||
LPAREN=278
|
||||
RPAREN=279
|
||||
COMMA=280
|
||||
SEMICOLON=281
|
||||
ARROW=282
|
||||
LBRACKET=283
|
||||
RBRACKET=284
|
||||
QUESTION=285
|
||||
COLON=286
|
||||
LBRACE=287
|
||||
RBRACE=288
|
||||
NUMBER=289
|
||||
CONSTANT=290
|
||||
STRING=291
|
||||
VARIABLE=292
|
||||
SL_COMMENT=293
|
||||
ML_COMMENT=294
|
||||
WS=295
|
||||
SIGM_KARRAS=50
|
||||
SIGM_EXPONENTIAL=51
|
||||
SIGM_POLYEXPONENTIAL=52
|
||||
SIGM_LAPLACE=53
|
||||
CLAMP=54
|
||||
SFFT=55
|
||||
SIFFT=56
|
||||
ANGL=57
|
||||
PRNT=58
|
||||
PRINT_SHAPE=59
|
||||
NVL=60
|
||||
LERP=61
|
||||
INTERP=62
|
||||
SLERP=63
|
||||
STEP=64
|
||||
SMOOTHSTEP=65
|
||||
FRACT=66
|
||||
RELU=67
|
||||
SOFTSIGN=68
|
||||
LEAKY_RELU=69
|
||||
SOFTPLUS=70
|
||||
GELU=71
|
||||
SILU=72
|
||||
SIGN=73
|
||||
DEGREES=74
|
||||
RADIANS=75
|
||||
LOGICAL_NOT=76
|
||||
LOGICAL_AND=77
|
||||
LOGICAL_OR=78
|
||||
HYPOT=79
|
||||
MAP=80
|
||||
EZCONV=81
|
||||
CONV=82
|
||||
SWAP=83
|
||||
TRANSPOSE=84
|
||||
PERM=85
|
||||
RESHAPE=86
|
||||
RANGE=87
|
||||
LINSPACE=88
|
||||
LOGSPACE=89
|
||||
TOPK=90
|
||||
BOTK=91
|
||||
PINV=92
|
||||
INV=93
|
||||
SUM=94
|
||||
MEAN=95
|
||||
STD=96
|
||||
VAR=97
|
||||
PROD=98
|
||||
ISCLOSE=99
|
||||
ALLCLOSE=100
|
||||
QUARTILE=101
|
||||
PERCENTILE=102
|
||||
QUANTILE=103
|
||||
DOT=104
|
||||
MOMENT=105
|
||||
ERF=106
|
||||
ERFC=107
|
||||
ERFINV=108
|
||||
ANY=109
|
||||
ALL=110
|
||||
EDGE=111
|
||||
DISTANCE_TRANSFORM=112
|
||||
GRAYSCALE=113
|
||||
GAUSSIAN=114
|
||||
MEDIAN=115
|
||||
MODE=116
|
||||
CUMSUM=117
|
||||
CUMPROD=118
|
||||
TOPK_IND=119
|
||||
BOTK_IND=120
|
||||
CUBIC_EASE=121
|
||||
ELASTIC_EASE=122
|
||||
SINE_EASE=123
|
||||
SMOOTHERSTEP=124
|
||||
DIST=125
|
||||
REMAP=126
|
||||
COSSIM=127
|
||||
COUNT=128
|
||||
KEYS=129
|
||||
ENABLE_TRACKING=130
|
||||
DISABLE_TRACKING=131
|
||||
RESET_TRACKING=132
|
||||
GET_CHANGED_KEYS=133
|
||||
GET_ADDED_KEYS=134
|
||||
GET_REMOVED_KEYS=135
|
||||
GET_UNCHANGED_KEYS=136
|
||||
REPEAT=137
|
||||
FLATTEN=138
|
||||
APPEND=139
|
||||
GET_VALUE=140
|
||||
FLOW_APPLY=141
|
||||
BATCH_SHUFFLE=142
|
||||
MOTION_MASK=143
|
||||
FLOW_TO_IMAGE=144
|
||||
FLOW_MAG=145
|
||||
FLOW_ANG=146
|
||||
WHERE=147
|
||||
HISTOGRAM=148
|
||||
OVERLAY=149
|
||||
BLEND=150
|
||||
PAD=151
|
||||
CROSS=152
|
||||
MATMUL=153
|
||||
SOLVE=154
|
||||
MATRIX_RANK=155
|
||||
RIFE=156
|
||||
BNOT=157
|
||||
BITCOUNT=158
|
||||
SHAPE=159
|
||||
BAND=160
|
||||
XOR=161
|
||||
BOR=162
|
||||
TENSOR=163
|
||||
ZEROS=164
|
||||
ONES=165
|
||||
EYE=166
|
||||
ONE_HOT=167
|
||||
MSE=168
|
||||
MAE=169
|
||||
PSNR=170
|
||||
WEIGHTED_MEAN=171
|
||||
HUBER_LOSS=172
|
||||
CROSS_ENTROPY=173
|
||||
ADD_KEY=174
|
||||
REMOVE_KEY=175
|
||||
PUSH=176
|
||||
POP=177
|
||||
CLEAR=178
|
||||
HAS=179
|
||||
GET=180
|
||||
CONCAT=181
|
||||
STACK=182
|
||||
NONZERO=183
|
||||
INT=184
|
||||
FLOAT=185
|
||||
UPPER=186
|
||||
LOWER=187
|
||||
TRIM=188
|
||||
SPLIT=189
|
||||
JOIN=190
|
||||
SUBSTRING=191
|
||||
FIND=192
|
||||
REPLACE=193
|
||||
REGEX_SEARCH=194
|
||||
REGEX_REPLACE=195
|
||||
FORMAT=196
|
||||
DILATE=197
|
||||
ERODE=198
|
||||
MORPH_OPEN=199
|
||||
MORPH_CLOSE=200
|
||||
RGB_TO_OKLAB=201
|
||||
LUMINANCE=202
|
||||
RGB_TO_CIELAB=203
|
||||
OKLAB_TO_RGB=204
|
||||
CIELAB_TO_RGB=205
|
||||
RGB_TO_HSV=206
|
||||
HSV_TO_RGB=207
|
||||
INT_TO_RGB=208
|
||||
RGB_TO_INT=209
|
||||
INTERPOLATE_LINEAR=210
|
||||
INTERPOLATE_AREA=211
|
||||
INTERPOLATE_NEAREST=212
|
||||
TEXT_IMAGE=213
|
||||
AS_NESTED=214
|
||||
SVD=215
|
||||
DIAG=216
|
||||
IF=217
|
||||
ELSE=218
|
||||
WHILE=219
|
||||
FOR=220
|
||||
IN=221
|
||||
BREAK=222
|
||||
CONTINUE=223
|
||||
RETURN=224
|
||||
TIMESTAMP=225
|
||||
SORT=226
|
||||
ARGSORT=227
|
||||
ARGMIN=228
|
||||
ARGMAX=229
|
||||
SOFTMAX=230
|
||||
SOFTMIN=231
|
||||
UNIQUE=232
|
||||
FLIP=233
|
||||
STARTSWITH=234
|
||||
ENDSWITH=235
|
||||
SQUEEZE=236
|
||||
UNSQUEEZE=237
|
||||
ROLL=238
|
||||
COV=239
|
||||
CORR=240
|
||||
ENTROPY=241
|
||||
CROP=242
|
||||
NONE=243
|
||||
COORDS=244
|
||||
GATHER=245
|
||||
SCATTER=246
|
||||
SCATTER_ADD=247
|
||||
NOISE=248
|
||||
PINK_NOISE=249
|
||||
BROWN_NOISE=250
|
||||
RAND=251
|
||||
CAUCHY=252
|
||||
EXPONENTIAL=253
|
||||
LOGNORMAL=254
|
||||
BERNOULLI=255
|
||||
POISSON=256
|
||||
GAMMADIST=257
|
||||
BETADIST=258
|
||||
LAPLACEDIST=259
|
||||
GUMBELDIST=260
|
||||
WEIBULLDIST=261
|
||||
CHI2DIST=262
|
||||
STUDENTTDIST=263
|
||||
PERLIN=264
|
||||
CELLULAR=265
|
||||
PLASMA=266
|
||||
RIDGED=267
|
||||
DOMAIN_WARP=268
|
||||
PLUS=269
|
||||
MINUS=270
|
||||
MULT=271
|
||||
DIV=272
|
||||
MOD=273
|
||||
POW=274
|
||||
LSHIFT=275
|
||||
RSHIFT=276
|
||||
GE=277
|
||||
GT=278
|
||||
LE=279
|
||||
LT=280
|
||||
EQ=281
|
||||
EQUEALS=282
|
||||
PLUS_EQ=283
|
||||
MINUS_EQ=284
|
||||
MULT_EQ=285
|
||||
DIV_EQ=286
|
||||
MOD_EQ=287
|
||||
NE=288
|
||||
PIPE=289
|
||||
LPAREN=290
|
||||
RPAREN=291
|
||||
COMMA=292
|
||||
SEMICOLON=293
|
||||
ARROW=294
|
||||
LBRACKET=295
|
||||
RBRACKET=296
|
||||
QUESTION=297
|
||||
COLON=298
|
||||
LBRACE=299
|
||||
RBRACE=300
|
||||
NUMBER=301
|
||||
CONSTANT=302
|
||||
STRING=303
|
||||
VARIABLE=304
|
||||
SL_COMMENT=305
|
||||
ML_COMMENT=306
|
||||
WS=307
|
||||
'sin'=1
|
||||
'cos'=2
|
||||
'tan'=3
|
||||
@@ -342,176 +354,188 @@ WS=295
|
||||
'gamma'=47
|
||||
'pow'=48
|
||||
'sigm'=49
|
||||
'clamp'=50
|
||||
'fft'=51
|
||||
'ifft'=52
|
||||
'angle'=53
|
||||
'print'=54
|
||||
'lerp'=57
|
||||
'slerp'=58
|
||||
'step'=59
|
||||
'smoothstep'=60
|
||||
'fract'=61
|
||||
'relu'=62
|
||||
'softsign'=63
|
||||
'leaky_relu'=64
|
||||
'softplus'=65
|
||||
'gelu'=66
|
||||
'silu'=67
|
||||
'sign'=68
|
||||
'degrees'=69
|
||||
'radians'=70
|
||||
'logical_not'=71
|
||||
'logical_and'=72
|
||||
'logical_or'=73
|
||||
'hypot'=74
|
||||
'map'=75
|
||||
'swap'=78
|
||||
'range'=82
|
||||
'linspace'=83
|
||||
'logspace'=84
|
||||
'topk'=85
|
||||
'botk'=86
|
||||
'pinv'=87
|
||||
'inv'=88
|
||||
'sum'=89
|
||||
'mean'=90
|
||||
'std'=91
|
||||
'var'=92
|
||||
'prod'=93
|
||||
'isclose'=94
|
||||
'allclose'=95
|
||||
'quantile'=98
|
||||
'dot'=99
|
||||
'moment'=100
|
||||
'erf'=101
|
||||
'erfc'=102
|
||||
'erfinv'=103
|
||||
'any'=104
|
||||
'all'=105
|
||||
'edge'=106
|
||||
'median'=108
|
||||
'mode'=109
|
||||
'cumsum'=110
|
||||
'cumprod'=111
|
||||
'smootherstep'=117
|
||||
'remap'=119
|
||||
'keys'=122
|
||||
'repeat'=130
|
||||
'flatten'=131
|
||||
'append'=132
|
||||
'get_value'=133
|
||||
'flow_apply'=134
|
||||
'motion_mask'=136
|
||||
'flow_to_image'=137
|
||||
'where'=140
|
||||
'overlay'=142
|
||||
'pad'=143
|
||||
'cross'=144
|
||||
'matmul'=145
|
||||
'solve'=146
|
||||
'matrix_rank'=147
|
||||
'rife'=148
|
||||
'shape'=151
|
||||
'tensor'=155
|
||||
'zeros'=156
|
||||
'ones'=157
|
||||
'eye'=158
|
||||
'one_hot'=159
|
||||
'mse'=160
|
||||
'mae'=161
|
||||
'psnr'=162
|
||||
'weighted_mean'=163
|
||||
'huber_loss'=164
|
||||
'cross_entropy'=165
|
||||
'add_key'=166
|
||||
'stack_push'=168
|
||||
'stack_pop'=169
|
||||
'stack_clear'=170
|
||||
'stack_has'=171
|
||||
'stack_get'=172
|
||||
'stack'=174
|
||||
'nonzero'=175
|
||||
'int'=176
|
||||
'float'=177
|
||||
'upper'=178
|
||||
'lower'=179
|
||||
'trim'=180
|
||||
'split'=181
|
||||
'join'=182
|
||||
'find'=184
|
||||
'replace'=185
|
||||
'dilate'=186
|
||||
'erode'=187
|
||||
'morph_open'=188
|
||||
'morph_close'=189
|
||||
'rgb_to_oklab'=190
|
||||
'rgb_to_cielab'=191
|
||||
'oklab_to_rgb'=192
|
||||
'cielab_to_rgb'=193
|
||||
'rgb_to_hsv'=194
|
||||
'hsv_to_rgb'=195
|
||||
'int_to_rgb'=196
|
||||
'rgb_to_int'=197
|
||||
'interpolate_linear'=198
|
||||
'interpolate_area'=199
|
||||
'text_image'=201
|
||||
'if'=205
|
||||
'else'=206
|
||||
'while'=207
|
||||
'for'=208
|
||||
'in'=209
|
||||
'break'=210
|
||||
'continue'=211
|
||||
'return'=212
|
||||
'sort'=214
|
||||
'argsort'=215
|
||||
'argmin'=216
|
||||
'argmax'=217
|
||||
'softmax'=218
|
||||
'softmin'=219
|
||||
'unique'=220
|
||||
'flip'=221
|
||||
'startswith'=222
|
||||
'endswith'=223
|
||||
'squeeze'=224
|
||||
'unsqueeze'=225
|
||||
'roll'=226
|
||||
'cov'=227
|
||||
'entropy'=229
|
||||
'crop'=230
|
||||
'gather'=233
|
||||
'scatter'=234
|
||||
'scatter_add'=235
|
||||
'+'=257
|
||||
'-'=258
|
||||
'*'=259
|
||||
'/'=260
|
||||
'%'=261
|
||||
'^'=262
|
||||
'<<'=263
|
||||
'>>'=264
|
||||
'>='=265
|
||||
'>'=266
|
||||
'<='=267
|
||||
'<'=268
|
||||
'=='=269
|
||||
'='=270
|
||||
'+='=271
|
||||
'-='=272
|
||||
'*='=273
|
||||
'/='=274
|
||||
'%='=275
|
||||
'!='=276
|
||||
'|'=277
|
||||
'('=278
|
||||
')'=279
|
||||
','=280
|
||||
';'=281
|
||||
'->'=282
|
||||
'['=283
|
||||
']'=284
|
||||
'?'=285
|
||||
':'=286
|
||||
'{'=287
|
||||
'}'=288
|
||||
'sigm_karras'=50
|
||||
'sigm_exponential'=51
|
||||
'sigm_polyexponential'=52
|
||||
'sigm_laplace'=53
|
||||
'clamp'=54
|
||||
'fft'=55
|
||||
'ifft'=56
|
||||
'angle'=57
|
||||
'print'=58
|
||||
'lerp'=61
|
||||
'interp'=62
|
||||
'slerp'=63
|
||||
'step'=64
|
||||
'smoothstep'=65
|
||||
'fract'=66
|
||||
'relu'=67
|
||||
'softsign'=68
|
||||
'leaky_relu'=69
|
||||
'softplus'=70
|
||||
'gelu'=71
|
||||
'silu'=72
|
||||
'sign'=73
|
||||
'degrees'=74
|
||||
'radians'=75
|
||||
'logical_not'=76
|
||||
'logical_and'=77
|
||||
'logical_or'=78
|
||||
'hypot'=79
|
||||
'map'=80
|
||||
'swap'=83
|
||||
'range'=87
|
||||
'linspace'=88
|
||||
'logspace'=89
|
||||
'topk'=90
|
||||
'botk'=91
|
||||
'pinv'=92
|
||||
'inv'=93
|
||||
'sum'=94
|
||||
'mean'=95
|
||||
'std'=96
|
||||
'var'=97
|
||||
'prod'=98
|
||||
'isclose'=99
|
||||
'allclose'=100
|
||||
'quantile'=103
|
||||
'dot'=104
|
||||
'moment'=105
|
||||
'erf'=106
|
||||
'erfc'=107
|
||||
'erfinv'=108
|
||||
'any'=109
|
||||
'all'=110
|
||||
'edge'=111
|
||||
'distance_transform'=112
|
||||
'grayscale'=113
|
||||
'median'=115
|
||||
'mode'=116
|
||||
'cumsum'=117
|
||||
'cumprod'=118
|
||||
'smootherstep'=124
|
||||
'remap'=126
|
||||
'keys'=129
|
||||
'repeat'=137
|
||||
'flatten'=138
|
||||
'append'=139
|
||||
'get_value'=140
|
||||
'flow_apply'=141
|
||||
'motion_mask'=143
|
||||
'flow_to_image'=144
|
||||
'where'=147
|
||||
'overlay'=149
|
||||
'blend'=150
|
||||
'pad'=151
|
||||
'cross'=152
|
||||
'matmul'=153
|
||||
'solve'=154
|
||||
'matrix_rank'=155
|
||||
'rife'=156
|
||||
'shape'=159
|
||||
'tensor'=163
|
||||
'zeros'=164
|
||||
'ones'=165
|
||||
'eye'=166
|
||||
'one_hot'=167
|
||||
'mse'=168
|
||||
'mae'=169
|
||||
'psnr'=170
|
||||
'weighted_mean'=171
|
||||
'huber_loss'=172
|
||||
'cross_entropy'=173
|
||||
'add_key'=174
|
||||
'stack_push'=176
|
||||
'stack_pop'=177
|
||||
'stack_clear'=178
|
||||
'stack_has'=179
|
||||
'stack_get'=180
|
||||
'stack'=182
|
||||
'nonzero'=183
|
||||
'int'=184
|
||||
'float'=185
|
||||
'upper'=186
|
||||
'lower'=187
|
||||
'trim'=188
|
||||
'split'=189
|
||||
'join'=190
|
||||
'find'=192
|
||||
'replace'=193
|
||||
'regex_search'=194
|
||||
'regex_replace'=195
|
||||
'format'=196
|
||||
'dilate'=197
|
||||
'erode'=198
|
||||
'morph_open'=199
|
||||
'morph_close'=200
|
||||
'rgb_to_oklab'=201
|
||||
'luminance'=202
|
||||
'rgb_to_cielab'=203
|
||||
'oklab_to_rgb'=204
|
||||
'cielab_to_rgb'=205
|
||||
'rgb_to_hsv'=206
|
||||
'hsv_to_rgb'=207
|
||||
'int_to_rgb'=208
|
||||
'rgb_to_int'=209
|
||||
'interpolate_linear'=210
|
||||
'interpolate_area'=211
|
||||
'text_image'=213
|
||||
'if'=217
|
||||
'else'=218
|
||||
'while'=219
|
||||
'for'=220
|
||||
'in'=221
|
||||
'break'=222
|
||||
'continue'=223
|
||||
'return'=224
|
||||
'sort'=226
|
||||
'argsort'=227
|
||||
'argmin'=228
|
||||
'argmax'=229
|
||||
'softmax'=230
|
||||
'softmin'=231
|
||||
'unique'=232
|
||||
'flip'=233
|
||||
'startswith'=234
|
||||
'endswith'=235
|
||||
'squeeze'=236
|
||||
'unsqueeze'=237
|
||||
'roll'=238
|
||||
'cov'=239
|
||||
'entropy'=241
|
||||
'crop'=242
|
||||
'gather'=245
|
||||
'scatter'=246
|
||||
'scatter_add'=247
|
||||
'+'=269
|
||||
'-'=270
|
||||
'*'=271
|
||||
'/'=272
|
||||
'%'=273
|
||||
'^'=274
|
||||
'<<'=275
|
||||
'>>'=276
|
||||
'>='=277
|
||||
'>'=278
|
||||
'<='=279
|
||||
'<'=280
|
||||
'=='=281
|
||||
'='=282
|
||||
'+='=283
|
||||
'-='=284
|
||||
'*='=285
|
||||
'/='=286
|
||||
'%='=287
|
||||
'!='=288
|
||||
'|'=289
|
||||
'('=290
|
||||
')'=291
|
||||
','=292
|
||||
';'=293
|
||||
'->'=294
|
||||
'['=295
|
||||
']'=296
|
||||
'?'=297
|
||||
':'=298
|
||||
'{'=299
|
||||
'}'=300
|
||||
|
||||
@@ -1250,6 +1250,24 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#DistanceTransformFunc.
|
||||
def enterDistanceTransformFunc(self, ctx:MathExprParser.DistanceTransformFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#DistanceTransformFunc.
|
||||
def exitDistanceTransformFunc(self, ctx:MathExprParser.DistanceTransformFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#GrayscaleFunc.
|
||||
def enterGrayscaleFunc(self, ctx:MathExprParser.GrayscaleFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#GrayscaleFunc.
|
||||
def exitGrayscaleFunc(self, ctx:MathExprParser.GrayscaleFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#MedianFunc.
|
||||
def enterMedianFunc(self, ctx:MathExprParser.MedianFuncContext):
|
||||
pass
|
||||
@@ -2222,6 +2240,33 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#RegexSearchFunc.
|
||||
def enterRegexSearchFunc(self, ctx:MathExprParser.RegexSearchFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#RegexSearchFunc.
|
||||
def exitRegexSearchFunc(self, ctx:MathExprParser.RegexSearchFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#RegexReplaceFunc.
|
||||
def enterRegexReplaceFunc(self, ctx:MathExprParser.RegexReplaceFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#RegexReplaceFunc.
|
||||
def exitRegexReplaceFunc(self, ctx:MathExprParser.RegexReplaceFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#FormatFunc.
|
||||
def enterFormatFunc(self, ctx:MathExprParser.FormatFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#FormatFunc.
|
||||
def exitFormatFunc(self, ctx:MathExprParser.FormatFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#Int_to_rgbFunc.
|
||||
def enterInt_to_rgbFunc(self, ctx:MathExprParser.Int_to_rgbFuncContext):
|
||||
pass
|
||||
@@ -2402,6 +2447,60 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#BlendFunc.
|
||||
def enterBlendFunc(self, ctx:MathExprParser.BlendFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#BlendFunc.
|
||||
def exitBlendFunc(self, ctx:MathExprParser.BlendFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#InterpFunc.
|
||||
def enterInterpFunc(self, ctx:MathExprParser.InterpFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#InterpFunc.
|
||||
def exitInterpFunc(self, ctx:MathExprParser.InterpFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmKarrasFunc.
|
||||
def enterSigmKarrasFunc(self, ctx:MathExprParser.SigmKarrasFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmKarrasFunc.
|
||||
def exitSigmKarrasFunc(self, ctx:MathExprParser.SigmKarrasFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmExponentialFunc.
|
||||
def enterSigmExponentialFunc(self, ctx:MathExprParser.SigmExponentialFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmExponentialFunc.
|
||||
def exitSigmExponentialFunc(self, ctx:MathExprParser.SigmExponentialFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmPolyexponentialFunc.
|
||||
def enterSigmPolyexponentialFunc(self, ctx:MathExprParser.SigmPolyexponentialFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmPolyexponentialFunc.
|
||||
def exitSigmPolyexponentialFunc(self, ctx:MathExprParser.SigmPolyexponentialFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#SigmLaplaceFunc.
|
||||
def enterSigmLaplaceFunc(self, ctx:MathExprParser.SigmLaplaceFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#SigmLaplaceFunc.
|
||||
def exitSigmLaplaceFunc(self, ctx:MathExprParser.SigmLaplaceFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#LinspaceFunc.
|
||||
def enterLinspaceFunc(self, ctx:MathExprParser.LinspaceFuncContext):
|
||||
pass
|
||||
@@ -2438,6 +2537,15 @@ class MathExprListener(ParseTreeListener):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#LuminanceFunc.
|
||||
def enterLuminanceFunc(self, ctx:MathExprParser.LuminanceFuncContext):
|
||||
pass
|
||||
|
||||
# Exit a parse tree produced by MathExprParser#LuminanceFunc.
|
||||
def exitLuminanceFunc(self, ctx:MathExprParser.LuminanceFuncContext):
|
||||
pass
|
||||
|
||||
|
||||
# Enter a parse tree produced by MathExprParser#RgbToHsvFunc.
|
||||
def enterRgbToHsvFunc(self, ctx:MathExprParser.RgbToHsvFuncContext):
|
||||
pass
|
||||
|
||||
+4470
-3620
File diff suppressed because one or more lines are too long
@@ -699,6 +699,16 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#DistanceTransformFunc.
|
||||
def visitDistanceTransformFunc(self, ctx:MathExprParser.DistanceTransformFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#GrayscaleFunc.
|
||||
def visitGrayscaleFunc(self, ctx:MathExprParser.GrayscaleFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#MedianFunc.
|
||||
def visitMedianFunc(self, ctx:MathExprParser.MedianFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
@@ -1239,6 +1249,21 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#RegexSearchFunc.
|
||||
def visitRegexSearchFunc(self, ctx:MathExprParser.RegexSearchFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#RegexReplaceFunc.
|
||||
def visitRegexReplaceFunc(self, ctx:MathExprParser.RegexReplaceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#FormatFunc.
|
||||
def visitFormatFunc(self, ctx:MathExprParser.FormatFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#Int_to_rgbFunc.
|
||||
def visitInt_to_rgbFunc(self, ctx:MathExprParser.Int_to_rgbFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
@@ -1339,6 +1364,36 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#BlendFunc.
|
||||
def visitBlendFunc(self, ctx:MathExprParser.BlendFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#InterpFunc.
|
||||
def visitInterpFunc(self, ctx:MathExprParser.InterpFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmKarrasFunc.
|
||||
def visitSigmKarrasFunc(self, ctx:MathExprParser.SigmKarrasFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmExponentialFunc.
|
||||
def visitSigmExponentialFunc(self, ctx:MathExprParser.SigmExponentialFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmPolyexponentialFunc.
|
||||
def visitSigmPolyexponentialFunc(self, ctx:MathExprParser.SigmPolyexponentialFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#SigmLaplaceFunc.
|
||||
def visitSigmLaplaceFunc(self, ctx:MathExprParser.SigmLaplaceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#LinspaceFunc.
|
||||
def visitLinspaceFunc(self, ctx:MathExprParser.LinspaceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
@@ -1359,6 +1414,11 @@ class MathExprVisitor(ParseTreeVisitor):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#LuminanceFunc.
|
||||
def visitLuminanceFunc(self, ctx:MathExprParser.LuminanceFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
|
||||
# Visit a parse tree produced by MathExprParser#RgbToHsvFunc.
|
||||
def visitRgbToHsvFunc(self, ctx:MathExprParser.RgbToHsvFuncContext):
|
||||
return self.visitChildren(ctx)
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
import pytest
|
||||
import torch
|
||||
from comfy.k_diffusion import sampling as k_sampling
|
||||
|
||||
from more_math.Parser.UnifiedMathVisitor import UnifiedMathVisitor
|
||||
from more_math.helper_functions import parse_expr
|
||||
|
||||
|
||||
def _visit(expression, variables=None):
|
||||
return UnifiedMathVisitor(variables or {}).visit(parse_expr(expression))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("expression, expected", [
|
||||
('interp(12, [0, 24], [0, 1])', 0.5),
|
||||
('interp(6, [0, 24], [0, 1], "smooth")', 0.15625),
|
||||
('interp(23, [0, 24], [0, 1], "step")', 0.0),
|
||||
('interp(24, [0, 24], [0, 1], "step")', 1.0),
|
||||
('interp(-5, [0, 24], [2, 1])', 2.0),
|
||||
('interp(99, [0, 24], [2, 1])', 1.0),
|
||||
('interp(12, [24, 0], [1, 0])', 0.5),
|
||||
])
|
||||
def test_interp_scalar(expression, expected):
|
||||
assert _visit(expression) == pytest.approx(expected)
|
||||
|
||||
|
||||
def test_interp_tensor_positions():
|
||||
x = torch.tensor([-1.0, 6.0, 12.0, 30.0])
|
||||
|
||||
assert torch.allclose(_visit('interp(x, [0, 24], [0, 1])', {"x": x}), torch.tensor([0.0, 0.25, 0.5, 1.0]))
|
||||
assert torch.equal(_visit('interp(x, [0, 24], [0, 1], "step")', {"x": x}), torch.tensor([0.0, 0.0, 0.0, 1.0]))
|
||||
|
||||
|
||||
def test_interp_between_tensor_keyframes():
|
||||
result = _visit('interp(0.25, [0, 1], [a, b])', {"a": torch.zeros(2), "b": torch.ones(2)})
|
||||
|
||||
assert torch.allclose(result, torch.full((2,), 0.25))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("expression, reference", [
|
||||
('sigm_karras(10, 0.03, 14.6)', lambda: k_sampling.get_sigmas_karras(10, 0.03, 14.6)),
|
||||
('sigm_karras(10, 0.03, 14.6, 5)', lambda: k_sampling.get_sigmas_karras(10, 0.03, 14.6, 5.0)),
|
||||
('sigm_exponential(10, 0.03, 14.6)', lambda: k_sampling.get_sigmas_exponential(10, 0.03, 14.6)),
|
||||
('sigm_polyexponential(10, 0.03, 14.6, 2)', lambda: k_sampling.get_sigmas_polyexponential(10, 0.03, 14.6, 2.0)),
|
||||
('sigm_laplace(10, 0.03, 14.6, 0.1, 0.6)', lambda: k_sampling.get_sigmas_laplace(10, 0.03, 14.6, 0.1, 0.6)),
|
||||
])
|
||||
def test_sigma_schedules_match_comfy(expression, reference):
|
||||
assert torch.allclose(_visit(expression), reference())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mode, expected", [
|
||||
("normal", 0.8),
|
||||
("multiply", 0.4),
|
||||
("screen", 0.9),
|
||||
("difference", 0.3),
|
||||
("darken", 0.5),
|
||||
])
|
||||
def test_blend_modes(mode, expected):
|
||||
assert _visit(f'blend(0.5, 0.8, "{mode}")').item() == pytest.approx(expected)
|
||||
|
||||
|
||||
def test_blend_opacity_and_broadcast():
|
||||
base = torch.full((2, 2, 3), 0.5)
|
||||
result = _visit('blend(base, [1, 0, 0], "multiply", 0.5)', {"base": base})
|
||||
|
||||
assert result.shape == (2, 2, 3)
|
||||
assert torch.allclose(result[0, 0], torch.tensor([0.5, 0.25, 0.25]))
|
||||
|
||||
|
||||
def test_blend_unknown_mode_lists_modes():
|
||||
with pytest.raises(ValueError, match="screen"):
|
||||
_visit('blend(0.5, 0.8, "nope")')
|
||||
|
||||
|
||||
def test_overlay_blend_mode_only_changes_the_pasted_region():
|
||||
base = torch.full((4, 4), 0.5)
|
||||
result = _visit('overlay(base, top, [1, 1], 1, "multiply")', {"base": base, "top": torch.full((2, 2), 0.5)})
|
||||
|
||||
assert torch.allclose(result[1:3, 1:3], torch.full((2, 2), 0.25))
|
||||
assert result[0, 0] == 0.5
|
||||
|
||||
|
||||
def test_overlay_without_mode_is_unchanged():
|
||||
base = torch.zeros(4, 4)
|
||||
result = _visit('overlay(base, top, [1, 1], 0.5)', {"base": base, "top": torch.ones(2, 2)})
|
||||
|
||||
assert torch.allclose(result[1:3, 1:3], torch.full((2, 2), 0.5))
|
||||
|
||||
|
||||
def test_overlay_blend_mode_needs_tensors():
|
||||
with pytest.raises(ValueError, match="needs tensors"):
|
||||
_visit('overlay("hello", "xy", 1, 1, "screen")')
|
||||
|
||||
|
||||
def test_luminance_and_grayscale():
|
||||
assert _visit('luminance([1, 1, 1])').item() == pytest.approx(1.0)
|
||||
|
||||
image = torch.rand(1, 2, 2, 4)
|
||||
gray = _visit('grayscale(img)', {"img": image})
|
||||
luma = 0.2126 * image[..., 0] + 0.7152 * image[..., 1] + 0.0722 * image[..., 2]
|
||||
|
||||
assert gray.shape == image.shape
|
||||
assert torch.allclose(gray[..., 1], luma)
|
||||
assert torch.equal(gray[..., 3], image[..., 3])
|
||||
assert torch.allclose(_visit('luminance(img)', {"img": image}), luma)
|
||||
|
||||
|
||||
def test_distance_transform():
|
||||
mask = torch.ones(5, 5)
|
||||
mask[0, :] = mask[-1, :] = mask[:, 0] = mask[:, -1] = 0
|
||||
result = _visit('distance_transform(m)', {"m": mask})
|
||||
|
||||
assert result.shape == (5, 5)
|
||||
assert result[2, 2] == 2.0
|
||||
assert result[1, 1] == 1.0
|
||||
assert result[0, 0] == 0.0
|
||||
assert _visit('distance_transform(m)', {"m": mask.unsqueeze(0)}).shape == (1, 5, 5)
|
||||
|
||||
|
||||
def test_regex_functions():
|
||||
assert _visit('regex_search("frame_0042.png", "[0-9]+")') == 6.0
|
||||
assert _visit('regex_search("frame.png", "[0-9]+")') == -1.0
|
||||
assert _visit('regex_replace("a1b22", "[0-9]+", "#")') == "a#b#"
|
||||
assert _visit(r'regex_replace("ab", "(a)", "<\1>")') == "<a>b"
|
||||
|
||||
|
||||
def test_format():
|
||||
assert _visit('format(1 / 3, 2)') == "0.33"
|
||||
assert _visit('format(x)', {"x": torch.tensor(0.3)}) == "0.3"
|
||||
assert _visit('format(x, ".1f")', {"x": torch.tensor([0.5, 1.5])}) == ["0.5", "1.5"]
|
||||
+14
-2
@@ -9,7 +9,7 @@ export const CONSTANTS = new Set([
|
||||
]);
|
||||
|
||||
export const FUNCTIONS = new Set([
|
||||
"abs", "acos", "acosh", "add_key", "added_keys", "all", "allclose", "angle", "any", "append", "argmax", "argmin", "argsort", "as_nested", "as_nested_tensor", "asin", "asinh", "atan", "atan2", "atanh", "band", "batch_shuffle", "bitcount", "bitwise_and", "bitwise_not", "bitwise_or", "bitwise_xor", "blur", "bnot", "bor", "botk", "botk_ind", "botk_indices", "brown", "brown_noise", "bxor", "cat", "cbrt", "ceil", "cellular", "cellular_noise", "changed_keys", "cielab_to_rgb", "clamp", "cnt", "concat", "concatenate", "conv", "convolution", "coordinates", "coords", "corr", "correlation", "cos", "cosh", "cosine_similarity", "cossim", "count", "cov", "crop", "cross", "cross_entropy", "cubic", "cubic_ease", "cumprod", "cumsum", "degrees", "det", "diag", "diagonal_matrix", "dilate", "disable_tracking", "dist", "distance", "domain_warp", "domain_warp_noise", "dot", "edge", "elastic", "elastic_ease", "enable_tracking", "endswith", "entropy", "erf", "erfc", "erfinv", "erode", "exp", "expm1", "eye", "ezconv", "ezconvolution", "fft", "find", "flatten", "flip", "float", "floor", "flow_ang", "flow_angle", "flow_apply", "flow_mag", "flow_magnitude", "flow_to_image", "fract", "gamma", "gather", "gaussian", "gelu", "get_added_keys", "get_changed_keys", "get_removed_keys", "get_unchanged_keys", "get_value", "group_norm", "hist", "histogram", "hsv_to_rgb", "huber_loss", "hypot", "ifft", "int", "int_to_rgb", "interpolate_area", "interpolate_linear", "interpolate_nearest", "interpolate_nearest_exact", "inv", "irfft", "isclose", "isfinite", "isinf", "isnan", "join", "keys", "leaky_relu", "length", "lerp", "linspace", "ln", "log", "log1p", "log2", "logaddexp", "logical_and", "logical_not", "logical_or", "logspace", "logsumexp", "lower", "mae", "map", "matmul", "matrix_rank", "mean", "median", "mode", "moment", "morph_close", "morph_open", "motion_mask", "mse", "nan_to_num", "noise", "nonzero", "norm", "normalize", "now", "nvl", "oklab_to_rgb", "one_hot", "ones", "outer", "overlay", "pad", "percentile", "perlin", "perlin_noise", "perm", "permute", "pink", "pink_noise", "pinv", "plasma", "plasma_noise", "popcnt", "popcount", "pow", "prcnt", "print", "print_shape", "prod", "pshp", "psnr", "quantile", "quartil", "quartile", "radians", "rand", "randb", "randbeta", "randc", "randchi2", "rande", "randg", "randgumbel", "randl", "randln", "randn", "random_bernoulli", "random_beta", "random_cauchy", "random_chi2", "random_exponential", "random_gamma", "random_gumbel", "random_laplace", "random_log_normal", "random_normal", "random_poisson", "random_studentt", "random_uniform", "random_weibull", "randp", "randt", "randu", "randw", "range", "reciprocal", "relu", "remap", "remove_key", "removed_keys", "repeat", "replace", "reset_tracking", "reshape", "rfft", "rgb_to_cielab", "rgb_to_hsv", "rgb_to_int", "rgb_to_oklab", "ridged", "ridged_noise", "rife", "rm_key", "roll", "round", "rshp", "scatter", "scatter_add", "select", "shape", "shuffle", "sigm", "sign", "silu", "sin", "sinc", "sine", "sine_ease", "singular_value_decomposition", "sinh", "slerp", "smax", "smin", "smootherstep", "smoothstep", "snorm", "softmax", "softmin", "softplus", "softsign", "solve", "sort", "split", "sqrt", "squeeze", "stack", "stack_clear", "stack_get", "stack_has", "stack_pop", "stack_push", "startswith", "std", "step", "substr", "substring", "sum", "svd", "swap", "swapaxes", "tan", "tanh", "tensor", "text_image", "timestamp", "tmax", "tmin", "tnorm", "topk", "topk_ind", "topk_indices", "trace", "track_off", "track_on", "track_reset", "transpose", "trim", "turbulence", "unchanged_keys", "unique", "unsqueeze", "upper", "var", "voronoi", "voronoi_noise", "weighted_mean", "where", "worley", "zeros"
|
||||
"abs", "acos", "acosh", "add_key", "added_keys", "all", "allclose", "angle", "any", "append", "argmax", "argmin", "argsort", "as_nested", "as_nested_tensor", "asin", "asinh", "atan", "atan2", "atanh", "band", "batch_shuffle", "bitcount", "bitwise_and", "bitwise_not", "bitwise_or", "bitwise_xor", "blend", "blur", "bnot", "bor", "botk", "botk_ind", "botk_indices", "brown", "brown_noise", "bxor", "cat", "cbrt", "ceil", "cellular", "cellular_noise", "changed_keys", "cielab_to_rgb", "clamp", "cnt", "concat", "concatenate", "conv", "convolution", "coordinates", "coords", "corr", "correlation", "cos", "cosh", "cosine_similarity", "cossim", "count", "cov", "crop", "cross", "cross_entropy", "cubic", "cubic_ease", "cumprod", "cumsum", "degrees", "det", "diag", "diagonal_matrix", "dilate", "disable_tracking", "dist", "distance", "distance_transform", "domain_warp", "domain_warp_noise", "dot", "edge", "elastic", "elastic_ease", "enable_tracking", "endswith", "entropy", "erf", "erfc", "erfinv", "erode", "exp", "expm1", "eye", "ezconv", "ezconvolution", "fft", "find", "flatten", "flip", "float", "floor", "flow_ang", "flow_angle", "flow_apply", "flow_mag", "flow_magnitude", "flow_to_image", "format", "fract", "gamma", "gather", "gaussian", "gelu", "get_added_keys", "get_changed_keys", "get_removed_keys", "get_unchanged_keys", "get_value", "grayscale", "group_norm", "hist", "histogram", "hsv_to_rgb", "huber_loss", "hypot", "ifft", "int", "int_to_rgb", "interp", "interpolate_area", "interpolate_linear", "interpolate_nearest", "interpolate_nearest_exact", "inv", "irfft", "isclose", "isfinite", "isinf", "isnan", "join", "keys", "leaky_relu", "length", "lerp", "linspace", "ln", "log", "log1p", "log2", "logaddexp", "logical_and", "logical_not", "logical_or", "logspace", "logsumexp", "lower", "luminance", "mae", "map", "matmul", "matrix_rank", "mean", "median", "mode", "moment", "morph_close", "morph_open", "motion_mask", "mse", "nan_to_num", "noise", "nonzero", "norm", "normalize", "now", "nvl", "oklab_to_rgb", "one_hot", "ones", "outer", "overlay", "pad", "percentile", "perlin", "perlin_noise", "perm", "permute", "pink", "pink_noise", "pinv", "plasma", "plasma_noise", "popcnt", "popcount", "pow", "prcnt", "print", "print_shape", "prod", "pshp", "psnr", "quantile", "quartil", "quartile", "radians", "rand", "randb", "randbeta", "randc", "randchi2", "rande", "randg", "randgumbel", "randl", "randln", "randn", "random_bernoulli", "random_beta", "random_cauchy", "random_chi2", "random_exponential", "random_gamma", "random_gumbel", "random_laplace", "random_log_normal", "random_normal", "random_poisson", "random_studentt", "random_uniform", "random_weibull", "randp", "randt", "randu", "randw", "range", "reciprocal", "regex_replace", "regex_search", "relu", "remap", "remove_key", "removed_keys", "repeat", "replace", "reset_tracking", "reshape", "rfft", "rgb_to_cielab", "rgb_to_hsv", "rgb_to_int", "rgb_to_oklab", "ridged", "ridged_noise", "rife", "rm_key", "roll", "round", "rshp", "scatter", "scatter_add", "select", "shape", "shuffle", "sigm", "sigm_exponential", "sigm_karras", "sigm_laplace", "sigm_polyexponential", "sign", "silu", "sin", "sinc", "sine", "sine_ease", "singular_value_decomposition", "sinh", "slerp", "smax", "smin", "smootherstep", "smoothstep", "snorm", "softmax", "softmin", "softplus", "softsign", "solve", "sort", "split", "sqrt", "squeeze", "stack", "stack_clear", "stack_get", "stack_has", "stack_pop", "stack_push", "startswith", "std", "step", "substr", "substring", "sum", "svd", "swap", "swapaxes", "tan", "tanh", "tensor", "text_image", "timestamp", "tmax", "tmin", "tnorm", "topk", "topk_ind", "topk_indices", "trace", "track_off", "track_on", "track_reset", "transpose", "trim", "turbulence", "unchanged_keys", "unique", "unsqueeze", "upper", "var", "voronoi", "voronoi_noise", "weighted_mean", "where", "worley", "zeros"
|
||||
]);
|
||||
|
||||
export const FUNCTION_META = {
|
||||
@@ -62,6 +62,10 @@ export const FUNCTION_META = {
|
||||
"gamma": { minArgs: 1, maxArgs: 1, signature: "gamma(x)", forms: [["x"]], description: "computes the gamma function (per element)", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
|
||||
"pow": { minArgs: 2, maxArgs: 2, signature: "pow(base, exponent)", forms: [["base", "exponent"]], description: "computes base raised to the power of exponent", details: "", params: {"base": "number, list or tensor to raise", "exponent": "power to raise base to; tensors broadcast"}, aliases: [] },
|
||||
"sigm": { minArgs: 1, maxArgs: 1, signature: "sigm(x)", forms: [["x"]], description: "applies the sigmoid function: 1 / (1 + exp(-x))", details: "", params: {"x": "number, list or tensor; applied to each element"}, aliases: [] },
|
||||
"sigm_karras": { minArgs: 3, maxArgs: 4, signature: "sigm_karras(steps, sigma_min, sigma_max, [rho])", forms: [["steps", "sigma_min", "sigma_max", "[rho]"]], description: "Karras noise schedule: steps sigmas from sigma_max down to sigma_min, followed by a final 0", details: "", params: {"steps": "number of sampling steps", "sigma_min": "smallest non-zero sigma", "sigma_max": "largest sigma", "rho": "curvature of the schedule (default: 7)"}, aliases: [] },
|
||||
"sigm_exponential": { minArgs: 3, maxArgs: 3, signature: "sigm_exponential(steps, sigma_min, sigma_max)", forms: [["steps", "sigma_min", "sigma_max"]], description: "exponential noise schedule (evenly spaced in log sigma), followed by a final 0", details: "", params: {"steps": "number of sampling steps", "sigma_min": "smallest non-zero sigma", "sigma_max": "largest sigma"}, aliases: [] },
|
||||
"sigm_polyexponential": { minArgs: 3, maxArgs: 4, signature: "sigm_polyexponential(steps, sigma_min, sigma_max, [rho])", forms: [["steps", "sigma_min", "sigma_max", "[rho]"]], description: "polynomial-in-log-sigma noise schedule, followed by a final 0", details: "", params: {"steps": "number of sampling steps", "sigma_min": "smallest non-zero sigma", "sigma_max": "largest sigma", "rho": "polynomial power; 1 is the exponential schedule (default: 1)"}, aliases: [] },
|
||||
"sigm_laplace": { minArgs: 3, maxArgs: 5, signature: "sigm_laplace(steps, sigma_min, sigma_max, [mu], [beta])", forms: [["steps", "sigma_min", "sigma_max", "[mu]", "[beta]"]], description: "Laplace noise schedule of steps sigmas; like ComfyUI's LaplaceScheduler it has no final 0", details: "", params: {"steps": "number of sampling steps", "sigma_min": "smallest non-zero sigma", "sigma_max": "largest sigma", "mu": "location of the Laplace distribution in log sigma (default: 0)", "beta": "scale of the Laplace distribution (default: 0.5)"}, aliases: [] },
|
||||
"clamp": { minArgs: 3, maxArgs: 3, signature: "clamp(x, min, max)", forms: [["x", "min", "max"]], description: "clamps x between min and max per element", details: "", params: {"x": "number, list or tensor; applied to each element", "min": "lower bound", "max": "upper bound"}, aliases: [] },
|
||||
"fft": { minArgs: 1, maxArgs: 1, signature: "fft(x)", forms: [["x"]], description: "computes fast Fourier transform of x", details: "", params: {"x": "tensor, transformed over all dimensions"}, aliases: [] },
|
||||
"ifft": { minArgs: 1, maxArgs: 2, signature: "ifft(x, [shape])", forms: [["x", "[shape]"]], description: "inverse fast Fourier transform of x. shape (defaults to the node's tensor shape) sizes the K/Kx/Ky/.../frequency variables made available while evaluating x, it does not resize x itself.", details: "", params: {"x": "spectrum to transform back; may use the K/Kx/Ky/frequency variables", "shape": "shape used for the K/Kx/Ky frequency variables (default: the node's input shape)"}, aliases: [] },
|
||||
@@ -72,6 +76,7 @@ export const FUNCTION_META = {
|
||||
"nvl": { minArgs: 4, maxArgs: 4, signature: "nvl(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", params: {"x": "values to clean", "nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, aliases: ["nan_to_num"] },
|
||||
"nan_to_num": { minArgs: 4, maxArgs: 4, signature: "nan_to_num(x, nan, pos_inf, neg_inf)", forms: [["x", "nan", "pos_inf", "neg_inf"]], description: "replaces NaN, +inf and -inf in x with the given values (named after SQL NVL)", details: "", params: {"x": "values to clean", "nan": "replacement for NaN", "pos_inf": "replacement for +infinity", "neg_inf": "replacement for -infinity"}, aliases: ["nvl"] },
|
||||
"lerp": { minArgs: 3, maxArgs: 3, signature: "lerp(a, b, t)", forms: [["a", "b", "t"]], description: "linear interpolation between a and b by t per element. t can be float or tensor.", details: "", params: {"a": "value at t = 0", "b": "value at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)"}, aliases: [] },
|
||||
"interp": { minArgs: 3, maxArgs: 4, signature: "interp(x, xs, ys, [mode])", forms: [["x", "xs", "ys", "[mode]"]], description: "keyframe interpolation: the value at x of the curve through the points (xs, ys), holding the first/last value outside the keys. Modes: linear (default), smooth (eases in and out of every key), step (holds a value until the next key)", details: "", params: {"x": "position such as a frame index; a number or tensor", "xs": "key positions", "ys": "values at the keys; they may be tensors (e.g. images) when x is a number", "mode": "\"linear\", \"smooth\" or \"step\" (default: \"linear\")"}, aliases: [] },
|
||||
"slerp": { minArgs: 3, maxArgs: 4, signature: "slerp(a, b, t, [dim])", forms: [["a", "b", "t", "[dim]"]], description: "interpolates vector directions spherically and magnitudes linearly. Without dim, all elements form one vector; dim selects a vector-component axis and other axes identify independent vectors.", details: "", params: {"a": "vectors at t = 0", "b": "vectors at t = 1", "t": "progress from 0 (gives a) to 1 (gives b)", "dim": "dimension holding the vector components (default: all elements form one vector)"}, aliases: [] },
|
||||
"step": { minArgs: 2, maxArgs: 2, signature: "step(x, edge)", forms: [["x", "edge"]], description: "returns 0 if x < edge, else 1", details: "", params: {"x": "values to test (number, list or tensor)", "edge": "threshold; the result is 1 where x >= edge, otherwise 0"}, aliases: [] },
|
||||
"smoothstep": { minArgs: 3, maxArgs: 3, signature: "smoothstep(x, edge0, edge1)", forms: [["x", "edge0", "edge1"]], description: "smooth interpolation between edge0 and edge1", details: "", params: {"x": "input values", "edge0": "value mapped to 0", "edge1": "value mapped to 1"}, aliases: [] },
|
||||
@@ -128,6 +133,8 @@ export const FUNCTION_META = {
|
||||
"any": { minArgs: 1, maxArgs: 1, signature: "any(x)", forms: [["x"]], description: "returns 1 if any element of x is non-zero otherwise 0", details: "", params: {"x": "values to test (number, list or tensor)"}, aliases: [] },
|
||||
"all": { minArgs: 1, maxArgs: 1, signature: "all(x)", forms: [["x"]], description: "returns 1 if all elements of x are non-zero otherwise 0", details: "", params: {"x": "values to test (number, list or tensor)"}, aliases: [] },
|
||||
"edge": { minArgs: 1, maxArgs: 2, signature: "edge(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "detects edges in x with a Sobel filter. kernel_size must be odd and at least 3 (default 3).", details: "", params: {"x": "image or tensor", "kernel_size": "odd Sobel kernel size, at least 3 (default: 3)"}, aliases: [] },
|
||||
"distance_transform": { minArgs: 1, maxArgs: 2, signature: "distance_transform(mask, [threshold])", forms: [["mask", "[threshold]"]], description: "Euclidean distance in pixels from each pixel inside the mask to the nearest pixel outside it; outside pixels are 0. Use distance_transform(1 - mask) for the distance outside the mask", details: "", params: {"mask": "mask or image; values above threshold count as inside", "threshold": "inside/outside cutoff (default: 0.5)"}, aliases: [] },
|
||||
"grayscale": { minArgs: 1, maxArgs: 1, signature: "grayscale(image)", forms: [["image"]], description: "replaces the R, G, B entries of the last dimension with their Rec.709 luminance, keeping the shape and extra channels such as alpha", details: "", params: {"image": "colors with R, G, B as the first three entries of the last dimension"}, aliases: [] },
|
||||
"blur": { minArgs: 2, maxArgs: 3, signature: "blur(x, sigma, [auto_channels])", forms: [["x", "sigma", "[auto_channels]"]], description: "applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy", details: "", params: {"x": "image or tensor to blur", "sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "auto_channels": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, aliases: ["gaussian"] },
|
||||
"gaussian": { minArgs: 2, maxArgs: 3, signature: "gaussian(x, sigma, [auto_channels])", forms: [["x", "sigma", "[auto_channels]"]], description: "applies a separable Gaussian blur to x. Channels are expected last unless auto_channels is truthy", details: "", params: {"x": "image or tensor to blur", "sigma": "blur strength as the standard deviation in elements; 0 or less returns x unchanged", "auto_channels": "truthy to find the channel dimension automatically; otherwise channels must be last (default: false)"}, aliases: ["blur"] },
|
||||
"median": { minArgs: 1, maxArgs: 2, signature: "median(x, [dim])", forms: [["x", "[dim]"]], description: "computes the median globally or along one dimension", details: "", params: {"x": "values (list or tensor)", "dim": "dimension to reduce (default: all elements)"}, aliases: [] },
|
||||
@@ -185,7 +192,8 @@ export const FUNCTION_META = {
|
||||
"where": { minArgs: 3, maxArgs: 3, signature: "where(condition, if_true, if_false)", forms: [["condition", "if_true", "if_false"]], description: "returns if_true where condition is non-zero, otherwise if_false. Runs per element", details: "", params: {"condition": "non-zero selects if_true, zero selects if_false", "if_true": "value used where condition is non-zero", "if_false": "value used where condition is zero"}, aliases: [] },
|
||||
"histogram": { minArgs: 4, maxArgs: 4, signature: "histogram(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", params: {"x": "values; flattened", "bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, aliases: ["hist"] },
|
||||
"hist": { minArgs: 4, maxArgs: 4, signature: "hist(x, bins, min, max)", forms: [["x", "bins", "min", "max"]], description: "counts the elements of flatten(x) in bins equal-width bins over [min, max]", details: "", params: {"x": "values; flattened", "bins": "number of equal-width bins", "min": "lower edge of the first bin", "max": "upper edge of the last bin"}, aliases: ["histogram"] },
|
||||
"overlay": { minArgs: 3, maxArgs: 4, signature: "overlay(base, overlay, offset, [opacity])", forms: [["base", "overlay", "offset", "[opacity]"]], description: "overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay.", details: "", params: {"base": "background value, list, text or tensor", "overlay": "value placed on top of base", "offset": "position of the overlay's low corner in base, one value per dimension", "opacity": "0-1 blend amount; a number or a tensor shaped like overlay (default: 1)"}, aliases: [] },
|
||||
"overlay": { minArgs: 3, maxArgs: 5, signature: "overlay(base, overlay, offset, [opacity], [mode])", forms: [["base", "overlay", "offset", "[opacity]", "[mode]"]], description: "overlays overlay on base at offset. Opacity controls blending. It can be tensor or float. If it is tensor it should be the same shape as overlay. For tensors, mode picks a blend mode like blend()", details: "", params: {"base": "background value, list, text or tensor", "overlay": "value placed on top of base", "offset": "position of the overlay's low corner in base, one value per dimension", "opacity": "0-1 blend amount; a number or a tensor shaped like overlay (default: 1)", "mode": "blend mode name for tensors, see blend() (default: \"normal\")"}, aliases: [] },
|
||||
"blend": { minArgs: 3, maxArgs: 4, signature: "blend(base, top, mode, [opacity])", forms: [["base", "top", "mode", "[opacity]"]], description: "blends top onto base with a blend mode, like layers in an image editor. Shapes broadcast; use overlay() to place a smaller layer at an offset. Modes: normal, multiply, screen, overlay, soft_light, hard_light, darken, lighten, difference, exclusion, add, subtract, color_dodge, color_burn", details: "", params: {"base": "bottom layer", "top": "top layer", "mode": "blend mode name, e.g. \"screen\"", "opacity": "0-1 amount of the blended result; a number or a broadcastable tensor (default: 1)"}, aliases: [] },
|
||||
"pad": { minArgs: 2, maxArgs: 2, signature: "pad(x, padding)", forms: [["x", "padding"]], description: "pads tensor x with specified padding (dim 0 neg, dim 0 pos, dim 1 ...)", details: "", params: {"x": "tensor to pad", "padding": "amounts as [dim0_before, dim0_after, dim1_before, dim1_after, ...]"}, aliases: [] },
|
||||
"cross": { minArgs: 2, maxArgs: 2, signature: "cross(x, y)", forms: [["x", "y"]], description: "computes the cross product of x and y. Last dimension must be 3", details: "", params: {"x": "vectors with 3 components in the last dimension", "y": "vectors with 3 components in the last dimension"}, aliases: [] },
|
||||
"matmul": { minArgs: 2, maxArgs: 2, signature: "matmul(x, y)", forms: [["x", "y"]], description: "computes the matrix multiplication of x and y", details: "", params: {"x": "left matrix or batch of matrices", "y": "right matrix or batch of matrices"}, aliases: [] },
|
||||
@@ -239,11 +247,15 @@ export const FUNCTION_META = {
|
||||
"substr": { minArgs: 2, maxArgs: 3, signature: "substr(text, start, [length])", forms: [["text", "start", "[length]"]], description: "returns length characters of text starting at start. If length is not supplied, it returns the rest of the string", details: "", params: {"text": "source text", "start": "index of the first character", "length": "number of characters (default: the rest of the text)"}, aliases: ["substring"] },
|
||||
"find": { minArgs: 2, maxArgs: 2, signature: "find(text, search)", forms: [["text", "search"]], description: "returns the index of the first occurrence of search in text, or -1 if it is not found", details: "", params: {"text": "text to search in", "search": "text to look for"}, aliases: [] },
|
||||
"replace": { minArgs: 3, maxArgs: 3, signature: "replace(value, old, new)", forms: [["value", "old", "new"]], description: "replaces every occurrence of old with new; works on text, lists and tensors", details: "", params: {"value": "text, list or tensor", "old": "text or value to look for", "new": "replacement"}, aliases: [] },
|
||||
"regex_search": { minArgs: 2, maxArgs: 2, signature: "regex_search(text, pattern)", forms: [["text", "pattern"]], description: "returns the index of the first match of the regular expression pattern in text, or -1 if there is none", details: "", params: {"text": "text to search in", "pattern": "Python regular expression"}, aliases: [] },
|
||||
"regex_replace": { minArgs: 3, maxArgs: 3, signature: "regex_replace(text, pattern, replacement)", forms: [["text", "pattern", "replacement"]], description: "replaces every match of the regular expression pattern in text; replacement may refer to groups as \\1", details: "", params: {"text": "text to change", "pattern": "Python regular expression", "replacement": "replacement text"}, aliases: [] },
|
||||
"format": { minArgs: 1, maxArgs: 2, signature: "format(value, [spec])", forms: [["value", "[spec]"]], description: "formats numbers as text. spec is a number of decimals or a Python format spec such as \".3e\" (default: shortest form, \"g\"); lists and tensors are formatted per element", details: "", params: {"value": "number, list or tensor", "spec": "decimal count or format spec text"}, aliases: [] },
|
||||
"dilate": { minArgs: 1, maxArgs: 2, signature: "dilate(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological dilation to x with a square kernel (default size 3).", details: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"erode": { minArgs: 1, maxArgs: 2, signature: "erode(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological erosion to x with a square kernel (default size 3).", details: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"morph_open": { minArgs: 1, maxArgs: 2, signature: "morph_open(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological opening (erosion then dilation) to x with a square kernel (default size 3).", details: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"morph_close": { minArgs: 1, maxArgs: 2, signature: "morph_close(x, [kernel_size])", forms: [["x", "[kernel_size]"]], description: "applies morphological closing (dilation then erosion) to x with a square kernel (default size 3).", details: "", params: {"x": "mask or image with values 0-1", "kernel_size": "size of the square kernel (default: 3)"}, aliases: [] },
|
||||
"rgb_to_oklab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_oklab(rgb) / rgb_to_oklab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to OKLab. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", params: {"rgb": "sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list", "r": "red channel 0-1", "g": "green channel 0-1", "b": "blue channel 0-1"}, aliases: [] },
|
||||
"luminance": { minArgs: 1, maxArgs: 3, signature: "luminance(rgb) / luminance(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "Rec.709 luminance 0.2126 R + 0.7152 G + 0.0722 B of gamma-encoded colors. With one argument the first three entries of its last dimension are R, G, B and that dimension is removed", details: "", params: {"rgb": "colors (0-1) with R, G, B in the last dimension, or a 3-item list", "r": "red channel 0-1", "g": "green channel 0-1", "b": "blue channel 0-1"}, aliases: [] },
|
||||
"rgb_to_cielab": { minArgs: 1, maxArgs: 3, signature: "rgb_to_cielab(rgb) / rgb_to_cielab(r, g, b)", forms: [["rgb"], ["r", "g", "b"]], description: "converts 0-1 sRGB to CIELAB (D65) divided by 100, so L is 0-1. With one argument its last dimension holds R, G, B; with three, the channels are stacked into the last dimension of the result", details: "", params: {"rgb": "sRGB colors (0-1) with R, G, B in the last dimension, or a 3-item list", "r": "red channel 0-1", "g": "green channel 0-1", "b": "blue channel 0-1"}, aliases: [] },
|
||||
"oklab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "oklab_to_rgb(oklab) / oklab_to_rgb(l, a, b)", forms: [["oklab"], ["l", "a", "b"]], description: "converts OKLab to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", params: {"oklab": "OKLab colors with L, a, b in the last dimension, or a 3-item list", "l": "lightness", "a": "green-red axis", "b": "blue-yellow axis"}, aliases: [] },
|
||||
"cielab_to_rgb": { minArgs: 1, maxArgs: 3, signature: "cielab_to_rgb(cielab) / cielab_to_rgb(l, a, b)", forms: [["cielab"], ["l", "a", "b"]], description: "converts CIELAB divided by 100 (as returned by rgb_to_cielab) to 0-1 sRGB. With one argument its last dimension holds L, a, b; with three, the channels are stacked into the last dimension of the result", details: "", params: {"cielab": "CIELAB colors / 100 with L, a, b in the last dimension, or a 3-item list", "l": "lightness / 100 (0-1)", "a": "green-red axis / 100", "b": "blue-yellow axis / 100"}, aliases: [] },
|
||||
|
||||
Reference in New Issue
Block a user