ComfyUI Node
BD GLSL Batch (iterate uniforms)
Run a GLSL shader N times with different uniform values, batching the fc0/fc1/fc2/fc3 outputs along the batch dimension. Shader compiles ONCE per call, reused across iterations — much faster than re-submitting the workflow N times. Iteration count is auto-detected from the longest 'vary' list. Uniforms not listed in a vary spec use their base value (same every iteration). Vary syntax: one line per uniform, 'u_intN=v1,v2,v3,...' or 'u_floatN=v1,v2,v3,...'. Lines with one value are treated as constants.
BD GLSL Batch (iterate uniforms)
- u_image0
- u_image1
- u_image2
- u_image3
- u_image4
- fc0_batch
- fc1_batch
- fc2_batch
- fc3_batch
- iteration_names
- iteration_count
◄fragment_shader#version 300 es
precision highp float;
in vec2 v_texCoord;
uniform sampler2D u_image0;
layout(location=0) out vec4 fragColor0;
void main(){ fragColor0 = texture(u_image0, v_texCoord); }►
◄fragment_shader_file►
◄floats►
◄ints►
◄vary_ints►
◄vary_floats►
◄iteration_names►
◄iterations_override0►
◄width0►
◄height0►
Category🧠BrainDead/GLSL
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| fragment_shader | STRING | #version 300 es precision highp float; in vec2 v_texCoord; uniform sampler2D u_image0; layout(location=0) out vec4 fragColor0; void main(){ fragColor0 = texture(u_image0, v_texCoord); } | The fragment shader source code (GLSL ES 3.0). OVERRIDDEN by fragment_shader_file if that path is set and exists. |
| fragment_shader_file | STRING | Optional ABSOLUTE path to a .glsl file. When set and the file exists, its contents are used instead of the fragment_shader text field. Lets you edit the shader externally and have BD_GLSLBatch pick up the latest version on each workflow execution. Example: /path/to/shaders/skin_shader.glsl | |
| floats | STRING | Base float uniform values, one per line: u_float0=0.48 u_float1=0.5 Indexes 0..19. Missing slots default to 0.0. | |
| ints | STRING | Base int uniform values, one per line: u_int0=255 u_int1=128 Indexes 0..12. Missing slots default to 0. | |
| vary_ints | STRING | Per-iteration int overrides. One uniform per line: u_int3=255,240,160,140 u_int4=255,190,110,190 Iteration count = longest list. Single-value lines are constants. | |
| vary_floats | STRING | Per-iteration float overrides. Same format as vary_ints. | |
| iteration_names | STRING | One name per iteration for downstream filename use: light medium dark zombie Defaults to '1', '2', '3', ... if empty. | |
| u_image0opt | IMAGE | Bound to sampler2D u_image0. | |
| u_image1opt | IMAGE | Bound to sampler2D u_image1. | |
| u_image2opt | IMAGE | Bound to sampler2D u_image2. | |
| u_image3opt | IMAGE | Bound to sampler2D u_image3. | |
| u_image4opt | IMAGE | Bound to sampler2D u_image4. | |
| iterations_overrideopt | INT | 00–128 | If > 0, force this iteration count. 0 = auto-detect from vary specs. |
| widthopt | INT | 00–8192 | Output width. 0 = use u_image0's width. |
| heightopt | INT | 00–8192 | Output height. 0 = use u_image0's height. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| fc0_batch | IMAGE | Stacked IMAGE batch (B=N_iterations) of fc0 outputs. |
| fc1_batch | IMAGE | — |
| fc2_batch | IMAGE | — |
| fc3_batch | IMAGE | — |
| iteration_names | STRING | Newline-joined iteration names, in order. |
| iteration_count | INT | — |