> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-lora-training-1772768349.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GLSLShader - ComfyUI Built-in Node Documentation

> Complete documentation for the GLSLShader node in ComfyUI. Learn its inputs, outputs, parameters and usage.

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/GLSLShader/en.md)

The GLSL Shader node applies custom GLSL ES fragment shader code to input images. It allows you to write shader programs that can process multiple images and accept uniform parameters (floats and integers) to create complex visual effects. The output size can be determined by the first input image or set manually.

## Inputs

| Parameter         | Data Type | Required | Range                          | Description                                                                                                                         |
| ----------------- | --------- | -------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| `fragment_shader` | STRING    | Yes      | N/A                            | GLSL fragment shader source code (GLSL ES 3.00 / WebGL 2.0 compatible). Default: A basic shader that outputs the first input image. |
| `size_mode`       | COMBO     | Yes      | `"from_input"`<br />`"custom"` | Output size: 'from\_input' uses first input image dimensions, 'custom' allows manual size.                                          |
| `width`           | INT       | No       | 1 to 16384                     | The width of the output image when `size_mode` is set to `"custom"`. Default: 512.                                                  |
| `height`          | INT       | No       | 1 to 16384                     | The height of the output image when `size_mode` is set to `"custom"`. Default: 512.                                                 |
| `images`          | IMAGE     | Yes      | 1 to 8 images                  | Input images to be processed by the shader. Images are available as `u_image0` to `u_image7` (sampler2D) in the shader code.        |
| `floats`          | FLOAT     | No       | 0 to 8 floats                  | Floating-point uniform values for the shader. Floats are available as `u_float0` to `u_float7` in the shader code. Default: 0.0.    |
| `ints`            | INT       | No       | 0 to 8 integers                | Integer uniform values for the shader. Ints are available as `u_int0` to `u_int7` in the shader code. Default: 0.                   |

**Notes:**

* The `width` and `height` parameters are only required and visible when `size_mode` is set to `"custom"`.
* At least one input image is required.
* The shader code always has access to a `u_resolution` (vec2) uniform containing the output dimensions.
* A maximum of 8 input images, 8 float uniforms, and 8 integer uniforms can be provided.

## Outputs

| Output Name | Data Type | Description                                                                                                           |
| ----------- | --------- | --------------------------------------------------------------------------------------------------------------------- |
| `IMAGE0`    | IMAGE     | The first output image from the shader. Available via `layout(location = 0) out vec4 fragColor0` in the shader code.  |
| `IMAGE1`    | IMAGE     | The second output image from the shader. Available via `layout(location = 1) out vec4 fragColor1` in the shader code. |
| `IMAGE2`    | IMAGE     | The third output image from the shader. Available via `layout(location = 2) out vec4 fragColor2` in the shader code.  |
| `IMAGE3`    | IMAGE     | The fourth output image from the shader. Available via `layout(location = 3) out vec4 fragColor3` in the shader code. |
