Nodes/ComfyUI_OmniSVG/OmniSVG_Sampler
ComfyUI Node

OmniSVG_Sampler

Text or image in, editable SVG out — plus a preview so you know when to reroll

By smthemex·Created about a year ago·Updated 9 months ago· 31
OmniSVG_Sampler
  • model
  • image
  • mask
  • image
  • svg_path
promptA yellow t-shirt with a heart design represents love and positivity.
max_length384
top_p0.90
top_k50
temperature0.50
rep_penalty1.05
num_candidates1
seed0
subtype
save_allfalse

Once OmniSVG_Loader has the model in VRAM, the Sampler is the whole show. Give it a text prompt - or an image - and it runs the Qwen2.5-VL backbone and hands you a real .svg file plus a rendered PNG preview of it. One node, two modes, and the README's rule of thumb is exact: connect an image and it vectorizes it, leave it disconnected and it draws from text. That's literally what the code checks - the optional image input being wired up flips the task from text-to-SVG to image-to-SVG.

Mechanically it's a chat-turned-sampler. The node builds a system-style prompt ("You are an expert SVG code generator..."), the model autoregressively emits the SVG as its special token vocabulary (coordinates, colors, masks), and an SVGTokenizer decodes that stream back into actual SVG markup. Then Cairo renders each candidate to a PNG so the node can run a validity check - an effectively-empty render gets thrown out - and the best candidate is saved to ComfyUI's output folder. So what you get isn't just a string of path data; it's a checked SVG and a preview of it, in one pass.

Inputs that matter:

  • model - from the Loader, the only mandatory upstream.
  • prompt - multiline text. The default ("A yellow t-shirt with a heart design...") is fine to leave until you know what you're doing.
  • subtype - auto / illustration / icon. In auto it keyword-sniffs your prompt (heart/logo/symbol → icon; scene/character/landscape → illustration). Text-to-SVG only; image mode ignores it.
  • num_candidates (1–4) - how many SVGs to roll per run, keeping the one that validates best. This is your main quality lever; crank it when the output is weak.
  • seed - same idea as any other sampler: change it to reroll.
  • save_all - write every candidate to disk instead of just the winner.

The sampling quartet (top_p, top_k, temperature, rep_penalty) and max_length are standard LLM knobs. The defaults are sane - temperature 0.5, repetition penalty 1.05, 384 tokens - so a beginner can ignore them until a prompt misbehaves.

The two outputs are both useful: image (an IMAGE tensor of the rendered preview) wires into PreviewImage or SaveImage, and svg_path is a STRING holding the path(s) of the saved .svg files in ComfyUI's output directory - it's a path, not the file itself, so a PreviewAny node is the natural place to eyeball it.

Now the honest part, because this node's reputation is the whole game. OmniSVG is genuinely cool - real, editable, multi-color vector art out of a text description is not nothing - but it is not reliable. The pack author's own README update says the hit rate isn't good enough and you end up "pulling gacha," i.e. rerolling. Community testing lines up: simple prompts and icon-style subjects come out decent, and complex scenes or detailed image-to-SVG are a lottery - one early tester reported roughly one usable result in ten on complex images. So budget your expectations: keep prompts simple and icon-like, push num_candidates up, and treat seed-rolling as part of the workflow, not a sign you broke something. If your actual need is clean two-tone logo flats or tracing a raster image, a potrace-style node is the sharper tool; OmniSVG earns its VRAM when you want layered, editable vector output straight from a sentence.

Installation is the same as the pack: ComfyUI Manager or a git clone, then pip install -r requirements.txt, then restart. There's nothing extra to download for this node beyond the models the Loader article covers. If you're on Windows and hit a numpy error after install, pin numpy==1.26.4. And remember the model-size trap lives upstream in the Loader - if your SVG quality suddenly shifts, check what filename you picked there, not here.

CategoryOmniSVG

Inputs (13)

NameTypeDefaultDescription
modelOmniSVG_Loader
promptSTRINGA yellow t-shirt with a heart design represents love and positivity.
max_lengthINT384256–2048
top_pFLOAT0.900–1
top_kINT501–1000
temperatureFLOAT0.500–1
rep_penaltyFLOAT1.050–10
num_candidatesINT11–4
seedINT00–2147483647
subtypeCOMBO3 options: auto, illustration, icon
save_allBOOLEANfalse
imageoptIMAGE
maskoptMASK

Outputs (2)

NameTypeDescription
imageIMAGE
svg_pathSTRING