ComfyUI > Nodes > DJZ-Nodes > Depth-Based Pixelization

ComfyUI Node: Depth-Based Pixelization

Class Name

DepthBasedPixelization

Category
image/effects
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

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

Transform images with depth-based pixelization effect using depth maps to vary pixel block sizes, emphasizing different depths creatively.

Depth-Based Pixelization:

The Depth-Based Pixelization node is designed to transform images by applying a pixelization effect that varies based on the depth information of the image. This node leverages depth maps to determine the size of pixel blocks, creating a unique visual effect where areas of different depths are pixelated to varying degrees. The primary benefit of this approach is the ability to emphasize or de-emphasize certain parts of an image based on their depth, allowing for creative control over the visual focus and artistic style. By adjusting the pixel block sizes according to depth, this node can produce images that highlight foreground elements or create a sense of depth and dimension, making it a powerful tool for AI artists looking to add a dynamic and engaging effect to their work.

Depth-Based Pixelization Input Parameters:

images

This parameter represents the batch of images to which the depth-based pixelization effect will be applied. The images are processed in conjunction with their corresponding depth maps to achieve the desired pixelization effect.

depth_maps

This parameter consists of a batch of depth maps corresponding to the input images. The depth maps are used to determine the pixel block sizes, influencing how the pixelization effect is applied across different areas of the image.

min_block_size

This integer parameter sets the minimum size of the pixel blocks used in the pixelization process. It controls the smallest level of detail that can be preserved in the image. The default value is 4, with a minimum of 1 and a maximum of 32.

max_block_size

This integer parameter defines the maximum size of the pixel blocks. It determines the largest area that can be pixelated as a single block, affecting the overall coarseness of the pixelization effect. The default value is 32, with a minimum of 1 and a maximum of 64.

depth_influence

This float parameter adjusts the influence of the depth map on the pixel block sizes. A higher value increases the effect of depth on block size variation, while a lower value reduces it. The default value is 1.0, with a range from 0.1 to 2.0.

invert_depth

This boolean parameter determines whether the depth map should be inverted before applying the pixelization effect. When set to true, areas that are closer will be treated as further away and vice versa, altering the pixelization pattern. The default value is true.

Depth-Based Pixelization Output Parameters:

IMAGE

The output is a batch of images that have been processed with the depth-based pixelization effect. Each image in the batch reflects the pixelization applied according to the depth information, resulting in a visually distinct effect that emphasizes depth variations.

Depth-Based Pixelization Usage Tips:

  • Experiment with the min_block_size and max_block_size parameters to achieve the desired level of detail and coarseness in your pixelized images. Smaller block sizes preserve more detail, while larger sizes create a more abstract effect.
  • Use the depth_influence parameter to control how strongly the depth map affects the pixelization. A higher influence can create more pronounced depth effects, while a lower influence results in a more uniform pixelization.
  • Consider inverting the depth map using the invert_depth parameter to explore different artistic effects, such as emphasizing background elements instead of foreground ones.

Depth-Based Pixelization Common Errors and Solutions:

Mismatched Image and Depth Map Dimensions

  • Explanation: The dimensions of the input images and depth maps do not match, leading to processing errors.
  • Solution: Ensure that each image in the batch has a corresponding depth map with matching dimensions. Use the preprocess_depth_map function to resize depth maps if necessary.

Invalid Block Size Range

  • Explanation: The min_block_size is greater than the max_block_size, causing an invalid configuration.
  • Solution: Verify that the min_block_size is less than or equal to the max_block_size to ensure a valid block size range.

Depth Map Normalization Issues

  • Explanation: The depth map has a constant value, leading to division by zero during normalization.
  • Solution: Check the depth map for uniform values and adjust the depth data to ensure variability, or handle the case where the depth range is zero by setting a default normalized value.

Depth-Based Pixelization Related Nodes

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