Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI_Soze > Lineart (Soze)

ComfyUI Node: Lineart (Soze)

Class Name

Lineart

Category
image/preprocessors
Author
sozeinc (Account age: 953days)
Extension
ComfyUI_Soze
Latest Updated
2026-10-10
Github Stars
0.01K

How to Install ComfyUI_Soze

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

Lineart (Soze) Description

Converts images to adjustable Sobel line art with grayscale or binary image and mask outputs.

Lineart (Soze):

Lineart turns an image into a line drawing by finding places where brightness changes sharply, such as the edges of a face, clothing, or an object. It uses Sobel edge detection, with optional smoothing and line-shaping steps to reduce texture noise, adjust line weight, and produce either soft grayscale lines or a stark black-and-white result. It works on a single image or a batch of images. This makes it useful when you want an edge-focused guide for an image workflow or a sketch-like preview, without relying on a learned line-detection model.

Lineart (Soze) Input Parameters:

image

The source image to turn into line art. Connect an IMAGE containing one or more frames; the node processes each frame separately and keeps their order. It uses the image’s red, green, and blue channels to estimate brightness, so differences in brightness drive the detected lines. If the image has an alpha channel, that channel is ignored. There is no default, minimum, or maximum value specified for this required input.

pre_blur_sigma

Controls how much the image is smoothed before edges are detected. A small amount of blur can keep fine texture, grain, or compression noise from becoming unwanted lines; increasing it may also soften small details you wanted to retain. Set it to 0 to skip this smoothing. The default is 0.5; the minimum is 0.0 and the maximum is 10.0, in steps of 0.05.

line_strength

Multiplies the detected edge strength before normalization and thresholding. Higher values can make edges more prominent, particularly when you use normalize set to none or apply a threshold; lower values make them weaker. Because this adjustment happens before normalization, its visible effect can be reduced when normalization rescales the lines. The default is 1.0; the minimum is 0.1 and the maximum is 10.0, in steps of 0.1.

normalize

Chooses how detected edge strengths are mapped into the output brightness range. The options are percentile_95 (default), max, and none. percentile_95 uses a level that is less dominated by a few unusually strong edges, making it a useful starting point for varied images. max scales relative to the strongest detected edge, while none leaves the edge strengths without that normalization step; the result is still limited to the valid output range. This choice affects how much contrast you see between faint and strong lines.

gamma

Adjusts the brightness of the detected lines after the soft threshold is applied. Values above 1.0 brighten weaker surviving lines and can make more of them visible; values below 1.0 darken them. It changes line intensity rather than choosing which edges the initial detection finds. The default is 1.0; the minimum is 0.1 and the maximum is 5.0, in steps of 0.05.

soft_threshold

Removes faint detected lines before gamma and line-shaping steps. Any edge strength below the chosen value becomes zero, while values at or above it are kept, so the remaining lines can still have different shades of gray. Use a modest value to suppress background texture without forcing the entire image to pure black and white. The default is 0.0 (off); the minimum is 0.0 and the maximum is 1.0, in steps of 0.01.

thickness

Expands the detected lines through repeated dilation, making them appear heavier. This happens after optional thinning, so you can first reduce the lines and then build them back up to a preferred weight. Higher settings may cause nearby lines to merge or obscure fine details. The default is 0 (no expansion); the minimum is 0 and the maximum is 10, in steps of 1.

thinning

Applies one erosion pass to reduce lines before any requested thickening. Turn it on when the initial edge map looks too broad or crowded, but check the result closely because faint or very fine features may disappear. The options are false (default) and true.

binarize

Switches from variable-brightness lines to a hard two-tone result. When enabled, each processed value becomes either zero or one according to binarize_threshold; when disabled, softer grayscale lines remain possible. This is useful when you need crisp marks rather than gradual edge shading. The options are false (default) and true.

binarize_threshold

Sets the cutoff used only when binarize is true. Processed values at or above the cutoff become white, and values below it become black, before any optional inversion. Raise it to retain only stronger lines; lower it to include more faint detail. It has no effect while binarize is false. The default is 0.5; the minimum is 0.0 and the maximum is 1.0, in steps of 0.01.

invert

Flips the final light and dark values. With false (default), the result has white lines on black, matching the convention identified in the node source for ControlNet lineart preprocessing. With true, it has black lines on white, which is often easier to view as a sketch. Inversion also applies to the mask output. The options are false and true.

Lineart (Soze) Output Parameters:

image

An IMAGE containing the finished line art for each input frame, in the same batch order and at the same width and height. Each frame has three identical color channels, so it appears grayscale: by default, stronger detected lines appear brighter against black; with invert enabled, they appear darker against white. The appearance also reflects any smoothing, thresholds, gamma adjustment, thinning, thickening, or binarization you selected. If the input is absent or empty, the node instead returns a blank 64 × 64 image.

mask

A MASK containing the same processed values as the image output’s first color channel for every frame. It provides the line-art result as a single-channel value map for connections that accept masks. By default, brighter mask values correspond to brighter detected lines; enabling invert reverses those values, so consider the polarity expected by the next node. If the input is absent or empty, the node returns a blank 64 × 64 mask.

status

A STRING reporting what happened. A successful result begins with OK: and includes the frame count, dimensions, selected blur, strength, normalization, and gamma settings, followed by applicable details such as thinning, thickening, binarization, and output polarity. For a missing or empty input, it reads Skipped: image is None or empty. Use it to confirm that the node ran and to check which settings produced a result; it is not a measure of image quality.

Lineart (Soze) Usage Tips:

  • Start with the defaults for thin white lines on black. Turn on invert when you want to inspect the result as black marks on a white sketch page; check the desired polarity again before connecting the result to another node.
  • If a photograph produces too many lines from skin texture, fabric, or grain, increase pre_blur_sigma gradually. If unwanted faint lines remain, raise soft_threshold a little at a time, checking that important contours stay visible.
  • For a softer edge guide, leave binarize off and adjust gamma to control the visibility of weaker lines. For a stark two-tone drawing, turn binarize on and tune binarize_threshold: a higher cutoff keeps fewer, stronger marks.
  • If outlines look too wide, try thinning. If they look too light or narrow, increase thickness one step at a time; larger values can join neighboring contours.
  • Keep normalize at percentile_95 as a starting point when a few very strong edges overshadow the rest. Try max to scale against the strongest edge, or none when you want to assess the less-rescaled edge strengths and the effect of line_strength.
  • Check both image and mask after changing invert. They carry the same line-art values, so a mask-consuming node may interpret the flipped background differently from what you intended.

Lineart (Soze) Common Errors and Solutions:

Skipped: image is None or empty.

  • Explanation: This is the node’s explicit skip message. No input image was supplied, or the supplied batch contains no frames. The returned image and mask are blank placeholders, not processed line art.
  • Solution: Connect an image-producing node to image and confirm that it supplies at least one frame.

OK: ... but the result is mostly black

  • Explanation: OK: means processing completed, but the chosen settings may have removed or darkened most visible lines. A high soft_threshold or, when binarizing, a high binarize_threshold can discard weaker edges; gamma below 1.0 can darken surviving lines. The default black background can also make faint results hard to inspect.
  • Solution: Lower the relevant threshold, return gamma toward 1.0, and try invert for a white-background preview. Adjust one setting at a time so you can see which change helps.

OK: ... but the result is mostly white

  • Explanation: With invert enabled, white is the background, so a mostly white image may simply contain few visible dark lines. Without inversion, a very low binarization cutoff or heavy line expansion can make much more of the image white.
  • Solution: Check invert first. If you want more dark lines on a white background, reduce filtering or lower binarize_threshold; if white lines are spreading together on a black background, reduce thickness or raise the binarization cutoff.

OK: ... but fine details are missing

  • Explanation: Strong pre-blur, thinning, a high soft threshold, or a high binarization cutoff can remove small or weak contours even when the node runs successfully.
  • Solution: Reduce pre_blur_sigma, switch off thinning, or lower the applicable threshold. If you need subtle detail rather than hard outlines, switch off binarize.

OK: ... but there are too many noisy lines

  • Explanation: Fine texture and grain also create brightness changes, so Sobel detection can treat them as edges. Brightening weak lines with gamma above 1.0 or using a low threshold can make that texture more noticeable.
  • Solution: Increase pre_blur_sigma gradually, add a modest soft_threshold, or bring gamma closer to 1.0. Check that the main contours remain visible after each adjustment.

OK: ... but nearby lines have merged

  • Explanation: A high thickness setting expands lines until adjacent marks touch. A low binarization cutoff may also preserve extra marks between them.
  • Solution: Lower thickness first. If binarize is on, try raising binarize_threshold slightly; thinning may also help reduce the lines before expansion.

OK: ... but changing binarize_threshold does nothing

  • Explanation: binarize_threshold is used only when binarize is true.
  • Solution: Enable binarize to use that cutoff. If you want to keep grayscale lines, leave it off and adjust soft_threshold instead.

Shape or channel error while processing an image

  • Explanation: The processing code expects a batch of images with height, width, and three color channels, or four channels whose alpha channel it can discard. An incompatible tensor shape may fail before a status message is returned; the exact exception text depends on the supplied data.
  • Solution: Feed the node a standard ComfyUI IMAGE connection rather than an unconverted mask or other tensor, and check the preceding node if the image was assembled or reshaped manually.

Lineart (Soze) Related Nodes

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

Lineart (Soze)