Nodes/ComfyUI-ToSVG/SVG Preview
ComfyUI Node

SVG Preview

See your SVG without leaving ComfyUI

By Yanick112·Created 2 years ago·Updated about a year ago· 313
SVG Preview
      svg_strings

      Rename notice up front: SVGPreview is the old class name. The ComfyUI-ToSVG pack's June 17 update renamed its nodes to TS_* prefixes, and this node now lives as TS_SVGStringPreview with the same single input and the same behavior. If a saved workflow complains about a missing SVGPreview node, that's the rename, not a broken install.

      What it does is simple and genuinely useful: it takes an SVG string, renders it to pixels, and shows you the result right in the ComfyUI UI - so you can check what a trace actually looks like before you commit to saving it. That feedback loop is the whole difference between fighting blind with sliders and being able to tune corner_threshold in twenty seconds.

      How it works

      It rasterizes the SVG with PyMuPDF (fitz), converts the render to a PIL image and then to a tensor, and hands it to ComfyUI's standard image-saving machinery - the same SaveImage path core ComfyUI uses, but pointed at the temp directory with a random per-session prefix so previews don't pile up in your output folder. It's an output node: SVG string in, preview image out to your screen, no formal outputs to wire.

      The one input

      • SVG_String - any SVG markup, from a converter, from TS_SVGPathSimplify after a cleanup pass, or anywhere else.

      Where it fits

      The standard loop: generate → vectorize → TS_SVGStringPreview → look → tweak → vectorize again. Once you're happy, swap the preview for TS_SaveSVGString and write the file. You can even preview mid-pipeline - simplify, preview, decide whether the simplification was too aggressive.

      Install

      Same pack, same install as every node here. ComfyUI Manager → search ComfyUI-ToSVG → Install → restart, or:

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

      Dependencies: vtracer, numpy, Pillow, torch, PyMuPDF, potracer. No models, no keys, CPU-only. If you ever hit a fitz import error after updating other nodes, reinstall PyMuPDF - the shared-Python-environment dependency dance is the usual cause.

      Category💎TOSVG

      Inputs (1)

      NameTypeDefaultDescription
      svg_stringsSTRING

      Outputs (0)

      No outputs