BSZ Pixelbuster
Write a small program to recolor any image
- image
- IMAGE
BSZ Pixelbuster is the node that makes ComfyUI feel like a shader editor: instead of clicking a color-grading filter, you write the filter. It runs a small per-pixel program over your image - a language the author built in Rust, called Pixelbuster - so anything expressible as a per-pixel math operation is on the table, and anything that needs a neighborhood of pixels isn't.
Why you'd reach for it
Stock ComfyUI has color nodes, but they're fixed operations with fixed knobs. This one is a blank canvas: invert a channel, remap colors into LCH and shift hue, build a vignette from pixel coordinates, threshold with a comparison, even add per-pixel randomness (rand). If you've ever thought "I wish this node just did X," X is probably writable here in a few lines. The README's framing is that it's a whole miniature programming language sitting inside a node, and that's not hype.
Inputs
image- the IMAGE to process.code- the program, as multiline text. The default is a working example that produces a hue sweep across the image, so you can see the effect before changing anything.e1…e9- optional external floats that your code reads as variablese1…e9. These become UI sliders, which is how you make a single code program tunable without editing code.
Output: an IMAGE of the same size.
How the language works
Each line is target operation source. r ** 2 squares the red channel; g / b divides green by blue; lch switches to LCH color space and then you can write h = 180. Sources include channel letters (r g b a or c1…c4), variables v1…v9 (reset to 0 every pixel), constants, pi, rand, and the coordinate/geometry sources col, row, width, height, xnorm, ynorm. There are comparisons (gt, lteq…) with jumps (jmp/goto and :label), up to a hard limit of 99 jumps per pixel because loops can't be detected. Lines starting with # are comments; ; acts as a line break; trailing \ continues a line. That's the whole language - the full reference is in the pack's BSZ Pixelbuster Help node.
Under the hood it pads each image to an RGBA buffer, hands it to the prebuilt Pixelbuster Rust library over FFI, and writes the result back - and it clones the image first so it doesn't pollute ComfyUI's cache.
Install & gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/Beinsezii/bsz-cui-extras
restart, or install via ComfyUI Manager. No compilation needed: the pack ships prebuilt Pixelbuster libraries for Linux (.so), Windows (.dll), and macOS (.dylib) right inside the repo. That's the dependency this node would otherwise need, and the author took care of it - but it's also why the node exists at all: per-pixel loops in Python would be unusably slow, so this runs as native code.
If the node fails to load, the console prints a message pointing at the missing library - it would mean the prebuilt binary for your platform didn't load, and the fix is grabbing the right one from the author's pixelbuster repo. Realistically on a standard setup it just works. Start from the default example, switch to lch, and try h = 180 - one line, and the whole image hue-rotates.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| code | STRING | # See the 'BSZ Pixelbuster Help' # node for documentation # # External value sliders for # this node are as follows # e1 e2 e3 0.0 -> 1.0 # e4 e5 -1.0 -> 1.0 # e6 e7 0.0 -> 100.0 # e8 e9 -100.0 -> 100.0 LCH v1 = xnorm v1 * pi v1 sin v1 v2 = ynorm v2 * pi v2 / 2 v2 cos v2 v1 * v2 h = v1 h * 240 | — |
| e1opt | FLOAT | 0.00–1 | — |
| e2opt | FLOAT | 0.00–1 | — |
| e3opt | FLOAT | 0.00–1 | — |
| e4opt | FLOAT | 0.0-1–1 | — |
| e5opt | FLOAT | 0.0-1–1 | — |
| e6opt | FLOAT | 00–100 | — |
| e7opt | FLOAT | 00–100 | — |
| e8opt | FLOAT | 0-100–100 | — |
| e9opt | FLOAT | 0-100–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |