SVG Style Editor (Simple)
Recolor paths by number, no JSON required
- svg
- meta
The other style editor in this pack wants JSON rules and CSS selectors. This one just wants numbers. SVG Style Editor (Simple) recolors SVG paths by their index - path_indices: "0,2-5,10" means "paths 0, 2, 3, 4, 5, and 10" - through flat input fields instead of a JSON blob. It's the version you reach for when you've renumbered your paths, know exactly which ones you want, and don't want to type a single brace.
Inputs that matter
path_indices- the selection syntax:0,1,5or0-5or any mix like0,2-4,10. Empty (the default) means no paths selected, i.e. nothing changes. Ranges are inclusive, which trips people up:2-4is paths 2, 3, and 4.stroke_color- hex like#FF0000or a named color likered. Empty = no change.stroke_width- 0 = no change, anything above sets the width.fill_color- hex, named color, or the literalnoneto remove a fill. Empty = no change.opacity--1= no change, 0–1 sets it.
That -1/empty/0 "means don't touch" convention is the whole ergonomics trick of this node: you only set the fields you care about, and the rest pass through untouched. The tooltips are explicit about all of it.
Outputs: svg (restyled string) and meta (JSON stats of what changed - how many paths, which properties).
The live color widget bonus
This node is one of the four that get the pack's JavaScript color picker: a swatch + alpha slider + live preview appears right on the color fields, no node execution needed. So "recolor paths 0 and 3 a nice teal at 80%" becomes: type the indices, drag the swatch, drag alpha, done. The widget makes the Simple editor genuinely pleasant in a way its JSON sibling isn't - if you're trying to iterate on colors quickly, this is the node to do it in.
Simple vs. full
The trade-off is straightforward. Simple = index-based, flat fields, one selection, one color set, fast iteration. Full SVG Style Editor = selector-based (#path0, .hair, [id*=eye]), JSON rules, multiple selections per run, survives reordering better. Simple is the right tool when you've run SVG Auto Reorder with renumber_ids (the README literally recommends this combo) and your path numbers are stable and meaningful. Full is the right tool when your path count is large and IDs mean something semantic. Most people want Simple most of the time.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/TJ16th/TJ_ComfyUI_Lineart2Vector.git
# restart ComfyUI
or ComfyUI Manager → search TJ_ComfyUI_Lineart2Vector. No models, no keys. The node itself is pure XML manipulation; the pack's heavy deps (opencv, scikit-image) are for the detection nodes, not this one. If the color widget doesn't show up, hard-refresh your browser - it's a frontend JS file, not something pip installs.
Where people get burned
Index drift is the big one. Indexes are positions in the file, so any reorder or path removal after you write your rule silently changes which paths your indices point at. Reorder first, then style, then don't reorder again. Also: 2-4 being inclusive is a frequent off-by-one, and indices past the end of the path list just match nothing (check meta). Finally, remember fill_color accepts the literal none - "empty = no change" means you literally can't set "no fill" by leaving it blank, which confuses exactly one time before you learn it.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| svg_string | STRING | — | |
| path_indicesopt | STRING | Path numbers: 0,1,5 or 0-5 or mix like 0,2-4,10 | |
| stroke_coloropt | STRING | Stroke color: #FF0000 or red (empty = no change) | |
| stroke_widthopt | FLOAT | 0.00–50 | Stroke width (0 = no change) |
| fill_coloropt | STRING | Fill color: #00FF00 or none (empty = no change) | |
| opacityopt | FLOAT | -1.00-1–1 | Opacity (-1 = no change) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| svg | STRING | — |
| meta | STRING | — |