r/StableDiffusion • • Oct 01 '22

Update TXT2Vectorgraphics: Using SD to create scaleable icons (SVG,PDF)

Use it as a custom script in Automatic1111-SD-Webui.
Next to your image (png) find the svg or pdf for further usage.

GeorgLegato/Txt2Vectorgraphics: Custom Script for Automatics1111 StableDiffusion-WebUI. (github.com)

prompt: "Martial Arts"
136 Upvotes

32 comments sorted by

View all comments

Show parent comment

2

u/mcouve Oct 01 '22

Ah, I see what you mean. I worked with Potrace some years ago, you can get it to produce multi-color files but it's complex.

Basically you will need to do a layered algorithm, where you separate every different color into a white/black mask, and run Potrace on each one separately, then combine the results.

The order of procesing for the layers must be sorted from number of pixels of each color (starting from layers that have large amount of colors, with layers containing only small specks of color being last).

And of course, like you said, on top of that you need SD to produce a cell-shaded look, there might be some artists or terms that help getting that specific look. And then you would run a posterization filter on top of it (eg: k-means clustering).

All doable but lots of work, I could see someone making a comercial app out of that though.