ComfyUI  >  Nodes  >  ComfyMath >  Vec4UnaryOperation

ComfyUI Node: Vec4UnaryOperation

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

Vec4UnaryOperation Description

Perform unary operations on 4D vectors for AI artists, streamlining complex vector manipulations.


The CM_Vec4UnaryOperation node is designed to perform a variety of unary operations on 4-dimensional vectors (Vec4). This node is particularly useful for AI artists who need to manipulate vector data in their projects, such as transforming, normalizing, or applying mathematical functions to vectors. By leveraging this node, you can streamline complex vector operations into a single, easy-to-use interface, enhancing your workflow and enabling more sophisticated vector manipulations without requiring deep technical knowledge.

Vec4UnaryOperation Input Parameters:


The op parameter specifies the unary operation to be performed on the input vector. It accepts a list of predefined operations, each corresponding to a specific mathematical function or transformation. The available options are determined by the VEC_UNARY_OPERATIONS dictionary. This parameter is crucial as it defines the nature of the transformation applied to the vector. There are no minimum or maximum values, but the default value is typically the first operation in the list.


The a parameter represents the input 4-dimensional vector (Vec4) on which the unary operation will be performed. This vector is defined by four floating-point numbers, each representing a component of the vector. The input vector's values directly impact the result of the unary operation, making it essential to provide accurate and meaningful data. The default value for this parameter is DEFAULT_VEC4, which is a predefined vector.

Vec4UnaryOperation Output Parameters:


The output parameter VEC4 is the resulting 4-dimensional vector after the specified unary operation has been applied to the input vector a. This output vector retains the same dimensionality as the input but with transformed values based on the chosen operation. The output is crucial for further processing or visualization in your AI art projects, providing the transformed vector data needed for subsequent steps.

Vec4UnaryOperation Usage Tips:

  • Ensure that the input vector a is correctly defined and represents the data you intend to manipulate, as the accuracy of the input directly affects the output.
  • Familiarize yourself with the available unary operations in the VEC_UNARY_OPERATIONS dictionary to select the most appropriate transformation for your needs.

Vec4UnaryOperation Common Errors and Solutions:

Invalid operation selected

  • Explanation: The op parameter value does not match any of the available operations in the VEC_UNARY_OPERATIONS dictionary.
  • Solution: Verify that the op parameter is set to one of the valid operations listed in the VEC_UNARY_OPERATIONS dictionary.

Input vector not defined

  • Explanation: The input vector a is not provided or is incorrectly defined.
  • Solution: Ensure that the input vector a is specified and follows the correct format of a 4-dimensional vector (Vec4).

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