ComfyUI > Nodes > cspnodes > Depth to Normal Map

ComfyUI Node: Depth to Normal Map

Class Name

DepthToNormalMap

Category
cspnodes
Author
cerspense (Account age: 3005days)
Extension
cspnodes
Latest Updated
2024-12-17
Github Stars
0.03K

How to Install cspnodes

Install this extension via the ComfyUI Manager by searching for cspnodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter cspnodes 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Depth to Normal Map Description

Converts depth maps to normal maps for realistic 3D lighting effects with adjustable intensity and axis flipping.

Depth to Normal Map:

The DepthToNormalMap node is designed to convert depth maps into normal maps, which are essential in 3D graphics for simulating the lighting of bumps and dents on surfaces. This node takes a depth map, which represents the distance of surfaces from a viewpoint, and transforms it into a normal map that encodes surface orientation information. This conversion is crucial for enhancing the realism of 3D models by allowing for more detailed and dynamic lighting effects. The node provides flexibility in adjusting the intensity of the normals and flipping the axes, making it a versatile tool for artists looking to refine the visual quality of their 3D scenes.

Depth to Normal Map Input Parameters:

depth_maps

This parameter accepts an image that represents the depth map. The depth map is a grayscale image where the intensity of each pixel corresponds to the distance from the camera, with lighter pixels being closer and darker pixels being further away. The node processes this input to generate the corresponding normal map.

normal_intensity

This parameter controls the intensity of the normals in the resulting normal map. A higher intensity value will exaggerate the surface details, making the bumps and dents more pronounced, while a lower value will result in a smoother appearance. The default value is 1.0, with a minimum of 0.01 and a maximum of 10.0.

flip_x

This boolean parameter determines whether the X-axis of the normal map should be flipped. Flipping the X-axis can be useful for correcting the orientation of the normals if they appear inverted. The default value is True.

flip_y

This boolean parameter controls whether the Y-axis of the normal map should be flipped. By default, the Y-axis is flipped, and setting this parameter to True will un-flip it. This can be useful for adjusting the vertical orientation of the normals. The default value is False.

depth_scale

This parameter adjusts the scale of the depth map before conversion. It affects how the depth values are interpreted, with a higher scale resulting in more pronounced depth effects. The default value is 1.0, with a minimum of 0.02 and a maximum of 2.0.

Depth to Normal Map Output Parameters:

IMAGE

The output is an image that represents the normal map derived from the input depth map. This normal map encodes the surface orientation information, which can be used in 3D rendering to simulate realistic lighting and shading effects. The normal map is typically a color image where the RGB channels correspond to the X, Y, and Z components of the surface normals.

Depth to Normal Map Usage Tips:

  • To achieve more pronounced surface details, increase the normal_intensity parameter. This will make the lighting effects more dramatic and enhance the perception of depth.
  • If the normals appear inverted or incorrectly oriented, try toggling the flip_x and flip_y parameters to correct the orientation.

Depth to Normal Map Common Errors and Solutions:

"Depth map input is not a valid image"

  • Explanation: This error occurs when the input provided is not a valid image format or is corrupted.
  • Solution: Ensure that the input is a valid image file and is correctly formatted as a depth map.

"Depth map has multiple channels"

  • Explanation: The node expects a single-channel depth map, but the input has multiple channels.
  • Solution: Convert the depth map to a single-channel grayscale image before using it as input.

"Invalid depth scale value"

  • Explanation: The depth_scale parameter is set outside the allowed range.
  • Solution: Adjust the depth_scale parameter to be within the range of 0.02 to 2.0.

Depth to Normal Map Related Nodes

Go back to the extension to check out more related nodes.
cspnodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.