kubakub line overlay
Put your own hand back on top of the render
- image
- line
- colour
- image
- mask
What it's for
There's a whole workflow in this pack that starts with a pencil drawing: photograph it with your phone (scan to line straightens and cleans it), turn it into regions where the closed shapes are, diffuse it region by region, and end up with a render. The catch is that a render is a render. You drew the thing - the drawing had your line in it - and the model has replaced that with its own confident, soulless edge.
kubakub line overlay puts your line back on top. amount 0.3 is a light trace of the hand, like the drawing showing through the render; amount 1 is exactly your stroke, dead on top. It's a small node, and it's the one that makes you want to keep the whole sketch workflow.
It's also a legitimately useful compositing tool outside that chain: overlay any line mask on any image and you've got a cheap structural pass, a projection guide for the technician, or a "here's what will be drawn" preview for the client.
How it works
It takes your line as a mask - the thing scan to line produces - and lays it onto the image in one of three modes:
multiply- dark line. The default, and the right choice for your line on a lit render.screen- light line. Use this when the projection content is dark and a black line would vanish into the wall.colour- paint the line in a single flat colour, set by thecolourfield (hex, default#000000). Black pairs with multiply, white with screen; anything else is a design decision.
Shape control comes first, opacity second:
grow_px(0) thickens the line. Drawing with a light pencil on a phone photo gives you a thin, broken line; growing it makes it read at projection scale.soften_px(0) softens it. Combined withscreen, that's a glow - a pencil line that blooms into the wall.amount(0.8) is how much of that line shows, applied last.
The order is worth knowing because of the second output: mask is the line as it was laid on the render - after grow_px and soften_px, before amount - as 0-1 values, one per frame. So it's the actual coverage you just drew with, not the input you gave it. Feed it to a glow pass, a cut-out, or any other node that wants a mask. That output arrived in 0.3.0 along with a batch of others giving raw data instead of just a pretty picture.
Inputs and outputs
image- the render, one image or a batch of frames.line- the line mask, from scan to line. One mask serves every frame, or supply one per frame.amount,mode,colour,grow_px,soften_px- as above.
Outputs: image (the render with your line) and mask (the coverage, before amount).
Install
Manager → search kubakub nodes → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt
ComfyUI 0.37.0+. opencv-python-headless is the only added package, and as ever: if you already have an OpenCV build, keep yours rather than letting pip install a second one. No models, no Blender, no ffmpeg for this node - it's pure compositing. The pack's starter workflow 05 runs the whole sketch chain on the sample facade's synthetic phone photo of a pencil sketch with Klein 4B, so you can see the intent before you trust your own drawing to it.
Common issues
- The line disappeared.
modeandcolourdisagree with the image: a black line atmultiplyon a dark render is invisible. Switch toscreenor givecoloursomething light. - The line is too thin at projection size.
grow_px. A phone photo of a pencil drawing is a 2-3 px line; projected eight metres wide that's a hairline nobody sees from the audience. - The glow is doing too much.
soften_pxinteracts withamount- the mask output is pre-amount, so whatever glow you build from it will look stronger than what you see on the image. Tune the image, then tune the glow. - It doesn't line up with the render. The mask has to be at the render's size or the compositing will look off, and in the sketch workflow the line comes from the same starting image so it should already match. If you're mixing sources, resize the mask to the image size first.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The render (one image or frames). | |
| line | MASK | From scan to line (one mask for all frames, or one per frame). | |
| amount | FLOAT | 0.800–1 | How much of the line shows. |
| mode | COMBO | multiply | multiply = dark line, screen = light line, colour = the line in the colour below. |
| colour | COLOR | #000000 | Line colour: click to pick. Black for multiply, white for screen. |
| grow_px | INT | 00–64 | Makes the line bolder. |
| soften_px | FLOAT | 0.00–64 | Softens the line (a glow with screen). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The render with your line. |
| mask | MASK | The line as it was laid on the render: after grow_px and soften_px, before amount (0..1, one per frame). |