ComfyUI  >  Nodes  >  ComfyUI-post-processing-nodes >  PencilSketch

ComfyUI Node: PencilSketch

Class Name

PencilSketch

Category
postprocessing/Effects
Author
EllangoK (Account age: 2833 days)
Extension
ComfyUI-post-processing-nodes
Latest Updated
8/9/2024
Github Stars
0.2K

How to Install ComfyUI-post-processing-nodes

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

PencilSketch Description

Transform images into pencil sketch-like artworks using advanced image processing techniques for artistic effects, including grayscale conversion, Gaussian blur, dodge blend, and optional sharpening.

PencilSketch:

The PencilSketch node is designed to transform your images into pencil sketch-like artworks, providing a unique and artistic effect. This node leverages advanced image processing techniques to convert colored images into grayscale sketches, mimicking the appearance of hand-drawn pencil art. The process involves converting the image to grayscale, inverting it, applying a Gaussian blur, and then using a dodge blend to create the final sketch effect. Additionally, the node offers an option to sharpen the final image, enhancing the details and giving it a more defined look. This node is particularly useful for creating stylized images, adding artistic flair to photographs, or preparing images for further creative processing.

PencilSketch Input Parameters:

image

This parameter expects an image tensor as input. The image should be in the format (B, H, W, C), where B is the batch size, H is the height, W is the width, and C is the number of channels. The node will process this image to generate the pencil sketch effect.

blur_radius

The blur_radius parameter controls the radius of the Gaussian blur applied to the inverted grayscale image. This blur helps in creating the soft, blended look typical of pencil sketches. The value can range from 1 to 31, with a default value of 5. Increasing the blur radius will result in a softer and more diffused sketch, while decreasing it will produce a sharper and more detailed sketch.

sharpen_alpha

The sharpen_alpha parameter determines the intensity of the sharpening effect applied to the final image. This parameter can take values from 0.0 to 10.0, with a default value of 1.0. A higher value will result in a more pronounced sharpening effect, enhancing the details and edges in the sketch. Setting this parameter to 0.0 will disable the sharpening effect.

PencilSketch Output Parameters:

IMAGE

The output is an image tensor in the format (B, H, W, C), where B is the batch size, H is the height, W is the width, and C is the number of channels. This tensor represents the final pencil sketch image, which has been processed to mimic the appearance of a hand-drawn pencil sketch. The output image retains the same dimensions as the input image.

PencilSketch Usage Tips:

  • To achieve a softer and more diffused sketch effect, increase the blur_radius parameter. This will create a more blended and less detailed sketch.
  • For a more detailed and defined sketch, decrease the blur_radius and increase the sharpen_alpha parameter. This combination will enhance the edges and details in the sketch.
  • Experiment with different values of sharpen_alpha to find the right balance between detail and smoothness in your sketches.
  • Use high-resolution images as input to get the best results, as the sketch effect can highlight details that may be lost in lower-resolution images.

PencilSketch Common Errors and Solutions:

"Input image tensor is not in the correct format"

  • Explanation: The input image tensor must be in the format (B, H, W, C). If the dimensions do not match this format, the node will not be able to process the image correctly.
  • Solution: Ensure that your input image tensor is correctly formatted before passing it to the node. You may need to reshape or permute the dimensions of your image tensor.

"Blur radius out of range"

  • Explanation: The blur_radius parameter must be within the range of 1 to 31. If a value outside this range is provided, the node will not function correctly.
  • Solution: Adjust the blur_radius parameter to be within the valid range of 1 to 31.

"Sharpen alpha out of range"

  • Explanation: The sharpen_alpha parameter must be within the range of 0.0 to 10.0. If a value outside this range is provided, the node will not function correctly.
  • Solution: Adjust the sharpen_alpha parameter to be within the valid range of 0.0 to 10.0.

PencilSketch Related Nodes

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