ComfyUI > Nodes > ComfyUI-ToSVG > Raster to Vector (SVG)

ComfyUI Node: Raster to Vector (SVG)

Class Name

ConvertRasterToVector

Category
💎TOSVG
Author
Yanick112 (Account age: 844days)
Extension
ComfyUI-ToSVG
Latest Updated
2024-06-14
Github Stars
0.02K

How to Install ComfyUI-ToSVG

Install this extension via the ComfyUI Manager by searching for ComfyUI-ToSVG
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-ToSVG in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Raster to Vector (SVG) Description

Transform raster images into SVG vector graphics for high-quality, scalable artwork creation.

Raster to Vector (SVG):

The ConvertRasterToVector node is designed to transform raster images into vector graphics in SVG format. This conversion process is particularly beneficial for AI artists who want to scale images without losing quality, as vector graphics are resolution-independent. The node leverages advanced algorithms to trace the pixel data of raster images and convert them into scalable vector paths. This allows for more flexible and high-quality image manipulation, making it an essential tool for creating detailed and scalable artwork from raster images.

Raster to Vector (SVG) Input Parameters:

image

This parameter accepts the raster image that you want to convert to a vector format. The image should be in a format that can be processed by the node, typically an IMAGE type.

colormode

Determines the color mode for the vector conversion. Options are color and binary, with the default being color. The color mode retains the original colors of the image, while binary converts the image to black and white.

hierarchical

Specifies the hierarchical structure of the vector paths. Options are stacked and cutout, with the default being stacked. Stacked mode layers the paths on top of each other, while cutout mode creates a cutout effect.

mode

Defines the type of paths to be used in the vector graphic. Options are spline, polygon, and none, with the default being spline. Spline creates smooth curves, polygon creates straight-edged shapes, and none disables path smoothing.

filter_speckle

An integer value that filters out small speckles in the image. The default is 4, with a range from 0 to 100. Higher values will remove more speckles, which can help clean up the vector output.

color_precision

An integer value that sets the precision of color matching in the vector graphic. The default is 6, with a range from 0 to 10. Higher values result in more accurate color representation.

layer_difference

An integer value that determines the difference in color layers. The default is 16, with a range from 0 to 256. This affects how distinct the color layers are in the vector graphic.

corner_threshold

An integer value that sets the threshold for detecting corners in the image. The default is 60, with a range from 0 to 180. Lower values will detect more corners, resulting in more detailed vector paths.

length_threshold

A float value that sets the minimum length for a path segment. The default is 4.0, with a range from 0.0 to 10.0. Shorter lengths will create more detailed paths.

max_iterations

An integer value that sets the maximum number of iterations for the vectorization process. The default is 10, with a range from 1 to 70. More iterations can result in a more accurate vector graphic.

splice_threshold

An integer value that sets the threshold for splicing paths together. The default is 45, with a range from 0 to 180. Lower values will splice more paths together, simplifying the vector graphic.

path_precision

An integer value that sets the precision of the paths in the vector graphic. The default is 3, with a range from 0 to 10. Higher values result in more precise paths.

Raster to Vector (SVG) Output Parameters:

LIST

The output is a list of SVG strings, each representing a vectorized version of the input raster image. These SVG strings can be used in various applications that support SVG format, allowing for scalable and high-quality image rendering.

Raster to Vector (SVG) Usage Tips:

  • For detailed images, increase the max_iterations and path_precision to capture more intricate details.
  • Use the filter_speckle parameter to clean up noisy images before vectorization.
  • Experiment with colormode and hierarchical settings to achieve different artistic effects in your vector graphics.

Raster to Vector (SVG) Common Errors and Solutions:

"Invalid image format"

  • Explanation: The input image is not in a supported format.
  • Solution: Ensure the image is in a format that the node can process, such as PNG or JPEG.

"Out of memory"

  • Explanation: The image is too large to be processed with the current system memory.
  • Solution: Reduce the image size or resolution before processing.

"Conversion failed"

  • Explanation: An error occurred during the vectorization process.
  • Solution: Check the input parameters for any invalid values and try again. Adjusting parameters like max_iterations and path_precision may also help.

Raster to Vector (SVG) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-ToSVG
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.