ComfyUI/blueprints/.glsl
pythongosssss 96d6bd1a4a
Add GLSL shader node using PyOpenGL (#12148)
* adds support for executing simple glsl shaders
using moderngl package

* tidy

* Support multiple outputs

* Try fix build

* fix casing

* fix line endings

* convert to using PyOpenGL and glfw

* remove cpu support

* tidy

* add additional support for egl & osmesa backends

* fix ci
perf: only read required outputs

* add diagnostics, update mac initialization

* GLSL glueprints + node fixes (#12492)

* Add image operation blueprints

* Add channels

* Add glow

* brightness/contrast

* hsb

* add glsl shader update system

* shader nit iteration

* add multipass for faster blur

* more fixes

* rebuild blueprints

* print -> logger

* Add edge preserving blur

* fix: move _initialized flag to end of GLContext.__init__

Prevents '_vao' attribute error when init fails partway through
and subsequent calls skip initialization due to early _initialized flag.

* update valid ranges
- threshold 0-100
- step 0+

* fix value ranges

* rebuild node to remove extra inputs

* Fix gamma step

* clamp saturation in colorize instead of wrapping

* Fix crash on 1x1 px images

* rework description

* remove unnecessary f


Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
Co-authored-by: Hunter Senft-Grupp <hunter@comfy.org>
2026-02-19 23:22:13 -05:00
..
Brightness_and_Contrast_1.frag
Chromatic_Aberration_16.frag
Color_Adjustment_15.frag
Edge-Preserving_Blur_128.frag
Film_Grain_15.frag
Glow_30.frag
Hue_and_Saturation_1.frag
Image_Blur_1.frag
Image_Channels_23.frag
Image_Levels_1.frag
README.md
Sharpen_23.frag
Unsharp_Mask_26.frag
update_blueprints.py

GLSL Shader Sources

This folder contains the GLSL fragment shaders extracted from blueprint JSON files for easier editing and version control.

File Naming Convention

{Blueprint_Name}_{node_id}.frag

  • Blueprint_Name: The JSON filename with spaces/special chars replaced by underscores
  • node_id: The GLSLShader node ID within the subgraph

Usage

# Extract shaders from blueprint JSONs to this folder
python update_blueprints.py extract

# Patch edited shaders back into blueprint JSONs
python update_blueprints.py patch

Workflow

  1. Run extract to pull current shaders from JSONs
  2. Edit .frag files
  3. Run patch to update the blueprint JSONs
  4. Test
  5. Commit both .frag files and updated JSONs