feat(readme): delete unused import and add cases
Browse files- README.md +40 -6
- assets/Lowpoly-BaldEagle/init_p0.svg +0 -0
- assets/Lowpoly-BaldEagle/init_p1.svg +0 -0
- assets/Lowpoly-BaldEagle/init_p2.svg +0 -0
- assets/Lowpoly-BaldEagle/init_p3.svg +0 -0
- assets/Lowpoly-BaldEagle/init_p4.svg +0 -0
- assets/Lowpoly-BaldEagle/init_p5.svg +0 -0
- assets/Lowpoly-BaldEagle/p0.svg +0 -0
- assets/Lowpoly-BaldEagle/p1.svg +0 -0
- assets/Lowpoly-BaldEagle/p2.svg +0 -0
- assets/Lowpoly-BaldEagle/p3.svg +0 -0
- assets/Lowpoly-BaldEagle/p4.svg +0 -0
- assets/Lowpoly-BaldEagle/p5.svg +0 -0
- assets/Sketch-Lamborghini/init_p0.svg +70 -0
- assets/Sketch-Lamborghini/init_p1.svg +70 -0
- assets/Sketch-Lamborghini/init_p2.svg +70 -0
- assets/Sketch-Lamborghini/init_p3.svg +70 -0
- assets/Sketch-Lamborghini/init_p4.svg +70 -0
- assets/Sketch-Lamborghini/init_p5.svg +70 -0
- assets/Sketch-Lamborghini/p0.svg +70 -0
- assets/Sketch-Lamborghini/p1.svg +70 -0
- assets/Sketch-Lamborghini/p2.svg +70 -0
- assets/Sketch-Lamborghini/p3.svg +70 -0
- assets/Sketch-Lamborghini/p4.svg +70 -0
- assets/Sketch-Lamborghini/p5.svg +70 -0
- assets/post.md +2 -1
- conf/x/ink.yaml +2 -2
- conf/x/lowpoly.yaml +1 -1
- conf/x/sketch.yaml +1 -1
- svgdreamer/svgtools/__init__.py +0 -2
README.md
CHANGED
@@ -37,9 +37,11 @@ or using docker,
|
|
37 |
docker run --name svgdreamer --gpus all -it --ipc=host ximingxing/svgrender:v1 /bin/bash
|
38 |
```
|
39 |
|
40 |
-
|
|
|
|
|
41 |
|
42 |
-
|
43 |
|
44 |
### SIVE + VPSD
|
45 |
|
@@ -142,15 +144,47 @@ python svgdreamer.py x=painting "prompt='Abstract Vincent van Gogh Oil Painting
|
|
142 |
python svgdreamer.py x=pixelart "prompt='Darth vader with lightsaber.'" result_path='./logs/DarthVader'
|
143 |
```
|
144 |
|
145 |
-
####
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
```shell
|
148 |
-
# Style: low-ploy
|
149 |
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'
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
python svgdreamer.py x=sketch "prompt='A free-hand drawing of A speeding Lamborghini. black and white drawing.'" neg_prompt='' result_path='./logs/Lamborghini'
|
|
|
|
|
|
|
|
|
|
|
152 |
# Style: ink and wash
|
153 |
-
python svgdreamer.py x=ink "prompt='Big Wild Goose Pagoda. ink style. Minimalist abstract art grayscale watercolor.'" neg_prompt='' result_path='./logs/BigWildGoosePagoda'
|
154 |
```
|
155 |
|
156 |
#### More Cases
|
|
|
37 |
docker run --name svgdreamer --gpus all -it --ipc=host ximingxing/svgrender:v1 /bin/bash
|
38 |
```
|
39 |
|
40 |
+
and **download pretrained models** by setting `diffuser.download=True` in `/conf/config.yaml` the first time you run it.
|
41 |
+
|
42 |
+
(Alternatively, you can append `diffuser.download=True` to the end of the script.)
|
43 |
|
44 |
+
## π₯ Quickstart
|
45 |
|
46 |
### SIVE + VPSD
|
47 |
|
|
|
144 |
python svgdreamer.py x=pixelart "prompt='Darth vader with lightsaber.'" result_path='./logs/DarthVader'
|
145 |
```
|
146 |
|
147 |
+
#### Low-poly style
|
148 |
+
|
149 |
+
**Prompt:** A picture of a bald eagle. low-ploy. polygon. minimal flat 2d vector <br/>
|
150 |
+
**Preview:**
|
151 |
+
|
152 |
+
| Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
|
153 |
+
|:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|
|
154 |
+
| init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
|
155 |
+
| <img src="./assets/Lowpoly-BaldEagle/init_p0.svg"> | <img src="./assets/Lowpoly-BaldEagle/init_p1.svg"> | <img src="./assets/Lowpoly-BaldEagle/init_p2.svg"> | <img src="./assets/Lowpoly-BaldEagle/init_p3.svg"> | <img src="./assets/Lowpoly-BaldEagle/init_p4.svg"> | <img src="./assets/Lowpoly-BaldEagle/init_p5.svg"> |
|
156 |
+
| final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
|
157 |
+
| <img src="./assets/Lowpoly-BaldEagle/p0.svg"> | <img src="./assets/Lowpoly-BaldEagle/p1.svg"> | <img src="./assets/Lowpoly-BaldEagle/p2.svg"> | <img src="./assets/Lowpoly-BaldEagle/p3.svg"> | <img src="./assets/Lowpoly-BaldEagle/p4.svg"> | <img src="./assets/Lowpoly-BaldEagle/p5.svg"> |
|
158 |
+
|
159 |
+
**Script:**
|
160 |
|
161 |
```shell
|
|
|
162 |
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'
|
163 |
+
```
|
164 |
+
|
165 |
+
#### sketch style
|
166 |
+
|
167 |
+
**Prompt:** A free-hand drawing of A speeding Lamborghini. black and white drawing. <br/>
|
168 |
+
**Preview:**
|
169 |
+
|
170 |
+
| Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
|
171 |
+
|:---------------------------------------------------:|:---------------------------------------------------:|:---------------------------------------------------:|:---------------------------------------------------:|:---------------------------------------------------:|:---------------------------------------------------:|
|
172 |
+
| init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
|
173 |
+
| <img src="./assets/Sketch-Lamborghini/init_p0.svg"> | <img src="./assets/Sketch-Lamborghini/init_p1.svg"> | <img src="./assets/Sketch-Lamborghini/init_p2.svg"> | <img src="./assets/Sketch-Lamborghini/init_p3.svg"> | <img src="./assets/Sketch-Lamborghini/init_p4.svg"> | <img src="./assets/Sketch-Lamborghini/init_p5.svg"> |
|
174 |
+
| final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
|
175 |
+
| <img src="./assets/Sketch-Lamborghini/p0.svg"> | <img src="./assets/Sketch-Lamborghini/p1.svg"> | <img src="./assets/Sketch-Lamborghini/p2.svg"> | <img src="./assets/Sketch-Lamborghini/p3.svg"> | <img src="./assets/Sketch-Lamborghini/p4.svg"> | <img src="./assets/Sketch-Lamborghini/p5.svg"> |
|
176 |
+
|
177 |
+
**Script:**
|
178 |
+
|
179 |
+
```shell
|
180 |
python svgdreamer.py x=sketch "prompt='A free-hand drawing of A speeding Lamborghini. black and white drawing.'" neg_prompt='' result_path='./logs/Lamborghini'
|
181 |
+
```
|
182 |
+
|
183 |
+
#### Other Styles
|
184 |
+
|
185 |
+
```shell
|
186 |
# Style: ink and wash
|
187 |
+
python svgdreamer.py x=ink "prompt='Big Wild Goose Pagoda. ink style. Minimalist abstract art grayscale watercolor. empty background'" neg_prompt='' result_path='./logs/BigWildGoosePagoda'
|
188 |
```
|
189 |
|
190 |
#### More Cases
|
assets/Lowpoly-BaldEagle/init_p0.svg
ADDED
|
assets/Lowpoly-BaldEagle/init_p1.svg
ADDED
|
assets/Lowpoly-BaldEagle/init_p2.svg
ADDED
|
assets/Lowpoly-BaldEagle/init_p3.svg
ADDED
|
assets/Lowpoly-BaldEagle/init_p4.svg
ADDED
|
assets/Lowpoly-BaldEagle/init_p5.svg
ADDED
|
assets/Lowpoly-BaldEagle/p0.svg
ADDED
|
assets/Lowpoly-BaldEagle/p1.svg
ADDED
|
assets/Lowpoly-BaldEagle/p2.svg
ADDED
|
assets/Lowpoly-BaldEagle/p3.svg
ADDED
|
assets/Lowpoly-BaldEagle/p4.svg
ADDED
|
assets/Lowpoly-BaldEagle/p5.svg
ADDED
|
assets/Sketch-Lamborghini/init_p0.svg
ADDED
|
assets/Sketch-Lamborghini/init_p1.svg
ADDED
|
assets/Sketch-Lamborghini/init_p2.svg
ADDED
|
assets/Sketch-Lamborghini/init_p3.svg
ADDED
|
assets/Sketch-Lamborghini/init_p4.svg
ADDED
|
assets/Sketch-Lamborghini/init_p5.svg
ADDED
|
assets/Sketch-Lamborghini/p0.svg
ADDED
|
assets/Sketch-Lamborghini/p1.svg
ADDED
|
assets/Sketch-Lamborghini/p2.svg
ADDED
|
assets/Sketch-Lamborghini/p3.svg
ADDED
|
assets/Sketch-Lamborghini/p4.svg
ADDED
|
assets/Sketch-Lamborghini/p5.svg
ADDED
|
assets/post.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
π New Research Alert - CVPR 2024! π
|
2 |
π Title: "SVGDreamer: Text-Guided SVG Generation with Diffusion Model"
|
3 |
-
π
|
|
|
4 |
π₯ Authors: [Ximing Xing](https://ximinng.github.io/), Haitao Zhou, Chuang Wang, [Jing zhang](https://hellojing89.github.io/), [Dong Xu](https://www.cs.hku.hk/index.php/people/academic-staff/dongxu), and [Qian Yu](https://yuqian1023.github.io/)
|
5 |
π
Conference: CVPR, Jun 17-21, 2024 | Seattle WA, USA πΊπΈ
|
6 |
π Keywords: #SVGDreamer #Text-to-SVG #SVG #Diffusion #CVPR2024
|
|
|
1 |
π New Research Alert - CVPR 2024! π
|
2 |
π Title: "SVGDreamer: Text-Guided SVG Generation with Diffusion Model"
|
3 |
+
π TL;DR: Given a text prompt, SVGDreamer can generate editable and versatile high-fidelity vector graphics.
|
4 |
+
π Description: In this work, the author has introduced SVGDreamer, an innovative model for text-guided vector graphics synthesis. SVGDreamer incorporates two crucial technical designs: semantic-driven image vectorization (SIVE) and vectorized particle-based score distillation (VPSD), which empower our model to generate vector graphics with high editability, superior visual quality, and notable diversity.
|
5 |
π₯ Authors: [Ximing Xing](https://ximinng.github.io/), Haitao Zhou, Chuang Wang, [Jing zhang](https://hellojing89.github.io/), [Dong Xu](https://www.cs.hku.hk/index.php/people/academic-staff/dongxu), and [Qian Yu](https://yuqian1023.github.io/)
|
6 |
π
Conference: CVPR, Jun 17-21, 2024 | Seattle WA, USA πΊπΈ
|
7 |
π Keywords: #SVGDreamer #Text-to-SVG #SVG #Diffusion #CVPR2024
|
conf/x/ink.yaml
CHANGED
@@ -84,7 +84,7 @@ sive:
|
|
84 |
num_iter: 10
|
85 |
|
86 |
# VPSD primitives
|
87 |
-
num_paths:
|
88 |
trainable_bg: False # set the background to be trainable
|
89 |
width: 6 # stroke width
|
90 |
num_segments: 4
|
@@ -142,7 +142,7 @@ vpsd:
|
|
142 |
t_range: [ 0.02, 0.98 ]
|
143 |
# 'randint': random time steps, this may have a more authentic style.
|
144 |
# 'max_0.5_900': annealing from 0.98 to 0.5 after 900 steps, this may have a more colorful results.
|
145 |
-
t_schedule: '
|
146 |
# phi model config
|
147 |
phi_single: False # if False new an unet model to estimate noise
|
148 |
phi_model: 'lora' # 'lora', 'unet_simple'
|
|
|
84 |
num_iter: 10
|
85 |
|
86 |
# VPSD primitives
|
87 |
+
num_paths: 84 # number of strokes
|
88 |
trainable_bg: False # set the background to be trainable
|
89 |
width: 6 # stroke width
|
90 |
num_segments: 4
|
|
|
142 |
t_range: [ 0.02, 0.98 ]
|
143 |
# 'randint': random time steps, this may have a more authentic style.
|
144 |
# 'max_0.5_900': annealing from 0.98 to 0.5 after 900 steps, this may have a more colorful results.
|
145 |
+
t_schedule: 'max_0.5_1000' # or 'randint'
|
146 |
# phi model config
|
147 |
phi_single: False # if False new an unet model to estimate noise
|
148 |
phi_model: 'lora' # 'lora', 'unet_simple'
|
conf/x/lowpoly.yaml
CHANGED
@@ -135,7 +135,7 @@ vpsd:
|
|
135 |
n_particle: 6 # 4, 8, 16
|
136 |
vsd_n_particle: 4 # the batch size of particles
|
137 |
particle_aug: False # do data enhancement for the input particles
|
138 |
-
num_iter:
|
139 |
guidance_scale: 7.5 # CFG value
|
140 |
grad_scale: 1.0 # increase or decrease the gradient
|
141 |
grad_clip_val: ~ # eg: 10, clip the gradient of VPSD
|
|
|
135 |
n_particle: 6 # 4, 8, 16
|
136 |
vsd_n_particle: 4 # the batch size of particles
|
137 |
particle_aug: False # do data enhancement for the input particles
|
138 |
+
num_iter: 2000 # total iterations
|
139 |
guidance_scale: 7.5 # CFG value
|
140 |
grad_scale: 1.0 # increase or decrease the gradient
|
141 |
grad_clip_val: ~ # eg: 10, clip the gradient of VPSD
|
conf/x/sketch.yaml
CHANGED
@@ -142,7 +142,7 @@ vpsd:
|
|
142 |
t_range: [ 0.02, 0.98 ]
|
143 |
# 'randint': random time steps, this may have a more authentic style.
|
144 |
# 'max_0.5_900': annealing from 0.98 to 0.5 after 900 steps, this may have a more colorful results.
|
145 |
-
t_schedule: '
|
146 |
# phi model config
|
147 |
phi_single: False # if False new an unet model to estimate noise
|
148 |
phi_model: 'lora' # 'lora', 'unet_simple'
|
|
|
142 |
t_range: [ 0.02, 0.98 ]
|
143 |
# 'randint': random time steps, this may have a more authentic style.
|
144 |
# 'max_0.5_900': annealing from 0.98 to 0.5 after 900 steps, this may have a more colorful results.
|
145 |
+
t_schedule: 'max_0.5_1300' # or 'randint'
|
146 |
# phi model config
|
147 |
phi_single: False # if False new an unet model to estimate noise
|
148 |
phi_model: 'lora' # 'lora', 'unet_simple'
|
svgdreamer/svgtools/__init__.py
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
# Copyright (c) 2023, XiMing Xing.
|
4 |
# License: MIT License
|
5 |
|
6 |
-
#from .tff import FONT_LIST
|
7 |
from .type import is_valid_svg
|
8 |
from .merge import merge_svg_files
|
9 |
from .process import delete_empty_path, add_def_tag
|
@@ -11,6 +10,5 @@ from .process import delete_empty_path, add_def_tag
|
|
11 |
__all__ = [
|
12 |
'is_valid_svg',
|
13 |
'merge_svg_files',
|
14 |
-
# 'FONT_LIST',
|
15 |
'delete_empty_path', 'add_def_tag'
|
16 |
]
|
|
|
3 |
# Copyright (c) 2023, XiMing Xing.
|
4 |
# License: MIT License
|
5 |
|
|
|
6 |
from .type import is_valid_svg
|
7 |
from .merge import merge_svg_files
|
8 |
from .process import delete_empty_path, add_def_tag
|
|
|
10 |
__all__ = [
|
11 |
'is_valid_svg',
|
12 |
'merge_svg_files',
|
|
|
13 |
'delete_empty_path', 'add_def_tag'
|
14 |
]
|