AnyLine line art (fastforks)

AnyLine preprocessor of MistoLine (TheMisto.ai; controlnet_aux AnylineDetector, ComfyUI-Anyline): the MTEED edge network (TEED architecture, weights by TheMisto.ai) blended with a Gaussian-difference line art whose small specks are removed; sharp line maps for line-conditioned ControlNets.

This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/huggingface/controlnet_aux at b1aac318b15c.

Author weight repos: https://huggingface.co/TheMistoAI/MistoLine.

Task: edges. Tier: experimental. Outputs: edges. Backends: portable.

Input: one RGB image. Output: a line / edge map [H, W] in [0, 1] at the input size (1 = line), the ControlNet preprocessors (line art, HED, PiDiNet, TEED / Anyline); M-LSD also returns straight line segments.

Variants

Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.

variant weights (author link) SHA-256 weights licence commercial use
anyline@1 MTEED.pth a3c2d8a8ce94 LicenseRef-CreativeML-OpenRAIL-PlusPlus-M yes

Licence

Original-code strings, recorded as they are (research-use package; check them before any other use). Code: MIT. Licence files: LICENSE.

Training data: Not stated for MTEED (TheMistoAI/MistoLine Anyline/MTEED.pth, the TEED network)..

  • Licence note: The MTEED weights use the OpenRAIL++-M licence: commercial use is allowed but with use restrictions that must be passed on; the training data terms are not checked.

Licence evidence: https://github.com/TheMistoAI/ComfyUI-Anyline/blob/40d7b290fe829d50e4e12e7f34498c2d30913b53/LICENSE ; https://huggingface.co/TheMistoAI/MistoLine/blob/1d9d0b3d48b295cf70d80a0f839a3055672f8393/README.md

Input size

any H x W >= 32, padded to a multiple of 32 Tested up to (portable, fp16, RTX 5060 Ti 16 GB): anyline 1080x1920 (0.6 GiB peak allocated, 0.7 reserved)

Speed and memory

Edges, synthetic, 1080x1920

model time (ms): original portable peak memory (MiB, allocated / reserved): original portable
anyline 585 50.7 909 / 1002 654 / 722

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
anyline 0.11 0.17 – 0.62 0.05 –

torch.compile and TensorRT

model input time: portable compile TensorRT fp16 kernels preparation: compile (cold first call) ONNX + engine build peak MiB (alloc / reserved): portable compile kernels TensorRT (engine + torch)
anyline 1024x1024 24.0 ms 11.6 ms planned for 0.2.1 – 40.0 s – 362 / 384 306 / 346 – –

Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).

Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.

Accuracy

Parity with the original code

Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.25 (absolute error of the output edges).

Limitations

  • Layers are blended in float as TheMistoAI/ComfyUI-Anyline; controlnet_aux's AnylineDetector blends uint8 arrays, where 1 - (1 - top) * (1 - base) wraps around, so its maps differ wherever line art is drawn.

Usage

from fastforks import edges

model = edges.load("anyline")  # mode="auto": the preferred backend from recorded measurements
result = model("photo.jpg")
result.edges  # [H, W] float32 in [0, 1], 1 = line, input resolution
result.backend  # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')

Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: anyline.

Kernels backend

No kernels backend: the MTEED CNN plus a GPU blend, a few ms; no custom kernel measured to pay off.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including fastforks/anyline