ComfyUI  >  Nodes  >  ComfyMath >  ComposeVec4

ComfyUI Node: ComposeVec4

Class Name


evanspearman (Account age: 4247 days)
Latest Updated
Github Stars

How to Install ComfyMath

Install this extension via the ComfyUI Manager by searching for  ComfyMath
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyMath 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

ComposeVec4 Description

Create Vec4 from 4 float values for precise control in 3D graphics, physics, and shaders.


The CM_ComposeVec4 node is designed to create a four-dimensional vector (Vec4) from four individual floating-point values. This node is particularly useful in mathematical and graphical computations where a Vec4 is required, such as in 3D graphics, physics simulations, and shader programming. By allowing you to specify each component of the vector individually, this node provides precise control over the vector's composition, enabling more accurate and flexible manipulation of data. The primary function of this node is to take four float inputs and combine them into a single Vec4 output, streamlining the process of vector creation and ensuring consistency in your workflows.

ComposeVec4 Input Parameters:


The x parameter represents the first component of the Vec4 vector. It is a floating-point value that you can set to define the x-coordinate of the vector. The default value is 0.0, but you can adjust it to any float value depending on your needs. This parameter is crucial for determining the horizontal position or the first dimension in various applications.


The y parameter represents the second component of the Vec4 vector. Similar to the x parameter, it is a floating-point value that defines the y-coordinate of the vector. The default value is 0.0, and it can be modified to any float value. This parameter is essential for setting the vertical position or the second dimension in your vector.


The z parameter represents the third component of the Vec4 vector. It is a floating-point value that specifies the z-coordinate of the vector. The default value is 0.0, but you can change it to any float value to suit your requirements. This parameter is important for defining the depth or the third dimension in 3D space.


The w parameter represents the fourth component of the Vec4 vector. It is a floating-point value that determines the w-coordinate of the vector. The default value is 0.0, and it can be set to any float value. This parameter is often used for additional data such as weight, time, or other scalar values in various computations.

ComposeVec4 Output Parameters:


The VEC4 output is the resulting four-dimensional vector composed of the input parameters x, y, z, and w. This output is a tuple containing the four float values in the order they were provided. The VEC4 output is essential for any operation or function that requires a Vec4, providing a standardized and consistent format for further processing or manipulation.

ComposeVec4 Usage Tips:

  • Use the CM_ComposeVec4 node to create vectors for 3D transformations, where the w component can be used for homogeneous coordinates.
  • Adjust the x, y, z, and w parameters to fine-tune the position and properties of objects in your graphical or simulation projects.
  • Combine this node with other vector manipulation nodes to perform complex mathematical operations and achieve desired effects in your projects.

ComposeVec4 Common Errors and Solutions:

Invalid input type for x, y, z, or w

  • Explanation: This error occurs when the input values for x, y, z, or w are not of type float.
  • Solution: Ensure that all input values are floating-point numbers. If necessary, convert other data types to float before inputting them into the node.

Missing input value for x, y, z, or w

  • Explanation: This error happens when one or more of the required input parameters are not provided.
  • Solution: Make sure to provide values for all four input parameters (x, y, z, and w). If you want to use the default value, explicitly set it to 0.0.

Output not as expected

  • Explanation: The output Vec4 does not match the expected values due to incorrect input parameters.
  • Solution: Double-check the values you have input for x, y, z, and w to ensure they are correct and as intended. Adjust the values if necessary to achieve the desired output.

ComposeVec4 Related Nodes

Go back to the extension to check out more related nodes.

© 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.