ComfyUI  >  Nodes  >  Various ComfyUI Nodes by Type >  Image Contrast

ComfyUI Node: Image Contrast

Class Name

JWImageContrast

Category
jamesWalker55
Author
jamesWalker55 (Account age: 2581 days)
Extension
Various ComfyUI Nodes by Type
Latest Updated
7/27/2024
Github Stars
0.0K

How to Install Various ComfyUI Nodes by Type

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

Image Contrast Description

Adjust image contrast to enhance light-dark difference for vivid, dynamic visuals in artistic projects.

Image Contrast:

The JWImageContrast node is designed to adjust the contrast of an image, enhancing the difference between the light and dark areas. This node is particularly useful for AI artists who want to emphasize certain features or details in their images, making them stand out more vividly. By manipulating the contrast, you can create more dynamic and visually appealing images, which can be crucial for artistic projects, presentations, or any visual content that requires a strong impact. The node leverages advanced image processing techniques to ensure that the contrast adjustment is smooth and natural, preserving the overall quality of the image.

Image Contrast Input Parameters:

image

This parameter expects an image input in the form of a tensor. The image serves as the base on which the contrast adjustment will be applied. The quality and resolution of the input image can affect the final output, so it is recommended to use high-quality images for the best results.

factor

The factor parameter is a float value that determines the level of contrast adjustment. It ranges from 0.0 to 2.0, with a default value of 1.0. A factor of 1.0 means no change in contrast, values less than 1.0 will decrease the contrast, making the image appear more washed out, and values greater than 1.0 will increase the contrast, making the image appear more vivid and sharp. The step size for this parameter is 0.01, allowing for fine-grained control over the contrast adjustment.

Image Contrast Output Parameters:

image

The output is an image tensor with the adjusted contrast. This image will have enhanced or reduced contrast based on the factor parameter, making certain features more or less prominent. The output image retains the same dimensions and format as the input image, ensuring compatibility with subsequent processing steps or nodes.

Image Contrast Usage Tips:

  • To achieve a subtle enhancement, use a factor slightly above 1.0, such as 1.1 or 1.2.
  • For a dramatic effect, experiment with higher factor values closer to 2.0, but be cautious as too high a value can lead to loss of detail in very bright or dark areas.
  • Use this node in combination with other image processing nodes like saturation or levels adjustments to create a balanced and visually appealing image.

Image Contrast Common Errors and Solutions:

AssertionError: Expected image to be a torch.Tensor

  • Explanation: This error occurs when the input image is not in the expected tensor format.
  • Solution: Ensure that the input image is correctly loaded and converted to a tensor before passing it to the node.

AssertionError: Expected factor to be a float

  • Explanation: This error occurs when the factor parameter is not a float.
  • Solution: Verify that the factor value is a float and within the specified range (0.0 to 2.0).

ValueError: Image tensor dimensions do not match expected format

  • Explanation: This error occurs if the input image tensor does not have the correct dimensions.
  • Solution: Ensure that the input image tensor has the shape (batch_size, height, width, channels) before passing it to the node.

Image Contrast Related Nodes

Go back to the extension to check out more related nodes.
Various ComfyUI Nodes by Type
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.