Nodes/Anyline/TheMisto Anyline
ComfyUI Node

TheMisto Anyline

The line preprocessor that actually keeps text readable — Anyline

By TheMistoAI·Created 2 years ago·Updated about a year ago· 497
TheMisto Anyline
  • image
  • anyline_image
E-mailEnter your resign email(输入你注册的email地址)

Anyline exists because Canny loses text and lineart loses texture, and someone finally got annoyed enough to fix it. It's a ControlNet line preprocessor - "TheMisto Anyline" in the node menu - that turns any image into a clean line drawing while keeping the fine details and, crucially, the letterforms. Logos, signs, labels, the text on a coffee bag: Anyline is the reason those come out legible instead of a keyboard-mash. It dropped in May 2024 as the companion to TheMistoAI's MistoLine SDXL ControlNet, and that pairing is still the standard recipe for detail-hungry SDXL work.

It sits at the front of a normal ControlNet chain: reference image in, line map out, and the line map goes into the image socket of your Apply ControlNet node. The canonical workflow (the pack ships a ready-made JSON) is image → Anyline → MistoLine ControlNet → KSampler. It works with SD1.5 lineart ControlNets too, though it shines with SDXL + MistoLine.

How it actually works

Anyline is not one detector, it's two passes fused. First it runs MTEED, a TEED-family edge detector (the "Tiny and Efficient Edge Detection" paper, Soria et al. 2023) at a fixed 1280px processing resolution - that's the clean contour pass. Then it runs a second, separate lineart-standard pass, thresholds it down, and deletes tiny noise specks (anything under 36 pixels). The two layers get composited, so you get the crisp TEED edges with lineart's finer texture detail layered on top. That fusion is the whole trick: one detector is clean, the other is detailed, and the blend keeps both.

The weights, MTEED.pth, auto-download from the TheMistoAI/MistoLine HuggingFace repo into ComfyUI-Anyline/checkpoints/Anyline/ on first run. Two things worth knowing from the source: the TEED detector is pinned to CPU in the code, so this node is "a couple of seconds" rather than instant - fine for a preprocessor, don't panic. And there are zero knobs: no resolution slider, no thresholds, nothing. The 1280px is baked in.

The inputs and outputs that matter

  • image - your source image. That's the entire input. (Older builds of this pack surfaced a registration "E-mail" field, a leftover from MistoLine's gated-release era, and comfy.icu's schema still lists one - but the code you'll run today ignores all that and just takes the image.)
  • Output - one IMAGE: the line map. Wire it into Apply ControlNet's image input.

Installation

The single most important install fact: you need comfyui_controlnet_aux installed first. The node literally imports from custom_nodes.comfyui_controlnet_aux, and the pack's own requirements.txt only lists pathlib, huggingface_hub, and scikit-image - it does not pull in aux for you. Skip that step and you get an import error on startup.

ComfyUI Manager: search "Anyline" and install TheMistoAI/ComfyUI-Anyline. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/TheMistoAI/ComfyUI-Anyline
cd ComfyUI-Anyline
pip install -r requirements.txt

Then restart ComfyUI. The model downloads on first use; if that fails, grab MTEED.pth from the Anyline subfolder of TheMistoAI/MistoLine on HuggingFace and drop it into checkpoints/Anyline/ yourself.

Common issues

  • "mat1 and mat2 shapes cannot be multiplied" - you've mixed a model and a ControlNet from different architectures, usually an SD1.5 checkpoint with an SDXL ControlNet. Pair Anyline with MistoLine on SDXL, or use an SD1.5 lineart ControlNet with an SD1.5 base. This is the most common error in Anyline threads by far.
  • "Where's the ControlNet model?" - easy trap: Anyline is only the preprocessor. The MistoLine ControlNet checkpoint is a separate download from the same HF repo.
  • Output is too busy / too detailed - that's the Anyline signature, not a bug. It keeps everything, and the author's own advice is to decide how much you actually need. Drop the ControlNet strength toward 0.5–0.8 or end control early in the sampling steps.
  • Blurry or soft-focus source - the README admits Anyline struggles with camera-like blur. Feed it something in focus.
CategoryTheMisto/image/preprocessor

Inputs (2)

NameTypeDefaultDescription
E-mailSTRINGEnter your resign email(输入你注册的email地址)
imageIMAGE

Outputs (1)

NameTypeDescription
anyline_imageIMAGE