[Inference.Core] Scribble XDoG Lines
Turning a real photo into a hand-drawn-looking sketch
- image
- IMAGE
The usual way people use Scribble ControlNet is to draw a rough layout by hand and let the model fill in the details - it's the most creative-friendly conditioning type in the whole ControlNet family, no preprocessor required at all. This node does the opposite direction: it takes a real photo and synthesizes a scribble-style line map from it, so you can feed a genuine reference image into a Scribble ControlNet even when you don't have (or don't want to make) an actual hand-drawn sketch.
The mechanism is XDoG - eXtended Difference-of-Gaussians, an edge-detection technique that produces thicker, more stylized lines than a straight edge detector. Where Canny gives you clean hard edges and PiDiNet or HED give you soft gradients, XDoG's output looks closer to what an actual person sketching the photo by hand might have produced: looser, bolder, more artistic than technically precise. That's the whole point of reaching for this node over the other line extractors in this pack - it's not trying to be accurate, it's trying to look drawn.
The one setting worth tuning per image
threshold (1–64, default 32) is the binarization cutoff, and it's the knob that actually matters here. Lower it for thinner, sparser lines; raise it for thicker, bolder ones. XDoG's entire appeal is finding the threshold that makes a specific photo look convincingly sketched, and that sweet spot genuinely moves around with the image's content and contrast - a low-contrast portrait and a high-contrast architectural shot won't want the same value. Expect to adjust this per image rather than set it once and forget it.
resolution (64–2048, default 512) is the standard preprocessor input-resize control shared across the pack.
Output is a single IMAGE, wired into a Scribble-type ControlNet alongside your checkpoint and prompt, exactly like you'd wire in a hand-drawn scribble.
When to reach for this over the other line extractors
Use it when you specifically want the ControlNet map - and often the final generated image's line quality - to look hand-drawn or illustrative rather than production-clean. Style-transfer work, illustration-flavored outputs, or any case where you have a real reference photo but no actual scribble and want the Scribble ControlNet's particular creative-freedom behavior rather than Canny's or Lineart's precision.
Installing it
Comes with the LykosAI Inference Core Nodes pack. Via ComfyUI Manager, search "ComfyUI-Inference-Core-Nodes". Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes
then install.py, or pip install -e .[cuda] (swap in [cuda12], [rocm], or [directml] for your hardware) and restart.
Troubleshooting
If the output looks like clean, precise edges rather than a loose scribble, that's usually a sign you actually wanted a different preprocessor - Canny, Lineart, or PiDiNet - since XDoG's whole character comes from deliberately not being clean. If instead you're getting solid black blobs with no real line structure, threshold is set too low; raise it until individual lines start separating out again.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| thresholdopt | INT | 321–64 | — |
| resolutionopt | INT | 51264–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |