Nodes/ComfyUI/GLSL Shader
ComfyUI Node Runs on cloud

GLSL Shader

Apply GLSL ES fragment shaders to images. u_resolution (vec2) is always available.

By Comfy-Org·Created 4 years ago·Updated 20 days ago· 121,575
GLSL Shader
  • images
  • floats
  • ints
  • bools
  • curves
  • IMAGE0
  • IMAGE1
  • IMAGE2
  • IMAGE3
fragment_shader#version 300 es precision highp float; uniform sampler2D u_image0; uniform vec2 u_resolution; in vec2 v_texCoord; layout(location = 0) out vec4 fragColor0; void main() { fragColor0 = texture(u_image0, v_texCoord); }
size_mode
Categoryimage/shader

Inputs (7)

NameTypeDefaultDescription
fragment_shaderSTRING#version 300 es precision highp float; uniform sampler2D u_image0; uniform vec2 u_resolution; in vec2 v_texCoord; layout(location = 0) out vec4 fragColor0; void main() { fragColor0 = texture(u_image0, v_texCoord); } GLSL fragment shader source code (GLSL ES 3.00 / WebGL 2.0 compatible)
size_modeCOMBOOutput size: 'from_input' uses first input image dimensions, 'custom' allows manual size
imagesCOMFY_AUTOGROW_V3Images are available as u_image0-4 (sampler2D) in the shader code
floatsCOMFY_AUTOGROW_V3Floats are available as u_float0-19 in the shader code
intsCOMFY_AUTOGROW_V3Ints are available as u_int0-19 in the shader code
boolsCOMFY_AUTOGROW_V3Booleans are available as u_bool0-9 (bool) in the shader code
curvesCOMFY_AUTOGROW_V3Curves are available as u_curve0-3 (sampler2D, 1D LUT) in the shader code. Sample with texture(u_curve0, vec2(x, 0.5)).r

Outputs (4)

NameTypeDescription
IMAGE0IMAGEAvailable via layout(location = 0) out vec4 fragColor0 in the shader code
IMAGE1IMAGEAvailable via layout(location = 1) out vec4 fragColor1 in the shader code
IMAGE2IMAGEAvailable via layout(location = 2) out vec4 fragColor2 in the shader code
IMAGE3IMAGEAvailable via layout(location = 3) out vec4 fragColor3 in the shader code