Nodes/ComfyUI-Nikosis-Preprocessors/LineArt Sketch Preprocessor (nikosis)
ComfyUI Node

LineArt Sketch Preprocessor (nikosis)

The sketch node that actually runs a model — clean anime linework, auto-downloaded

By Nikosis·Created about a year ago·Updated about a year ago· 2
LineArt Sketch Preprocessor (nikosis)
  • images
  • IMAGE
modelsk_model_fine.safetensors
resolution1024
keep_proportiontrue

If you've ever run a lineart ControlNet on a photo and thought "these lines look like a bad scanner did them," this node is the upgrade. It's the classic ControlNet "lineart anime" sketch model - the same sk_model_fine / sk_model_coarse weights lllyasviel's Annotators shipped - wrapped up so it auto-downloads on first use and offloads itself out of VRAM when it's done. Photo in, clean anime-style linework out, and it's the one node in this pack that's doing real neural network work instead of OpenCV math.

How it works

Under the hood is a small pix2pix-style generator: reflection-padded convolutions, instance norm, a few residual blocks, a strided encoder/decoder, and a single grayscale channel out. It was trained to redraw input images as clean lineart, which is why its output reads so much more "drawn" than the pack's pure-OpenCV lineart node. The two checkpoints you can pick:

  • sk_model_fine.safetensors (default) - fine, detailed linework. Keeps the little strokes.
  • sk_model_coarse.safetensors - bolder, looser, sketchier strokes. If fine comes out too fiddly or the model over-tracks noise, coarse is the usual fix.

The model is tiny compared to the depth checkpoints in this pack - the download is tens of MB, not gigabytes. The node runs it, inverts the output to white lines on black, then offloads the weights back to CPU and clears the CUDA cache so it's not squatting in VRAM between runs.

Inputs

  • images - your input (batches fine).
  • model - the two-file dropdown above.
  • resolution (default 1024, 64–2048, step 16) - the shorter-side target; the image is resized to a multiple of 16 before the model runs.
  • keep_proportion (default on) - crops vs. stretches to hit clean dimensions, same as the rest of this pack.

Output is one IMAGE: white lineart on a black background, ready for a lineart ControlNet. That inverted style is exactly what the lineart_anime-style ControlNets expect, so it plugs in as-is.

Installing it

Same pack, same author (Nikosis, who also makes the ComfyUI-Nikosis-Nodes prompt/style pack that shows up in r/comfyui recommendations). ComfyUI Manager → search ComfyUI-Nikosis-Preprocessors → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Nikosis/ComfyUI-Nikosis-Preprocessors comfyui-nikosis-preprocessors
cd comfyui-nikosis-preprocessors
pip install -r requirements.txt    # Windows portable: ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt

Then restart ComfyUI.

The one thing to know up front: the sketch models download from the author's own Hugging Face mirror (Nikos7766/lineart-models) on first run, landing in ComfyUI/models/controlnet/preprocessors/lineart/. So your first use needs a working HF connection - after that it's cached and works offline. If it errors at first run, that's the usual culprit. The node reuses the cached file, and ComfyUI's model registry means a reinstall won't re-download.

Gotchas

  • Fine vs coarse matters more than you'd think. If fine's output looks like a nervous pen, that's the model, not a misconfiguration - swap to coarse before touching anything else.
  • This is the sibling of the pack's LineArt node, but they're not interchangeable: LineArt is instant OpenCV linework, Sketch is model-based anime-clean lines. If you want character-consistency anime lineart - the KB's favorite use for this conditioning type - you want this one.
  • It needs torch + einops (both in requirements.txt, both standard in any working ComfyUI). Nothing exotic, but the first run does pay a download and load tax before the progress bar moves.
CategoryNikosis Nodes/preprocessors

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
modelCOMBOsk_model_fine.safetensors2 options: sk_model_fine.safetensors, sk_model_coarse.safetensors
resolutionINT102464–2048
keep_proportionBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE