Nodes/AAA Metadata System/Eric Save True SVG Image (with Metadata)
ComfyUI Node

Eric Save True SVG Image (with Metadata)

Saving Real Vector SVG From ComfyUI (With the Metadata That Goes With It)

By EricRollei·Created 10 months ago·Updated 8 months ago· 13
Eric Save True SVG Image (with Metadata)
    • saved_path
    svg_content
    filename_prefixwordcloud_svg
    include_projectfalse
    include_datetimetrue
    custom_output_directory
    output_path_modeSubfolder in Output
    filename_formatDefault (padded zeros)
    enable_metadatatrue
    title
    project
    description
    creator
    copyright
    keywords
    custom_metadata{}
    save_embeddedtrue
    save_workflow_as_jsontrue
    save_workflow_as_txtfalse
    save_xmpfalse
    save_to_dbfalse
    svg_optimizefalse
    svg_embed_fontsfalse
    color_profilesRGB v4 Appearance
    bit_depth8-bit
    debug_loggingfalse

    Most "SVG" nodes in ComfyUI lie: they rasterize an image and wrap it in an SVG tag, so you get a vector file that's really just a PNG in a costume. Eric Save True SVG Image is not that. It takes actual SVG content - a string of real vector markup - writes it to disk, and embeds metadata straight into the file's XML. Scalable forever, readable by Inkscape, and still carrying your generation info. If that sounds niche, it is. But if you're producing word clouds, plots, or anything genuinely vector-shaped, it's the node that gets them out of ComfyUI properly.

    The required inputs tell the story: svg_content (a string; it's marked as force-input, so wire it from somewhere - the obvious companion is this same pack's word cloud node's svg_export output) and filename_prefix (defaults to wordcloud_svg, which is a hint about who this node was written for). The whole metadata stack from the pack's bigger save node is here: title, description, creator, copyright, keywords, and custom_metadata (a JSON string) all get embedded into the SVG's Dublin Core block when save_embedded is on. enable_metadata is the master kill switch.

    There are two honest catches. First, PNG's magic trick - embedding the whole workflow so you can drag the image back into ComfyUI and rebuild the graph - doesn't work in SVG. The node gets around it with save_workflow_as_json, which writes the workflow as a separate .json file. Leave that on if you want reproducibility. Second, some of the fancier toggles are more cosmetic than they sound: svg_optimize strips whitespace, svg_embed_fonts records font info as metadata (it doesn't actually embed font files), and color_profile/bit_depth are stored as reference metadata rather than changing vector rendering. None of that is a bug - it's just knowing which switches move the needle.

    File naming follows the pack's usual options: include_project, include_datetime, a filename_format choice between padded zeros and simple numbering, and custom_output_directory with an output_path_mode toggle for absolute paths versus subfolders under the output directory. Output is a single saved_path string telling you where the file landed.

    One warning: the source pack is a one-author project with no real community footprint, and this node exists to serve that pack's own vector output. It'll happily save any SVG string you throw at it, but it's not a general-purpose vector pipeline - there's no raster-to-vector tracing here (that'd need something like VTracer, which is an optional, commented-out dependency in the requirements). Feed it real SVG content and it shines; expect magic and you'll be disappointed.

    Install via ComfyUI Manager (search AAA Metadata System) or the usual clone:

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

    Restart, wire your SVG string into svg_content, and you've got a genuinely vector file with its workflow parked beside it. For a niche, it works.

    Categoryimage/save

    Inputs (25)

    NameTypeDefaultDescription
    svg_contentSTRINGNative SVG content as string
    filename_prefixSTRINGwordcloud_svgBase name for saved files
    include_projectoptBOOLEANfalseAdd project name to filename
    include_datetimeoptBOOLEANtrueAdd date and time to filename
    custom_output_directoryoptSTRINGOverride the default output location. For relative paths, use 'subfolder' format. Leave empty to use default output folder.
    output_path_modeoptCOMBOSubfolder in OutputHow to interpret the custom output directory
    filename_formatoptCOMBODefault (padded zeros)How to format sequential filenames
    enable_metadataoptBOOLEANtrueMaster switch to enable/disable all metadata writing
    titleoptSTRINGSVG title
    projectoptSTRINGProject name for organization
    descriptionoptSTRINGSVG description/caption
    creatoroptSTRINGCreator/artist name
    copyrightoptSTRINGCopyright information
    keywordsoptSTRINGComma-separated keywords/tags
    custom_metadataoptSTRING{}Custom metadata in JSON format
    save_embeddedoptBOOLEANtrueEmbed metadata directly in the SVG file
    save_workflow_as_jsonoptBOOLEANtrueSave workflow data as a separate JSON file (required for ComfyUI workflow loading)
    save_workflow_as_txtoptBOOLEANfalseSave workflow data as a separate text file
    save_xmpoptBOOLEANfalseSave XMP sidecar file with metadata
    save_to_dboptBOOLEANfalseSave metadata to database
    svg_optimizeoptBOOLEANfalseBasic SVG optimization (remove unnecessary whitespace)
    svg_embed_fontsoptBOOLEANfalseAttempt to embed font information as metadata
    color_profileoptCOMBOsRGB v4 AppearanceColor profile to embed as metadata (for reference when converting SVG)
    bit_depthoptCOMBO8-bitBit depth for metadata reference (actual SVG is vector format)
    debug_loggingoptBOOLEANfalseEnable detailed debug logging

    Outputs (1)

    NameTypeDescription
    saved_pathSTRING