Nodes/VKRiez-Edge/VKriez Hybrid MTEED Edge Preprocessor
ComfyUI Node

VKriez Hybrid MTEED Edge Preprocessor

VKriez Hybrid MTEED

By vadimcro·Created about a year ago·Updated about a year ago· 17
VKriez Hybrid MTEED Edge Preprocessor
  • image
  • IMAGE
resolution1280
use_mteedtrue
use_enhanced_edgestrue
use_gpu_accelerationtrue
use_bilateraltrue
bilateral_d7
bilateral_sigma_color75
bilateral_sigma_space75
use_clahetrue
clip_limit2.0
tile_grid_size8
canny_low_threshold100
canny_high_threshold200
canny_aperture3
use_edge_linkingtrue
gap_threshold3
angle_threshold30
use_morphologytrue
morph_kernel_size3
morph_iterations1
use_component_filtertrue
min_component_size36
edge_lower_bound0.00
edge_upper_bound1.00
connectivity1
use_adaptive_regionstrue
use_enhanced_filteringtrue
connectivity_threshold2
use_edge_consistencytrue
target_edge_thickness1

Canny is great at finding edges. It's terrible at knowing which edges are the object. Feed a photo through plain Canny and ControlNet gets a confetti of texture noise - grass, hair, fabric weave - and your generated image dutifully reproduces the noise. The VKriez Hybrid MTEED Edge Preprocessor is the fix: it blends a neural network's semantically-aware line map (MTEED, the engine inside Anyline) with a cleaned-up classical edge map, so you get lines that follow actual object boundaries and stay continuous and clean. For a ControlNet conditioning map, that's the whole game.

What's actually happening

This node runs two edge detectors and merges them. The MTEED side is the TEED-family model (the "Tiny and Efficient" edge detector that Anyline popularized for anime lineart) running through comfyui_controlnet_aux's TEDDetector. On first use it downloads MTEED.pth automatically from TheMistoAI/MistoLine on HuggingFace into the pack's checkpoints/Anyline/ folder - no manual download step. The other side is the pack's own Enhanced Edge Preprocessor (the sibling node in this same repo): bilateral filtering, CLAHE, Canny, edge linking, morphology, the works. Then it takes the MTEED map as the base and screen-blends the enhanced edges on top, gated by an intensity mask. The result is a single, clean, white-on-black edge map you drop straight into any ControlNet that likes line-style conditioning.

The graceful-degradation behavior is worth knowing: if comfyui_controlnet_aux isn't installed, MTEED silently switches off (you'll see a console warning) and you get an enhanced-edge-only result. Both paths still return valid output, so the node won't error out - it just gets dumber.

Inputs and outputs that matter

One image in, one image out - the output is a single IMAGE (the edge map) that wires into a ControlNet Apply node, or into a Preview node first so you can actually see what you're feeding the model. Most people don't touch 90% of the params. The ones worth your time:

  • resolution (default 1280, range 64–2048): the internal processing size for the MTEED pass. Higher = more detail, slower, more VRAM. 1280 is the Anyline default; drop to 768 for previews.
  • use_mteed and use_enhanced_edges: the two toggles for the two detectors. Both on is the whole point, but turning enhanced off gives you a purer, flatter MTEED map for anime lineart work.
  • edge_lower_bound / edge_upper_bound (0.0–1.0): the intensity gate on the blend. Raising the lower bound to 0.2–0.3 strips faint speckle. Keep upper at 1.0 unless you specifically want to kill the strongest lines.

Everything else - canny_low_threshold, gap_threshold, bilateral_d, min_component_size, the use_gpu_acceleration toggle - is shared with the Enhanced node's classical pipeline, and the defaults (Canny 100/200, gap 3) are sane for a first pass.

Installing it

cd ComfyUI/custom_nodes/
git clone https://github.com/vadimcro/VKRiez-Edge.git

Or just search "VKRiez-Edge" in ComfyUI Manager and install there. For the MTEED half to actually work you also need comfyui_controlnet_aux as a ComfyUI custom node - the code imports it as custom_nodes.comfyui_controlnet_aux. The README's pip install git+https://github.com/Mikubill/sd-webui-controlnet.git is the A1111-extension route and won't reliably satisfy that import; installing comfyui_controlnet_aux (or ComfyUI-Anyline, which bundles it) via Manager is the path that works. Then restart ComfyUI. First run downloads the model, so give it a minute before assuming it's hung.

Where people get burned

  • MTEED silently off. If your console shows "comfyui_controlnet_aux not found," you're getting the enhanced pipeline only - and the node doesn't tell you in the UI.
  • Slowness. The 1280 default resolution plus edge linking is the slowest configuration. On CPU this drags; consider 768 or disabling edge linking for tests.
  • Too much/noise vs too little: bump canny_high_threshold toward 220–250 or edge_lower_bound to clean up; drop Canny low and the lower bound to recover missing edges. Same tuning logic as the controlnet.md playbook for canny.

It's a niche pack - one reddit announcement, zero discussion - but the hybrid idea is sound, and for photographs where you want ControlNet to respect real object boundaries, it beats plain Canny on the first try.

CategoryVKriez/image/preprocessors

Inputs (31)

NameTypeDefaultDescription
imageIMAGE
resolutionINT128064–2048
use_mteedBOOLEANtrue
use_enhanced_edgesBOOLEANtrue
use_gpu_accelerationBOOLEANtrue
use_bilateralBOOLEANtrue
bilateral_dINT75–15
bilateral_sigma_colorFLOAT7510–200
bilateral_sigma_spaceFLOAT7510–200
use_claheBOOLEANtrue
clip_limitFLOAT2.00.5–10
tile_grid_sizeINT82–16
canny_low_thresholdINT1000–255
canny_high_thresholdINT2000–255
canny_apertureINT33–7
use_edge_linkingBOOLEANtrue
gap_thresholdINT31–10
angle_thresholdINT305–90
use_morphologyBOOLEANtrue
morph_kernel_sizeINT31–7
morph_iterationsINT11–3
use_component_filterBOOLEANtrue
min_component_sizeINT365–500
edge_lower_boundFLOAT0.000–1
edge_upper_boundFLOAT1.000–1
connectivityINT11–3
use_adaptive_regionsBOOLEANtrue
use_enhanced_filteringBOOLEANtrue
connectivity_thresholdINT21–5
use_edge_consistencyBOOLEANtrue
target_edge_thicknessINT11–3

Outputs (1)

NameTypeDescription
IMAGEIMAGE