• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Custom Script for Automatics1111 StableDiffusion-WebUI.

This script is discontinued ...

but coming back as new extension : Vector Studio


Text to Vectorgraphics

This is a custom script to extend Automatic1111 StableDiffusion WebUI, in order to generate useful SVG or PDF icons given by your prompts.

How it works

It tunes your prompts in that way to create suitable images to be vectorizied by the POTRACE command line tool. The resulting SVG or PDF file is stored next to your png files in output/samples (default).

Examples

prompt PNG SVG
Happy Einstein
Mountainbike Downhill
coffe mug in shape of a heart
Headphones

Screenshot

image image

Features

  • New: Added Visual Styles - RadioButtons provided by the script. Edit the script to extend of modify Stuff like Illustration, Tattoo, Anime etc, to save your time finding prompts on your own. If nothing matches, select "None - promp only" and have back full control.

  • New: Linux and Mac support handling POTRACE for you

Installation

Windows

  • Clone or download the txt2vectorgraphics.py file
  • place it into your SD-installtion folder into "scripts"
  • run your webui as usual
  • HINT: Install Microsoft Powertoys for free, and enjoy in your file explorer SVG previews. image

Linux

If you're running under WSL, Ubuntu or another Linux distro you will need to install potrace. Run sudo apt install potrace.

Mac

Run brew install potrace. Ensure potrace is in your PATH so that you could run in simply by calling from a command terminal.

Dependencies, Potrace

At execution time, the script checks if your have

Recommendations

  • Use short prompts, like "Einstein", "Happy Einstein" ...
  • avoid "realistic" attributes
  • Sampling Steps ~40 is my best experience (to reduce noise and avoid details)
  • CFG Scale 10-12
  • Dont restore faces
  • use 512x512 if no special demand on ratio
  • Batch count support (16)
  • Mostly you want to make white parts opaque (see checkbox in the scripts ui)
  • Same for clipping the content to SVG size

History

Version 0.3:

  • Fix on Controlnet internal images
  • Display SVGs in gallery!