Nodes/Jovi_GLSL/INVERT (JOV_GL)
ComfyUI Node

INVERT (JOV_GL)

Invert the channels of an image along a scalar [0..1] range.

By Amorano·Created 2 years ago·Updated 12 months ago· 20
INVERT (JOV_GL)
  • image
  • invert
  • RGBA
  • RGB
  • MASK
FRAGMENT// name: INVERT // desc: Invert the channels of an image along a scalar [0..1] range. // category: COLOR uniform sampler2D image; // | 4-channel data uniform vec4 invert; // 0,0,0,0;0;1 | amount to invert each channel void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord.xy / iResolution.xy; vec4 col = texture(image, uv); fragColor = mix(col, 1.0 - col, invert); }
CategoryJOV_GL 🌈/COLOR

Inputs (3)

NameTypeDefaultDescription
imageoptIMAGE4-channel data
invertoptVEC40,0,0,0amount to invert each channel
FRAGMENToptSTRING// name: INVERT // desc: Invert the channels of an image along a scalar [0..1] range. // category: COLOR uniform sampler2D image; // | 4-channel data uniform vec4 invert; // 0,0,0,0;0;1 | amount to invert each channel void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord.xy / iResolution.xy; vec4 col = texture(image, uv); fragColor = mix(col, 1.0 - col, invert); }

Outputs (3)

NameTypeDescription
RGBAIMAGEFull channel [RGBA] image. If there is an alpha, the image will be masked out with it when using this output.
RGBIMAGEThree channel [RGB] image. There will be no alpha.
MASKMASKSingle channel mask output.