ComfyUI  >  Nodes  >  GLSL Nodes >  glslViewer

ComfyUI Node: glslViewer

Class Name

glslViewer

Category
GLSL
Author
Patricio Gonzalez Vivo (Account age: 5109 days)
Extension
GLSL Nodes
Latest Updated
7/21/2024
Github Stars
0.1K

How to Install GLSL Nodes

Install this extension via the ComfyUI Manager by searching for  GLSL Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter GLSL Nodes in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

glslViewer Description

Facilitates GLSL shader rendering in ComfyUI, supports advanced visual effects with dynamic configurations.

glslViewer:

The glslViewer node is designed to facilitate the rendering of GLSL (OpenGL Shading Language) shaders within the ComfyUI environment. This node allows you to create and manipulate complex visual effects by leveraging the power of GLSL. It supports the use of multiple buffers and double buffers, enabling advanced rendering techniques such as multi-pass rendering and feedback loops. The node is highly configurable, allowing you to set various uniforms and textures dynamically, making it a versatile tool for AI artists looking to integrate shader-based visual effects into their projects. By providing a structured way to manage and render GLSL shaders, glslViewer enhances your ability to create intricate and visually stunning graphics.

glslViewer Input Parameters:

fragment_code

The fragment_code parameter is a dictionary containing the GLSL fragment shader code that defines the visual effect you want to render. This code is the core of your shader and dictates how each pixel on the screen is processed. The shader code can include various uniforms and textures that will be dynamically set during execution. There are no specific minimum or maximum values for this parameter, but it must be valid GLSL code.

width

The width parameter specifies the width of the rendering canvas in pixels. This determines the horizontal resolution of the output image. The minimum value is 1, and there is no explicit maximum value, but it should be within the capabilities of your hardware. The default value is typically set based on the desired output resolution.

height

The height parameter specifies the height of the rendering canvas in pixels. This determines the vertical resolution of the output image. The minimum value is 1, and there is no explicit maximum value, but it should be within the capabilities of your hardware. The default value is typically set based on the desired output resolution.

frames

The frames parameter indicates the number of frames to render. This is particularly useful for animations or time-based effects. The minimum value is 1, and there is no explicit maximum value, but it should be set according to the length of the animation you wish to create. The default value is usually set to the number of frames required for a complete animation cycle.

fps

The fps parameter stands for frames per second and determines the playback speed of the rendered frames. This affects the timing of animations and time-based effects in your shader. The minimum value is 1, and there is no explicit maximum value, but it should be set according to the desired smoothness of the animation. The default value is typically 30 or 60 fps.

kwargs

The kwargs parameter is a dictionary of optional keyword arguments that can include additional uniforms and textures. These are dynamically set and can be used to pass extra data to your shader, such as images or numerical values. The keys should start with uniforms, u_tex, or u_val to be recognized correctly. There are no specific minimum or maximum values, but the data must be compatible with the shader code.

glslViewer Output Parameters:

images_out

The images_out parameter is a tensor containing the rendered images. Each frame of the animation or visual effect is stored as a separate image in this tensor. The images are in RGB format and can be used for further processing or saved as output files. This output is crucial for visualizing the results of your GLSL shader.

masks_out

The masks_out parameter is a tensor containing the alpha masks of the rendered images. Each frame's alpha channel is stored separately, allowing you to use these masks for compositing or other image processing tasks. This output is important for handling transparency and blending effects in your rendered images.

glslViewer Usage Tips:

  • Ensure your fragment_code is valid GLSL and includes all necessary uniforms and textures to avoid runtime errors.
  • Adjust the width and height parameters to match the desired resolution of your output, keeping in mind the capabilities of your hardware.
  • Use the frames and fps parameters to control the length and smoothness of your animations, setting them according to the specific needs of your project.
  • Utilize the kwargs parameter to pass additional data to your shader, such as images or numerical values, to create more dynamic and interactive visual effects.

glslViewer Common Errors and Solutions:

Invalid GLSL Code

  • Explanation: The fragment_code contains syntax errors or unsupported GLSL features.
  • Solution: Review and correct the GLSL code, ensuring it adheres to the GLSL specification and includes all necessary uniforms and textures.

Resolution Too High

  • Explanation: The width or height parameters are set too high, exceeding the capabilities of your hardware.
  • Solution: Reduce the resolution to a value that your hardware can handle, ensuring smooth rendering performance.

Missing Uniforms or Textures

  • Explanation: The shader code references uniforms or textures that are not provided in the kwargs parameter.
  • Solution: Ensure all referenced uniforms and textures are included in the kwargs dictionary with the correct keys and values.

Frame Count Too Low

  • Explanation: The frames parameter is set too low, resulting in an incomplete animation.
  • Solution: Increase the frames parameter to cover the entire duration of the animation.

FPS Too High

  • Explanation: The fps parameter is set too high, causing performance issues or dropped frames.
  • Solution: Lower the fps parameter to a value that ensures smooth playback without overloading your hardware.

glslViewer Related Nodes

Go back to the extension to check out more related nodes.
GLSL Nodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.