VKriez Hybrid MTEED Edge Preprocessor
VKriez Hybrid MTEED
- image
- IMAGE
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_thresholdtoward 220–250 oredge_lower_boundto 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.
Inputs (31)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resolution | INT | 128064–2048 | — |
| use_mteed | BOOLEAN | true | — |
| use_enhanced_edges | BOOLEAN | true | — |
| use_gpu_acceleration | BOOLEAN | true | — |
| use_bilateral | BOOLEAN | true | — |
| bilateral_d | INT | 75–15 | — |
| bilateral_sigma_color | FLOAT | 7510–200 | — |
| bilateral_sigma_space | FLOAT | 7510–200 | — |
| use_clahe | BOOLEAN | true | — |
| clip_limit | FLOAT | 2.00.5–10 | — |
| tile_grid_size | INT | 82–16 | — |
| canny_low_threshold | INT | 1000–255 | — |
| canny_high_threshold | INT | 2000–255 | — |
| canny_aperture | INT | 33–7 | — |
| use_edge_linking | BOOLEAN | true | — |
| gap_threshold | INT | 31–10 | — |
| angle_threshold | INT | 305–90 | — |
| use_morphology | BOOLEAN | true | — |
| morph_kernel_size | INT | 31–7 | — |
| morph_iterations | INT | 11–3 | — |
| use_component_filter | BOOLEAN | true | — |
| min_component_size | INT | 365–500 | — |
| edge_lower_bound | FLOAT | 0.000–1 | — |
| edge_upper_bound | FLOAT | 1.000–1 | — |
| connectivity | INT | 11–3 | — |
| use_adaptive_regions | BOOLEAN | true | — |
| use_enhanced_filtering | BOOLEAN | true | — |
| connectivity_threshold | INT | 21–5 | — |
| use_edge_consistency | BOOLEAN | true | — |
| target_edge_thickness | INT | 11–3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |