Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SVGDreamer: Text Guided SVG Generation with Diffusion Model

cvpr24 arXiv website blog blog

This repository contains our official implementation of the CVPR 2024 paper: SVGDreamer: Text-Guided SVG Generation with Diffusion Model. It can generate high-quality SVGs based on text prompts.

title title

πŸ†• Update

  • [03/2024] πŸ”₯ We have released the code for SVGDreamer.
  • [02/2024] πŸŽ‰ SVGDreamer accepted by CVPR2024. πŸŽ‰
  • [12/2023] πŸ”₯ We have released the SVGDreamer Paper. SVGDreamer is a novel text-guided vector graphics synthesis method. This method considers both the editing of vector graphics and the quality of the synthesis.

Installation

You can follow the steps below to quickly get up and running with SVGDreamer. These steps will let you run quick inference locally.

In the top level directory run,

sh script/install.sh

or using docker,

docker run --name svgdreamer --gpus all -it --ipc=host ximingxing/svgrender:v1 /bin/bash

πŸ”₯ Quickstart

Before running the code, download the stable diffusion model. Append diffuser.download=True to the end of the script.

SIVE + VPSD

Prompt: an image of Batman. full body action pose, complete detailed body, white background, high quality, 4K, ultra realistic
Preview:

Particle 1 Particle 2 Particle 3 Particle 4 Particle 5 Particle 6
init p1 init p2 init p3 init p4 init p5 init p6
final p1 final p2 final p3 final p4 final p5 final p6

Script:

python svgdreamer.py x=iconography skip_sive=False "prompt='an image of Batman. full body action pose, complete detailed body. white background. empty background, high quality, 4K, ultra realistic'" token_ind=4 x.vpsd.t_schedule='randint' result_path='./logs/batman' multirun=True
  • x=iconography(str): style configs
  • skip_sive(bool): enable the SIVE stage
  • token_ind(int): the index of text prompt, from 1
  • result_path(str): the path to save the result
  • multirun(bool): run the script multiple times with different random seeds
  • mv(bool): save the intermediate results of the run and record the video (This increases the run time)

More parameters in ./conf/x/style.yaml, you can modify these parameters from the command line. For example, append x.vpsd.n_particle=4 to the end of the script.

SIVE

Prompt: an astronaut walking across a desert, planet mars in the background, floating beside planets, space art
Preview:

attn-map bg init fg init bg final fg final final

Script:

python svgdreamer.py x=iconography_s1 skip_sive=False "prompt='a man in an astronaut suit walking across a desert, inspired by James Gurney, space art, planet mars in the background, banner, floating beside planets'" token_ind=5 x.vpsd.t_schedule='randint' result_path='./logs/astronaut_sive' multirun=True

VPSD

Iconography style

Prompt: Sydney opera house. oil painting. by Van Gogh
Preview:

Particle 1 Particle 2 Particle 3 Particle 4 Particle 5 Particle 6
init p1 init p2 init p3 init p4 init p5 init p6
final p1 final p2 final p3 final p4 final p5 final p6

Script:

python svgdreamer.py x=iconography "prompt='Sydney opera house. oil painting. by Van Gogh'" result_path='./logs/SydneyOperaHouse-OilPainting'

Painting style

Prompt: Abstract Vincent van Gogh Oil Painting Elephant, featuring earthy tones of green and brown
Preview:

Particle 1 Particle 2 Particle 3 Particle 4 Particle 5 Particle 6
init p1 init p2 init p3 init p4 init p5 init p6
final p1 final p2 final p3 final p4 final p5 final p6

Script:

python svgdreamer.py x=painting "prompt='Abstract Vincent van Gogh Oil Painting Elephant, featuring earthy tones of green and brown.'" x.num_paths=500 result_path='./logs/Elephant-OilPainting'

Pixel-Art style

Prompt: Darth vader with lightsaber
Preview:

Particle 1 Particle 2 Particle 3 Particle 4 Particle 5 Particle 6
init p1 init p2 init p3 init p4 init p5 init p6
final p1 final p2 final p3 final p4 final p5 final p6

Script:

python svgdreamer.py x=pixelart "prompt='Darth vader with lightsaber.'" result_path='./logs/DarthVader'

Other Styles

# Style: low-ploy
python svgdreamer.py x=lowpoly "prompt='A picture of a bald eagle. low-ploy. polygon. minimal flat 2d vector'" neg_prompt='' result_path='./logs/BaldEagle'
# Style: sketch
python svgdreamer.py x=sketch "prompt='A free-hand drawing of A speeding Lamborghini. black and white drawing.'" neg_prompt='' result_path='./logs/Lamborghini'
# Style: ink and wash
python svgdreamer.py x=ink "prompt='Big Wild Goose Pagoda. ink style. Minimalist abstract art grayscale watercolor.'" neg_prompt='' result_path='./logs/BigWildGoosePagoda'

More Cases

# Style: painting
python svgdreamer.py x=painting "prompt='self portrait of Van Gogh. oil painting. cmyk portrait. multi colored. defiant and beautiful. cmyk. expressive eyes.'" result_path='./logs/VanGogh-Portrait'

πŸ”‘ Tips

  • x.vpsd.t_schedule greatly affects the style of the result. Please try more.
  • neg_prompt negative prompts affect the quality of the results.

πŸ“‹ TODO

  • Release the code
  • Add docker image

πŸ“š Acknowledgement

The project is built based on the following repository:

We gratefully thank the authors for their wonderful works.

πŸ“Ž Citation

If you use this code for your research, please cite the following work:

@article{xing2023svgdreamer,
  title={SVGDreamer: Text Guided SVG Generation with Diffusion Model},
  author={Xing, Ximing and Zhou, Haitao and Wang, Chuang and Zhang, Jing and Xu, Dong and Yu, Qian},
  journal={arXiv preprint arXiv:2312.16476},
  year={2023}
}

©️ Licence

This work is licensed under a MIT License.

About

[CVPR 2024] Official implementation for "SVGDreamer: Text Guided SVG Generation with Diffusion Model" https://arxiv.org/abs/2312.16476

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages