modaux: lineart
Clean line art from any photo — and the recipe it made famous
- image
- IMAGE
Some ControlNet conditions are about raw geometry - edges, depth, pose. Lineart is about drawing. Feed a photo into controlaux_lineart (modaux: lineart) and you get clean, hand-drawn-looking outlines: thinner and more artistic than Canny's harsh fence of lines, more selective than edge detectors that chase every shadow. It's the preprocessor behind one of the most durable recipes of the SD era - lineart plus a reference image kept a character consistent across scenes, and that combo became the standard example of the technique. If you want a generated image that reads as "drawn," this is usually the map you hand the ControlNet.
The node is a thin wrapper over Hugging Face's controlnet_aux, running a model trained specifically to output line art rather than raw edges.
How it works
The weights live in the lllyasviel/Annotators repository on Hugging Face, so the first run downloads them - and worth knowing, it pulls two files, sk_model.pth and sk_model2.pth, because the coarse variant ships as a separate network.
The one toggle, coarse (default off), switches to that second model and produces bolder, sketch-like strokes instead of fine line work. Off gives you the clean inking-style lines most workflows want; on gives you something closer to a loose pencil sketch, which pairs well with a higher ControlNet weight when you want the drawing to dominate.
Inputs that matter
Only four in total:
- image - the source.
- detect_resolution / image_resolution - both default 512 (range 256–1024). Detection resolution, then output resolution. Leave at defaults to start.
- coarse - the toggle above.
Same inverted-label quirk as the rest of the pack: a checkbox can read "enabled" while it's off. Trust the default (off) and judge by the preview.
The single IMAGE output is your line art. It goes into a ControlNet apply node's control-image input, paired with a lineart checkpoint. The classic character-consistency stack is lineart for structure plus a reference for identity, at a moderate ControlNet weight.
Install
Manager → search "ControlNet Auxiliar", or:
cd ComfyUI/custom_nodes
git clone https://github.com/madtunebk/ComfyUI-ControlnetAux.git
cd ComfyUI-ControlnetAux
pip install -r requirements.txt # timm, controlnet-aux==0.0.7, mediapipe
Restart. Run it once ahead of time so both model files are on disk before they're needed mid-workflow.
Honest caveats
The pack is effectively unmaintained (last commit mid-2024) and pins the old controlnet-aux==0.0.7, so treat it as use-it-as-is rather than grow-with-it. If a tutorial literally references a modaux: lineart node, you're on the right pack. Otherwise the maintained "ControlNet Auxiliary Preprocessors" pack gives you lineart plus a denoise variant and better labels for the same effort - and for anime or manga sources specifically, grab the anime sibling node (modaux: lineart_anime) instead of this one.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| detect_resolution | INT | 512256–1024 | — |
| image_resolution | INT | 512256–1024 | — |
| coarseopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |