Skip to content

Commit

Permalink
stack, stringer
Browse files Browse the repository at this point in the history
version up
  • Loading branch information
Amorano committed Sep 24, 2024
1 parent a30112b commit 877074f
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 47 deletions.
45 changes: 17 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div></h2>

<h3><div align="center">
JOVIMETRIX IS ONLY GUARANTEED TO SUPPORT <a href="https://github.com/comfyanonymous/ComfyUI">COMFYUI 0.1.2+</a> and <a href="https://github.com/Comfy-Org/ComfyUI_frontend">FRONTEND 1.2.30+</a><br>
JOVIMETRIX IS ONLY GUARANTEED TO SUPPORT <a href="https://github.com/comfyanonymous/ComfyUI">COMFYUI 0.1.3+</a> and <a href="https://github.com/Comfy-Org/ComfyUI_frontend">FRONTEND 1.2.40+</a><br>
IF YOU NEED AN OLDER VERSION, PLEASE DO NOT UPDATE.
</div></h3>

Expand Down Expand Up @@ -47,16 +47,17 @@ Please consider sponsoring me if you enjoy the results of my work, code or docum
* GLSL shader support
* * `GLSL Node` provides raw access to Vertex and Fragment shaders
* * `Dynamic GLSL` dynamically convert existing GLSL scripts file into ComfyUI nodes at runtime
* * Hand written GLSL nodes to speed up specific tasks better done on the GPU (10x speedup in most cases)
* * Over 20+ Hand written GLSL nodes to speed up specific tasks better done on the GPU (10x speedup in most cases)
* `STREAM READER` node to capture monitor, webcam or url media
* `STREAM WRITER` node to export media to a HTTP/HTTPS server for OBS or other 3rd party streaming software
* `SPOUT` streaming support *WINDOWS ONLY*
* MIDI device read support with `MIDI FILTER` and `MIDI FILTER EZ` nodes to drive other node parameters
* Full Text generation support using installed system fonts
* Basic parameteric shape (Circle, Square, Polygon) generator
* Basic parametric shape (Circle, Square, Polygon) generator
* `COLOR BLIND` check support
* `COLOR MATCH` against existing images or create a custom LUT
* Generate `COLOR THEORY` spreads from an existing image
* `COLOR MEANS` to generate palettes for existing images to keep other images in the same tonal ranges
* `PIXEL SPLIT` separate the channels of an image to manipulate and `PIXEL MERGE` them back together
* `STACK` a series of images into a new single image vertically, horizontally or in a grid
* Or `FLATTEN` a batch of images into a single image with each image subsequently added on top (slap comp)
Expand Down Expand Up @@ -95,6 +96,16 @@ If those nodes have descriptions written in HTML or Markdown, they will be conve

## UPDATES

**2024/09/21** @1.2.40:
* Colorizer panel ported to new frontend.
* numerical bit conversion for Number fields, String fields (character bits) and Image fields (pixels on/off)
* new `COLOR MEANS` node will generate color palettes of the top-k colors of an input
* new `BIT SPLIT` node will turn inputs into streams of bits used for modulation and triggering of other inputs

* Officially Supported Versions:
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.40+

**2024/09/18** @1.2.39:
* `COMPARISON` node updated to support NONE for all inputs
* Fixed bad inputs for IMAGE/MASK where they were compound use on slots
Expand All @@ -104,23 +115,18 @@ If those nodes have descriptions written in HTML or Markdown, they will be conve
* new `GLSL COLOR PALETTE` node based on cosines
* new `GLSL INVERT` node
* new `GLSL FILTER RANGE` node
* Supported Versions:
* Officially Supported Versions:
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.30+

**2024/09/09** @1.2.38:
* `QUEUE`s will signal true (TRIGGER) on complete unless halted
* Supported Versions:
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.30+

**2024/09/09** @1.2.37:
* doubled speed of midi reader when idle
* reduced GLSL footprint for color conversions
* * sorry if that blew someone's network!
* new `GLSL COLOR PALETTE` node based on cosines
* new `GLSL HSV ADJUST`
* Supported Versions:
* Officially Supported Versions:
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.30+

Expand All @@ -133,7 +139,7 @@ If those nodes have descriptions written in HTML or Markdown, they will be conve
* new `GLSL CONICAL GRADIENT` Node
* new `EDGE` mode for `GLSL shaders`: Clamp, Wrap, Mirror
* `QUEUE TOO` Node updated to support batch
* Supported Versions:
* Officially Supported Versions:
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.30+

Expand All @@ -146,23 +152,6 @@ If those nodes have descriptions written in HTML or Markdown, they will be conve
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.30+

**2024/09/04** @1.2.34:
* Import change for chromium tab crash
* Added ComfyUI default "tooltips" as last fallback for help docs
* Supports Versions:
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.30+

**2024/09/03** @1.2.33:
* New `QUEUE TOO` Node focused on efficient image media loading.
* Better reporting in `AKASHIC` Node for core ComfyUI types.
* `MODE` setting for most nodes has been defaulted to `MATTE`. The older `NONE` setting has been removed.
* Thanks to [christian-byrne](https://github.com/christian-byrne) for squashing a bug in [the help sidebar!](https://github.com/Amorano/Jovimetrix/pull/55)
* Thanks to [Ainaemaet](https://github.com/Ainaemaet) for cleaning up the `STREAM READER` Node device list [when no devices are present](https://github.com/Amorano/Jovimetrix/pull/53)!
* Supports Versions:
* ComfyUI 0.1.3+
* ComfyUI Frontend 1.2.30+

# INSTALLATION

[Please see the wiki for advanced use of the environment variables used during startup](https://github.com/Amorano/Jovimetrix/wiki/B.-ASICS)
Expand Down
40 changes: 28 additions & 12 deletions core/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@
try: JOV_DELAY_MAX = int(os.getenv("JOV_DELAY_MAX", JOV_DELAY_MAX))
except: pass

# ==============================================================================
# === LAMBDA ===
# ==============================================================================

LAMBDA_FLATTEN = lambda data: [item for sublist in data for item in sublist]

def flatten(data):
if isinstance(data, list):
return [a for i in data for a in flatten(i)]
else:
return [data]

# ==============================================================================
# === ENUMERATION ===
# ==============================================================================

class EnumBinaryOperation(Enum):
Expand Down Expand Up @@ -148,15 +162,6 @@ class EnumUnaryOperation(Enum):
IS_EVEN = 90
IS_ODD = 91

class Results(object):
def __init__(self, *arg, **kw) -> None:
self.frame = []
self.lin = []
self.fixed = []
self.trigger = []

# ==============================================================================

# Dictionary to map each operation to its corresponding function
OP_UNARY = {
EnumUnaryOperation.ABS: lambda x: math.fabs(x),
Expand Down Expand Up @@ -186,6 +191,15 @@ def __init__(self, *arg, **kw) -> None:
}

# ==============================================================================
# === CLASS ===
# ==============================================================================

class ResultObject(object):
def __init__(self, *arg, **kw) -> None:
self.frame = []
self.lin = []
self.fixed = []
self.trigger = []

class BitSplitNode(JOVBaseNode):
NAME = "BIT SPLIT (JOV) ⭄"
Expand Down Expand Up @@ -750,7 +764,8 @@ def run(self, **kw) -> Tuple[torch.Tensor, torch.Tensor]:
logger.warn("no data for list")
return ([],)
# flat list of ALL the dynamic inputs...
data_list = [item for sublist in data_list for item in sublist]
data_list = flatten(data_list)
print(123, data_list)
# single operation mode -- like array node
op = parse_param(kw, Lexicon.FUNC, EnumConvertString, EnumConvertString.SPLIT.name)[0]
key = parse_param(kw, Lexicon.KEY, EnumConvertType.STRING, "")[0]
Expand All @@ -761,7 +776,7 @@ def run(self, **kw) -> Tuple[torch.Tensor, torch.Tensor]:
case EnumConvertString.SPLIT:
results = data_list
if key != "":
results = [r.split(key) for r in data_list]
results = flatten([r.split(key) for r in data_list])
case EnumConvertString.JOIN:
results = [key.join(data_list)]
case EnumConvertString.FIND:
Expand All @@ -781,6 +796,7 @@ def run(self, **kw) -> Tuple[torch.Tensor, torch.Tensor]:
results.append(x)
if len(results) == 0:
results = [""]
print(results)
return (results, [len(r) for r in results],) if len(results) > 1 else (results[0], len(results[0]),)

class SwizzleNode(JOVBaseNode):
Expand Down Expand Up @@ -907,7 +923,7 @@ def run(self, ident, **kw) -> Tuple[int, float, float, Any]:
if loop == 0 and (parse_reset(ident) > 0 or reset):
self.__frame = 0
trigger = None
results = Results()
results = ResultObject()
pbar = ProgressBar(batch)
step = stride if stride != 0 else max(1, loop / batch)
for idx in range(batch):
Expand Down
8 changes: 3 additions & 5 deletions core/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,7 @@ def run(self, **kw) -> Tuple[torch.Tensor, torch.Tensor]:
if len(images) == 0:
logger.warning("no images to stack")
return
data = []
for i in images:
data.extend(i)
images = [tensor2cv(i) for i in data]
images = [tensor2cv(img) for sublist in images for img in sublist]

axis = parse_param(kw, Lexicon.AXIS, EnumOrientation, EnumOrientation.GRID.name)[0]
stride = parse_param(kw, Lexicon.STEP, EnumConvertType.INT, 1)[0]
Expand All @@ -936,7 +933,8 @@ def run(self, **kw) -> Tuple[torch.Tensor, torch.Tensor]:
if mode != EnumScaleMode.MATTE:
w, h = wihi
img = image_scalefit(img, w, h, mode, sample)
return cv2tensor_full(img, matte)
rgba, rgb, mask = cv2tensor_full(img, matte)
return rgba.unsqueeze(0), rgb.unsqueeze(0), mask.unsqueeze(0)

class ThresholdNode(JOVImageNode):
NAME = "THRESHOLD (JOV) 📉"
Expand Down
1 change: 0 additions & 1 deletion core/create_glsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def run(self, ident, **kw) -> tuple[torch.Tensor]:
variables = kw.copy()
for p in [Lexicon.MODE, Lexicon.WH, Lexicon.SAMPLE, Lexicon.MATTE, Lexicon.BATCH, Lexicon.TIME, Lexicon.FPS, Lexicon.EDGE]:
variables.pop(p, None)
print(variables)

self.__glsl.fps = parse_param(kw, Lexicon.FPS, EnumConvertType.INT, 24, 1, 120)[0]
if batch > 0 or self.__delta != delta:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[project]
name = "jovimetrix"
description = "Integrates Webcam, MIDI, Spout and GLSL shader support. Animation via tick. Parameter manipulation with wave generator. Math operations with Unary and Binary support. Value conversion for all major types (int, string, list, dict, Image, Mask). Shape mask generation, image stacking and channel ops, batch splitting, merging and randomizing, load images and video from anywhere, dynamic bus routing with a single node, export support for GIPHY, save output anywhere! flatten, crop, transform; check colorblindness, make stereogram or stereoscopic images, or liner interpolate values and more."
version = "1.2.39"
version = "1.2.40"
license = { file = "LICENSE" }
dependencies = [
"aenum>=3.1.15,<4",
"aiohttp>=3.10.5",
"blendmodes>=2024.1.1",
"daltonlens>=0.1.5",
"glfw>=2.7.0",
Expand Down
Binary file modified res/wiki/color_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 877074f

Please sign in to comment.