ComfyUI Node
INVERT (JOV_GL)
Invert the channels of an image along a scalar [0..1] range.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| imageopt | IMAGE | 4-channel data | |
| invertopt | VEC4 | 0,0,0,0 | amount to invert each channel |
| FRAGMENTopt | STRING | // 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)
| Name | Type | Description |
|---|---|---|
| RGBA | IMAGE | Full channel [RGBA] image. If there is an alpha, the image will be masked out with it when using this output. |
| RGB | IMAGE | Three channel [RGB] image. There will be no alpha. |
| MASK | MASK | Single channel mask output. |