ComfyUI  >  Nodes  >  ComfyUI-Image-Filters >  Convert Normals

ComfyUI Node: Convert Normals

Class Name

ConvertNormals

Category
image/filters
Author
spacepxl (Account age: 295 days)
Extension
ComfyUI-Image-Filters
Latest Updated
6/22/2024
Github Stars
0.1K

How to Install ComfyUI-Image-Filters

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

Convert Normals Description

Transform normal maps between formats, adjust vectors, fix black areas for enhanced digital art rendering.

Convert Normals:

The ConvertNormals node is designed to transform normal maps between different formats and apply various adjustments to enhance their usability in digital art and 3D rendering. This node allows you to convert normal maps from one format to another, such as from BAE to MiDaS, and vice versa. Additionally, it provides options to scale the X and Y components of the normal map, normalize the vectors, and fix black areas that might appear in the normal map. These capabilities make it a versatile tool for artists looking to refine the appearance and functionality of their normal maps, ensuring they are correctly interpreted by different rendering engines or software.

Convert Normals Input Parameters:

normals

This parameter represents the input normal map that you want to convert or adjust. It is a tensor containing the normal map data.

input_mode

This parameter specifies the format of the input normal map. It can be set to either "BAE" or "MiDaS". "BAE" is a common format where the red channel is inverted, while "MiDaS" involves a different channel arrangement and inversion.

output_mode

This parameter defines the desired format for the output normal map. Similar to input_mode, it can be set to either "BAE" or "MiDaS". This allows you to convert the normal map to the required format for your specific use case.

scale_XY

This parameter allows you to scale the X and Y components of the normal map. It is a float value with a default of 1, a minimum of 0, and a maximum of 100. Adjusting this value can help you fine-tune the intensity of the normal map's details.

normalize

This boolean parameter determines whether the normal vectors should be normalized. Normalization ensures that the vectors have a unit length, which is important for accurate lighting calculations in 3D rendering.

fix_black

This boolean parameter indicates whether to fix black areas in the normal map. Black areas can occur due to various reasons and might need correction to ensure the normal map functions correctly.

optional_fill

This optional parameter allows you to provide an additional fill image to be used when fixing black areas. If not provided, a default fill method is applied.

Convert Normals Output Parameters:

t

The output parameter t is the transformed normal map. It is a tensor containing the normal map data after applying the specified conversions and adjustments. This output can be used directly in your rendering pipeline or further processed as needed.

Convert Normals Usage Tips:

  • To convert a normal map from BAE to MiDaS format, set input_mode to "BAE" and output_mode to "MiDaS".
  • Use the scale_XY parameter to adjust the intensity of the normal map's details. A higher value will exaggerate the details, while a lower value will soften them.
  • Enable the normalize option to ensure the normal vectors have a unit length, which is crucial for accurate lighting calculations.
  • If you encounter black areas in your normal map, enable the fix_black option to correct them. You can also provide an optional_fill image for more customized corrections.

Convert Normals Common Errors and Solutions:

Latent shape mismatch: {new_shape} and {orig_shape}

  • Explanation: This error occurs when the shapes of the new and original latent samples do not match.
  • Solution: Ensure that the input normal maps have the same dimensions before processing them with the ConvertNormals node.

Batch size for image and normals must match

  • Explanation: This error occurs when the batch sizes of the input image and normals do not match.
  • Solution: Verify that the input image and normal map have the same batch size before using the ConvertNormals node.

Invalid input or output mode

  • Explanation: This error occurs when an invalid value is provided for the input_mode or output_mode parameters.
  • Solution: Ensure that the input_mode and output_mode parameters are set to either "BAE" or "MiDaS".

Convert Normals Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Image-Filters
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.