DY Random Lines
Scribble all over your image, one alpha-composited overlay at a time
- image
- IMAGE
DY Random Lines is the pack's doodle node: it throws a bunch of random straight lines across your image on a transparent overlay, then composites them back onto the original. It's a one-node way to get that scratched, sketchy, "someone drew on the photo" look, and if that's the aesthetic you're after, it does exactly one thing and does it fine.
Here's the pitch: your generated image looks too clean. You want texture - scribble marks, pencil-like strokes, an almost-painterly agitation across the surface. This node gives you a base color, a thickness, a length, and a count, then randomly scatters lines with jitter around each. Because every line is drawn on its own transparent overlay layer and alpha-composited, thin lines at low alpha read like pencil strokes rather than hard ink, and you can stack runs of the node to build up density.
How it works
The source is straightforward: pick a random start point, a random angle (0–2π), a random length around your average, draw a line of random thickness in a color that's your base RGB jittered by color_deviation, at an alpha jittered by alpha_deviation, then composite the whole overlay onto the image and convert back to RGB. Ten inputs, all of them knobs you'll actually feel:
- num_lines (1–1000) - density. 10 is subtle; 500 is a blizzard.
- avg_thickness / thickness_deviation - stroke weight and how much it varies.
- avg_length / length_deviation - line length and variance. Long lines feel scribbly, short ones feel noisy.
- red / green / blue (0–255 each) - the base line color. Default 255/255/255 is white.
- color_deviation - how far each line wanders from that base color.
- alpha / alpha_deviation - opacity and variance; lower alpha keeps lines subtle.
The trap to know about
There is no seed input. Every run is freshly random, so you cannot reproduce a result - rerun the queue and the scribbles move. If you need deterministic output, you'll have to route a seed into it yourself (or accept the dice). It also only processes the first image of a batch, and the base color is fixed white-by-default - if you want lines that pick up the colors underneath them, that's the pack's AdaptiveColorLines node instead, which samples the image at each line's midpoint.
Install
Part of dymokomi/comfyui_dygen by Dy Mokomi. ComfyUI Manager → search "comfyui_dygen", or:
cd ComfyUI/custom_nodes
git clone https://github.com/dymokomi/comfyui_dygen
Restart. No extra deps, no models - pure Pillow drawing.
Bottom line
It's a small, honest effect node with a niche job. Random lines over a portrait can look like a stylized editorial sketch; over a landscape they can read as noise, fast. Start with low counts and low alpha, and treat the missing seed as the feature you'll most want to fix.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| num_lines | INT | 101–1000 | — |
| avg_thickness | FLOAT | 2.00.1–100 | — |
| thickness_deviation | FLOAT | 1.00–50 | — |
| avg_length | INT | 1001–2000 | — |
| length_deviation | INT | 500–1000 | — |
| red | INT | 2550–255 | — |
| green | INT | 2550–255 | — |
| blue | INT | 2550–255 | — |
| alpha | INT | 2550–255 | — |
| color_deviation | INT | 200–255 | — |
| alpha_deviation | INT | 200–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |