ComfyUI Node

Whiteboard

A Whiteboard Node That Auto-Runs Inference

By kreonxv·Created 7 months ago·Updated 7 months ago· 0
Whiteboard
    • IMAGE
    width768
    height768
    brush_size20
    debounce_ms1500
    image_data

    The sketch round-trip, deleted

    Most sketch-to-image workflows in ComfyUI share one awkward step: you draw in an external app, export a PNG, drag it into the graph, and every tweak means another export-import cycle. The Whiteboard node from kreonxv/ComfyUI-Whiteboard kills that round-trip. It puts a canvas you can actually draw on inside the node, and when you lift the pen it re-runs your queue automatically. Draw, wait a beat, watch the result update. It's the closest ComfyUI gets to the old A1111 sketch tab - except it feeds whatever graph you've already built, no file juggling involved.

    This is the natural partner for a ControlNet scribble setup. The knowledge-base essay on ControlNet sums it up: scribble accepts rough hand-drawn layouts and the model fills in the details. That's exactly what this node produces - a rough sketch you feed into ControlNet's image input, with the sampler doing the "making it look good" part.

    How it works

    The node is mostly front-end with a thin Python wrapper. The JavaScript (web/Whiteboard.js) creates a hidden 1024×1024 canvas, handles your mouse strokes, and on release serializes the drawing to a base64 PNG data URL stored in a hidden image_data widget. It then calls app.queuePrompt() to fire your workflow. On the Python side, Whiteboard.process base64-decodes that string, opens it with PIL, resizes to your width/height, converts to a 0–1 float tensor, and returns it as an IMAGE. Draw nothing and it returns a plain white image instead - torch.ones, literally.

    A few behaviors worth knowing from the source:

    • Starting a new stroke aborts any in-flight generation (it POSTs to /interrupt). Your current run dies the instant you touch the canvas.
    • Shift+Click erases - and erasing deliberately does not trigger a re-run, so you can scrub mistakes without triggering a flood of regenerations.
    • You can Ctrl+V paste an image from your clipboard straight into the canvas, handy for tracing over a reference.

    The inputs and outputs that matter

    Only a handful matter, so here they are:

    • width / height (default 768, 64–2048) - the size of the output image. The internal canvas is always 1024×1024 and gets resampled to these, so set them to whatever your sampler or ControlNet expects.
    • brush_size (default 20, 1–100) - stroke thickness. Thicker strokes hold up better after the downscale to your output size and give ControlNet stronger guidance.
    • debounce_ms (default 1500, 0–5000) - how long it waits after you stop drawing before auto-running. 0 runs immediately on every stroke.
    • image_data - ignore it. It's the hidden string that carries your drawing to the Python side. You never type in it.

    Output is a single IMAGE tensor. Wire it into a ControlNet node's image input (scribble or lineart) and from there to your sampler, or feed it straight into an img2img pipeline as your source.

    Installing it

    The easy way: ComfyUI Manager, search "ComfyUI-Whiteboard", install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kreonxv/ComfyUI-Whiteboard
    

    Then restart ComfyUI. That's the whole install - the repo ships no requirements.txt and no model downloads. It only uses PIL, numpy, and torch, all of which ComfyUI already has. This is the rare custom node you can add without holding your breath over dependency conflicts.

    Where people get burned

    • The "Auto Run" toggle in the README doesn't exist in the shipped code. The README talks about turning auto-run off; the actual JS always re-runs after a stroke. Your real control is debounce_ms - crank it to 2500–3000 if you don't want a generation every time you breathe near the canvas. (This is a case of the README being aspirational; trust the code.)
    • Nothing drawing = a white image. If you run the graph without touching the canvas, you get a pure-white IMAGE, which through a scribble ControlNet is no guidance at all. Draw something, even a rough blob, to see the point of it.
    • It interrupts your generation mid-run the moment you start a new stroke. If you're waiting on a slow Flux or SDXL sample, don't touch the canvas until it finishes.
    • Thin strokes vanish. A 1–2px mark at 1024px barely survives the resize to 512 or 768. Use a chunky brush.
    • One structural nit: the node registers the very generic class name Whiteboard. It's a fine name, but it's the kind of thing that collides if another pack ever defines the same class - if you ever see a duplicate-node warning, that's why.

    Keep the sketch loose and let ControlNet do the work - control weight around 0.8–1.2 for strict adherence to your doodle, and end the control early (around 0.5 of the sampling steps) if you want the model to own the finish. Small node, but it fixes a genuinely annoying part of sketch-to-image work.

    Categoryimage/drawing

    Inputs (5)

    NameTypeDefaultDescription
    widthINT76864–2048
    heightINT76864–2048
    brush_sizeINT201–100
    debounce_msINT15000–5000
    image_dataSTRING

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE