ComfyUI > Nodes > ComfyUI-tbox > Canny Edge Estimator

ComfyUI Node: Canny Edge Estimator

Class Name

CannyPreprocessor

Category
tbox/ControlNet Preprocessors
Author
ai-shizuka (Account age: 3606days)
Extension
ComfyUI-tbox
Latest Updated
2025-04-22
Github Stars
0.02K

How to Install ComfyUI-tbox

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

Canny Edge Estimator Description

CannyPreprocessor detects image edges, aiding AI artists in extracting contours for stylized art.

Canny Edge Estimator:

The CannyPreprocessor is a powerful tool designed to perform edge detection on images, a crucial step in many image processing and computer vision tasks. By identifying the boundaries within an image, this node helps in highlighting the structural features, making it easier to analyze and manipulate images for various artistic and technical purposes. The Canny edge detection method is renowned for its ability to detect a wide range of edges in images, providing a clear and precise outline of objects. This node is particularly beneficial for AI artists who wish to extract contours and outlines from images, enabling them to create stylized artworks or prepare images for further processing in machine learning models. The CannyPreprocessor is part of the tbox/ControlNet Preprocessors category, emphasizing its role in preprocessing images for advanced neural network applications.

Canny Edge Estimator Input Parameters:

low_threshold

The low_threshold parameter sets the lower boundary for edge detection. It determines the minimum intensity gradient that will be considered as an edge. A lower value will result in more edges being detected, including weaker edges, while a higher value will filter out these weaker edges, focusing only on the stronger ones. The parameter accepts integer values ranging from 0 to 255, with a default value of 100. Adjusting this threshold allows you to control the sensitivity of the edge detection process, which can be crucial for capturing the desired level of detail in your images.

high_threshold

The high_threshold parameter defines the upper boundary for edge detection. It specifies the maximum intensity gradient that will be considered as an edge. This parameter works in conjunction with the low_threshold to create a range within which edges are detected. The high threshold helps in distinguishing between strong and weak edges, ensuring that only the most prominent edges are highlighted. Like the low_threshold, it accepts integer values from 0 to 255, with a default value of 100. By fine-tuning this parameter, you can enhance the clarity and precision of the detected edges in your images.

resolution

The resolution parameter determines the size of the output image, affecting the level of detail and processing time. It accepts integer values starting from 64 up to a maximum defined by the system's capabilities, with increments of 64. The default resolution is set at 512. A higher resolution will provide more detailed edge detection but may require more computational resources, while a lower resolution will be faster but less detailed. This parameter allows you to balance between image quality and processing efficiency based on your specific needs.

Canny Edge Estimator Output Parameters:

IMAGE

The output of the CannyPreprocessor is an IMAGE that contains the detected edges of the input image. This output is a visual representation of the contours and outlines within the original image, highlighting the structural features that were identified during the edge detection process. The resulting image can be used for various applications, such as creating line art, enhancing image features for artistic purposes, or serving as input for further image processing tasks in machine learning models. The clarity and precision of the edges in the output image depend on the input parameters, allowing you to tailor the results to your specific requirements.

Canny Edge Estimator Usage Tips:

  • Experiment with different low_threshold and high_threshold values to achieve the desired level of edge detection sensitivity. Lower thresholds can capture more details, while higher thresholds focus on prominent edges.
  • Adjust the resolution parameter based on your processing power and the level of detail required. Higher resolutions provide more detail but require more resources.
  • Use the CannyPreprocessor as a preprocessing step for creating stylized artworks or preparing images for machine learning models that require clear edge definitions.

Canny Edge Estimator Common Errors and Solutions:

"Invalid threshold values"

  • Explanation: This error occurs when the low_threshold or high_threshold values are set outside the acceptable range of 0 to 255. - Solution: Ensure that both threshold values are within the specified range and adjust them accordingly.

"Resolution exceeds maximum limit"

  • Explanation: The specified resolution value exceeds the maximum allowed by the system.
  • Solution: Check the system's maximum resolution capability and set the resolution parameter within the allowed range.

"Insufficient memory for high resolution"

  • Explanation: The system does not have enough memory to process the image at the specified high resolution.
  • Solution: Reduce the resolution value to a lower setting that your system can handle, or increase your system's memory resources.

Canny Edge Estimator Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-tbox
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 Models, enabling artists to harness the latest AI tools to create incredible art.

Canny Edge Estimator