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)

136
Upvotes
21
u/tinymoo Oct 01 '22 edited Oct 01 '22
FYI: the script automatically appends "(((vector graphic))), (((black white, line art))), atari graphic" to your prompt, hence getting the consistently iconic results from seemingly generic beginnings. (Edit: and there's variables with positive and negative prompts as defined, and thus tweakable, *very* plainly in the .py file. Very nice!)
It's definitely a great first step and I'm sure many are going to find it useful. Many thanks!
6
u/justpokin Oct 01 '22
Have you looked in to using https://github.com/visioncortex/vtracer over Potrace?
I prefer it for the option of working with a wider range of images.
5
u/ninjasaid13 Oct 01 '22
Is there a script that makes the background transparent automatically?
4
u/Acceptable-Cress-374 Oct 01 '22
Is there a reason for keeping it black & white? This could be used to come up with quick concepts for logos, it would be really neat if it could also do colors
41
u/MaCeGaC Oct 01 '22
As if millions of "FREE VECTOR" sites suddenly cried out in terror and were suddenly silenced...
3
u/creeduk Jan 21 '23
I tested this recently with the new model - vector-art by u/irateas
https://civitai.com/models/4618/vector-art
Read more here - https://www.reddit.com/r/StableDiffusion/comments/10daonu/sd_21based_vectorart_style_model_link_to_the/
the model focus on vector style art to png but with the script you can easily get that as svg and much easier for sticker, logo type outputs.
2
u/QuazarTiger Oct 01 '22
Awesome idea
2
u/ShepherdessAnne Oct 01 '22
Creating vector graphics is just a couple steps away from automated rigging...
2
u/delijoe Oct 02 '22
The Webui is showing an error when trying to load the script with this error:
Error loading script: txt2vectorgfx.py
Traceback (most recent call last):
File "C:\SD\stable-diffusion-webui\modules\scripts.py", line 69, in load_scripts
compiled = compile(text, path, 'exec')
File "C:\SD\stable-diffusion-webui\scripts\txt2vectorgfx.py", line 68
<title>Txt2Vectorgraphics/txt2vectorgfx.py at 4d89e53528b0a72713fea99b9d6e75ee99919b26 · GeorgLegato/Txt2Vectorgraphics</title>
I posted this error on the issues page in github.
1
u/eat-more-bookses Oct 01 '22
This is fantastic! Thanks for sharing
1
u/TodoEpic Oct 01 '22
Great idea! I'm testing it right now and the results are quite good. Bravo!
1
u/lechatsportif Oct 01 '22
Thank you thank you thank you, been wanting something like this!
1
u/ciavolella Oct 09 '22
Wanted to say thanks for the edit on github, didn't want to spam your issues page, so I'm replying here. It worked. To reply to your question, my wife doesn't have a website, she only uses socials to advertise. But as soon as we go SD txt2vector to a cut svg stencil or vinyl, I'll inbox that to you here.
1
u/[deleted] Dec 12 '22 edited Dec 12 '22
[removed] — view removed comment