glslBuffers
GlslBuffers — pull individual passes out of a multi-buffer shader
- buffers
- IMAGE
Real GLSL effects are rarely one pass. A fluid simulation needs a velocity field, a raymarcher needs its own depth buffer, a post-process chain needs intermediate images - and if your shader declares #ifdef BUFFER_0 / #ifdef BUFFER_1 blocks, glslViewer renders each one to its own offscreen texture. glslBuffers is the node that reaches into that output and pulls one of those passes out as a normal IMAGE.
Think of it as the extraction port for the pack. The renderer produces the whole multi-pass pipeline; this node lets each individual pass escape into the wider ComfyUI graph - where it can feed a PreviewImage, a VHS_VideoCombine to save it as video, a MaskToImage, or further post-processing. The pack's own raymarch_buffers example uses exactly this pattern: several glslBuffers nodes, one per pass, all feeding video combiners.
Inputs and output
Three inputs, all required:
- buffers (
GLSL_BUFFERS) - the buffer bundle straight fromglslViewer'sbuffersoutput. - type -
BUFFERorDOUBLE_BUFFER. Regular buffers are a single pass you can sample; double buffers swap between two textures frame to frame, which is how you write accumulation effects and feedback loops in a shader. Set this to match the#ifdef BUFFER_Xvs#ifdef DOUBLE_BUFFER_Xblock you're targeting. - index - the
XinBUFFER_X/DOUBLE_BUFFER_X, as an integer.BUFFER_0means index 0.
The output is a single IMAGE: the contents of that buffer, across every rendered frame, stacked into one batch tensor - so if glslViewer rendered 90 frames, this outputs a 90-frame image sequence ready for video assembly. If you ask for a buffer index that doesn't exist in the shader, the node returns a 1×1 tensor rather than crashing, so you get a blank rather than a red graph.
How it fits
The two-buffer dance is the classic feedback-loop setup: pass A writes the current state, pass B samples what pass A wrote last frame and evolves it, and the whole thing runs through glslViewer's frames loop. Without the buffers output, all of that stays trapped inside the shader. With glslBuffers, each stage becomes a first-class image you can inspect, mask, or pipe anywhere in the graph.
Install
ComfyUI Manager → search "GLSL Nodes", or cd ComfyUI/custom_nodes && git clone https://github.com/patriciogonzalezvivo/comfyui_glslnodes, then restart. Dependencies (moderngl, numpy, snowy) install automatically on first boot.
One thing to keep in mind: buffer passes only exist if your shader actually declares them. This node is a passthrough, not a generator - if nothing in your GLSL has a #ifdef BUFFER_ block, there's nothing to extract, and you'll get the blank tensor. Check the shader first, then wire the extraction.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| buffers | GLSL_BUFFERS | — | |
| type | COMBO | BUFFER | 2 options: BUFFER, DOUBLE_BUFFER |
| index | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |