Nodes/ComfyUI-Svg2Gcode/VPype Extended SVG Processor
ComfyUI Node

VPype Extended SVG Processor

Hand-drawn looks, hidden lines, and 26 knobs

By boardmain·Created 8 months ago·Updated 8 months ago· 4
VPype Extended SVG Processor
    • svg_output
    svg_input
    linemerge_enabletrue
    linemerge_tolerance0.10
    linesimplify_enabletrue
    linesimplify_tolerance0.05
    reloop_enablefalse
    reloop_tolerance0.05
    squiggles_enablefalse
    squiggles_amplitude0.5
    squiggles_period3.0
    filter_min_length0.0
    occult_enablefalse
    occult_ignore_layersfalse
    occult_cross_layersfalse
    occult_keep_occultedfalse
    linesort_enabletrue
    linesort_two_optfalse
    multipass_count0
    rotate_angle0
    skew_x0
    skew_y0
    scale_x1.00
    scale_y1.00
    layout_enabletrue
    layout_width210
    layout_height297
    layout_margin10.0
    layout_align
    layout_valign
    layout_fit_to_marginstrue

    VPypeExtendedProcessor is what the plain VPypeProcessor becomes when you decide the basics aren't enough. Same idea - take an SVG, clean it up with the vpype plotting toolchain, hand back a plot-ready SVG - but every feature has its own toggle, and it adds three genuinely different effects the simple version can't do at all: squiggles, relooping, and hidden-line removal. If you want your AI image to plot like it was drawn by a slightly anxious human hand instead of a laser, this is the node.

    It's part of the same boardmain/ComfyUI-Svg2Gcode pack as the other two, and it sits in the same spot in the pipeline: after your SVG tracer, before the VPypeGCodeGenerator.

    How it works

    Mechanically it's the same trick as its siblings - it shells out to the vpype executable via subprocess, writes your SVG to a temp file, builds a vpype command, and reads back the result. The difference is the command is assembled conditionally: every stage is only appended when its enable flag is on. So with everything off you get a bare read + write, and each toggle you flip appends the corresponding vpype command. That means the "extended" in the name is mostly control - you can switch off the auto-linemerging that the basic node forces on you, which matters when aggressive merging is eating the detail you actually want.

    The inputs that matter

    Twenty-six inputs is a lot. Ignore most of them until you need them, and know these groups:

    • The hand-drawn look: squiggles_enable, squiggles_amplitude, squiggles_period - turns straight strokes into wavy ones (amplitude and period in mm). This is the effect people usually come for: it's how you fake a sketchy, organic line. reloop_enable + reloop_tolerance rejoin nearly-closed paths into cleaner loops.
    • Hidden-line removal: occult_enable (with occult_ignore_layers, occult_cross_layers, occult_keep_occulted) - this is where the vpype-occult dependency earns its keep. It hides lines that are behind others, so SVG that looks like a layered or 3D-ified shape plots as clean visible line art instead of spaghetti.
    • Optimization: linemerge_enable/linesimplify_enable/linesort_enable are the same clean-up from the basic node, now opt-in. linesort_two_opt switches from nearest-neighbor ordering to the slower, smarter 2-opt travel path - genuinely worth it for dense plots.
    • Transform: rotate_angle, skew_x, skew_y, scale_x, scale_y - rotate, skew, and non-uniform scale, all with the default 0/1 so nothing moves unless you move it.
    • Layout: layout_enable, layout_width/layout_height (A4 defaults), layout_margin, plus layout_align/layout_valign (center/left/right and center/top/bottom) and layout_fit_to_margins - the same fit-to-page behavior as the basic node, but you get to pick the alignment instead of always centering.
    • The leftovers: filter_min_length (drop speckles), multipass_count (draw multiple times).

    Output is a single svg_output (STRING), ready for VPypeGCodeGenerator.

    Installing it

    Same install as the rest of the pack. ComfyUI Manager → search "ComfyUI-Svg2Gcode" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/boardmain/ComfyUI-Svg2Gcode
    cd ComfyUI-Svg2Gcode
    pip install -r requirements.txt
    

    That installs vpype, vpype-occult, and vpype-gcode into ComfyUI's Python environment. The vpype-occult package is the one this node actually needs for the occult feature - if you get an error about a missing occult command, that's what's missing. No model files, nothing for the GPU.

    Where people get burned

    Two things, and they're both the same theme as the other nodes: since this shells out to vpype, the "vpype executable not found" error shows up whenever the CLI isn't on the PATH of the process that launched ComfyUI (very common on Windows). And with this many toggles it's easy to stack effects and wonder what happened - crank squiggles_amplitude too high and you'll get a wavy explosion, and note that multipass_count only kicks in above 1 here (the basic node uses 0 as off). Start with just the one effect you want, verify the SVG, then add more. This is a small, lightly-maintained pack from a one-person author, so defaults are a suggestion, not a spec - trust a cheap test plot over assumptions.

    CategoryVPype

    Inputs (30)

    NameTypeDefaultDescription
    svg_inputSTRING
    linemerge_enableBOOLEANtrue
    linemerge_toleranceFLOAT0.100–10
    linesimplify_enableBOOLEANtrue
    linesimplify_toleranceFLOAT0.050–10
    reloop_enableBOOLEANfalse
    reloop_toleranceFLOAT0.050–10
    squiggles_enableBOOLEANfalse
    squiggles_amplitudeFLOAT0.50–50
    squiggles_periodFLOAT3.00.1–100
    filter_min_lengthFLOAT0.00–100
    occult_enableBOOLEANfalse
    occult_ignore_layersBOOLEANfalse
    occult_cross_layersBOOLEANfalse
    occult_keep_occultedBOOLEANfalse
    linesort_enableBOOLEANtrue
    linesort_two_optBOOLEANfalse
    multipass_countINT00–50
    rotate_angleFLOAT0-360–360
    skew_xFLOAT0-89.9–89.9
    skew_yFLOAT0-89.9–89.9
    scale_xFLOAT1.000.01–100
    scale_yFLOAT1.000.01–100
    layout_enableBOOLEANtrue
    layout_widthFLOAT21010–5000
    layout_heightFLOAT29710–5000
    layout_marginFLOAT10.00–100
    layout_alignCOMBO3 options: center, left, right
    layout_valignCOMBO3 options: center, top, bottom
    layout_fit_to_marginsBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    svg_outputSTRING