SVG Load (fichier → SVG_TEXT)
Pull an .svg file into the graph as usable text
- svg_text
- path
SVG Load is the front door of the SVG lane in ComfyUI_DAO_master: it reads an .svg file from disk and hands it to the graph as SVG_TEXT. Without it, your hand-drawn or exported SVG files are just files sitting on disk, useless inside ComfyUI. With it, you can bring an existing logo, a plotter design, or an exported vector into the graph, restyle it, run boolean operations on it, and rasterize it back into an image tensor.
How it works
The node reads the file as raw text, parses it with Python's built-in XML tools, and makes three optional adjustments before handing it over:
ensure_viewbox(default on) - if the SVG haswidth/heightbut noviewBox, it creates one (0 0 w h). This matters more than it sounds: a lot of SVG tooling (including this pack'sSVG Preview) needs aviewBoxto know the aspect ratio.scale(default 1) - wraps the content in a<g transform="scale(...)">group. Withcenter_on_viewboxon (default), scaling happens around the drawing's center rather than the origin, so things stay roughly where they were.scale_canvas- additionally multiplies thewidth/heightattributes on the canvas, so the declared dimensions match the scaled content.
If the XML parse fails (weird doctypes, non-standard files), it gracefully falls back to returning the raw text untouched rather than erroring - a nice touch.
Inputs and outputs
Inputs: file_path (default input.svg, so a relative path resolves from ComfyUI's input folder), scale, center_on_viewbox, scale_canvas, ensure_viewbox.
Outputs: svg_text (the SVG_TEXT content) and path (the absolute file path, just for confirmation). Wire svg_text into SVG Style, SVG Boolean, SVG Preview, or SVG Save.
Why you'd use it
Realistically you'll use this when a workflow already produces SVG files - from this pack's own DXF to SVG or another vectorization node - and you want to loop them back into the graph for more processing. SVG_TEXT is this pack's custom string-ish type, so the clean handoff between SVG Load and the other SVG nodes is the whole point.
How to install
Part of the orion4d/ComfyUI_DAO_master pack:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/ComfyUI_DAO_master.git
pip install lxml # or pip install -r requirements.txt
Restart ComfyUI. No models, no system tools.
Common issues
The most common failure is FileNotFoundError - remember relative paths are resolved against ComfyUI's input folder, so logo.svg means ComfyUI/input/logo.svg, not the folder you last saved to. If the node returns text that downstream nodes choke on, check the file actually parses as XML; the fallback-to-raw-text behavior hides problems rather than explaining them. And if scaling seems to happen around the wrong point, that's center_on_viewbox off - turn it on.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | input.svg | — |
| scale | FLOAT | 1.000.01–100 | — |
| center_on_viewbox | BOOLEAN | true | — |
| scale_canvas | BOOLEAN | false | — |
| ensure_viewbox | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| svg_text | SVG_TEXT | — |
| path | STRING | — |