My stuff

  • My Workflows

  • Liked Workflows

  • Following Workflows

Go to OpenArt main site
Upload workflow

Txt2Img to SVG Potracer Vector Conversion Example Workflow

5.0

0 reviews
8
3.8K
381
1
Description

This is the example for the custom ComfyUI node I developed called ComfyUI-ToSVG-Potracer available on Comfy Registry and Github.

Potracer to SVG node traces a raster image (IMAGE) into an SVG vector graphic using the 'potracer' pure Python library for POTRACE by Tatarize.

While each user and route will have their specific usecase, my usecase is creating designs for Vinylcutters and logos. This usecase requires sharp images, fluid shapes and clear separation of fore and background. It is also vital to have the lines and curves smooth, with as few vectors as possible while staying true to the form.

Check out my Github for the differences in approach and more info.

In short; As Potrace converts the image to 1 foregroundcolor and 1 backgroundcolor, the ComfyUI-ToSVG-Potracer node is pretty much unusable for any image requiring more than one color, especially photos.


V1.2.0 BREAKING / FIXING CHANGE: Output LIST --> Output String

  • Yanick112's ToSVG Node switched recently from LIST to String. My V1.0.0 didn't account for that.
  • ComfyUI-ToSVG has the 'nightly' version in ComfyUI Custom Node Manager, and therefor doesn't do versioning.
  • Update package; in your workflow: rightclick recreate node or Reload example workflow (V1.2).; It should connect now to ToSVG nodes.
  • If it DID work before and now it doesn't, update the ComfyUI-ToSVG Package.


Workflow details

This Workflow is evolved from the Flux Text to Vector Workflow by Stonelax which uses Yanick112's ComfyUI-ToSVG nodes. My workflow relies on LATEST VERSION Yanick112's  SaveSVG and Vector to Raster (SVG) nodes.The node is model independent, but I'm getting great results using FLux. However, Flux Dev sometimes has trouble with white backgrounds and creates blurry images. Defining a different color background can help a lot with that. Make sure your input image is as clean as possible. Describe your prompt accordingly.


  • Model: Flux_dev (t5xxl_fp8_e4m3fn / clip_l)

Settings:

Euler - Simple

Steps - 25-30

Latent Image size - 1024x1024

Distilled CFG Scale - 3.5

CFG - 1

Comfyui-various - Image Contrast: 1.5 - 2

  • Lora: Simple_Vector_Flux_v2_renderartist

Trigger keyword: v3ct0r , vector

Recommended strengths: 0.6 - 0.9

  • Lora: Simple_Vectors_Flux_by_Sarcastic_TOFU

Trigger keyword: Simple_Vectors_Flux

  • LORA: v3ctora (Vector art & Line art (Flux))

Trigger: v3ctora style


Prompt tips:

  • Style: Bold, clean, smooth letters with rounded corners, solid fills (no texture), black on white, high contrast
  • Theme: Typography, large bold lettering, playful, dynamic
  • Text: With the text: "YOUR TEXT"
  • Colors: black, white
  • Background: Clean white, simple design, no extra details


ps; when unlinking the image generation and adding any Loadimage node, you can easily do 'image to svg' conversion of pre-existing images; you load an existing B/W image of an icon/text and can convert it to SVG. You can use an upscale node for the input image, but I found it rarely improves quality; in fact, it is usually worse than the original.

It usually helps more to clean up the contrast, especially with highly compressed jpg images. The output svg can be scaled using the output_scale parameter


Disclaimer

This is my First ever (public) ComfyUI node and workflow.
While tested thoroughly, and as with all custom nodes, USE AT YOUR OWN RISK.

While tested a lot and I have IT knowledge, I am no programmer by trade. This is a passion project for my own specific usecase and I'm sharing it so other people might benefit from it just as much as i benefitted from others. I am convinced this implementation has its flaws and it will probably not work on all other installations
worldwide.
I can not guarantee if this project will get more updates and when.


Discussion

(No comments yet)

Loading...

Author

2
478
8
5.0K

No reviews yet

  • - latest (5 months ago)

  • - v20250331-172330

Primitive Nodes (9)

CLIPTextEncodeFlux (2)

ConvertVectorToRaster (1)

Note (4)

PotracerVectorize (1)

SaveSVG (1)

Custom Nodes (18)

ComfyUI

  • - DualCLIPLoader (1)

  • - SaveImage (2)

  • - EmptyLatentImage (1)

  • - LoadImage (1)

  • - LoraLoaderModelOnly (1)

  • - UNETLoader (1)

  • - VAELoader (1)

  • - VAEDecode (1)

  • - ImageScaleBy (2)

  • - KSampler (1)

ComfyUI Easy Use

  • - easy imageSwitch (1)

  • - LayerUtility: ColorPicker (3)

  • - JWImageContrast (2)

Checkpoints (0)

LoRAs (1)

Textimprover-FLUX-V0.4.safetensors