feat(case): add more cases
Browse files- Examples.md +58 -0
- README.md +2 -9
- assets/Lowploy-Wolf/finetune_final_p0.svg +0 -0
- assets/Lowploy-Wolf/finetune_final_p1.svg +0 -0
- assets/Lowploy-Wolf/finetune_final_p2.svg +0 -0
- assets/Lowploy-Wolf/finetune_final_p3.svg +0 -0
- assets/Lowploy-Wolf/finetune_final_p4.svg +0 -0
- assets/Lowploy-Wolf/finetune_final_p5.svg +0 -0
- assets/Lowpoly-PolarBear/finetune_final_p0.svg +0 -0
- assets/Lowpoly-PolarBear/finetune_final_p1.svg +0 -0
- assets/Lowpoly-PolarBear/finetune_final_p2.svg +0 -0
- assets/Lowpoly-PolarBear/finetune_final_p3.svg +0 -0
- assets/Lowpoly-PolarBear/finetune_final_p4.svg +0 -0
- assets/Lowpoly-PolarBear/finetune_final_p5.svg +0 -0
- assets/Lowpoly-ScarletMacaw/finetune_final_p0.svg +0 -0
- assets/Lowpoly-ScarletMacaw/finetune_final_p1.svg +0 -0
- assets/Lowpoly-ScarletMacaw/finetune_final_p2.svg +0 -0
- assets/Lowpoly-ScarletMacaw/finetune_final_p3.svg +0 -0
- assets/Lowpoly-ScarletMacaw/finetune_final_p4.svg +0 -0
- assets/Lowpoly-ScarletMacaw/finetune_final_p5.svg +0 -0
- conf/x/ink.yaml +2 -2
- conf/x/painting.yaml +2 -2
- conf/x/sketch.yaml +2 -2
- svgdreamer/painter/component_painter_params.py +2 -2
- svgdreamer/pipelines/SVGDreamer_pipeline.py +2 -0
Examples.md
CHANGED
|
@@ -31,3 +31,61 @@ python svgdreamer.py x=iconography "prompt='A colorful German shepherd in vector
|
|
| 31 |
```shell
|
| 32 |
python svgdreamer.py x=iconography "prompt='a beautiful snow-covered castle, a stunning masterpiece, trees, rays of the sun, Leonid Afremov'" result_path='./logs/SnowCastle' seed=116740
|
| 33 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
```shell
|
| 32 |
python svgdreamer.py x=iconography "prompt='a beautiful snow-covered castle, a stunning masterpiece, trees, rays of the sun, Leonid Afremov'" result_path='./logs/SnowCastle' seed=116740
|
| 33 |
```
|
| 34 |
+
|
| 35 |
+
### Case: Vector Wolf
|
| 36 |
+
|
| 37 |
+
**Prompt:** wolf. low poly. minimal flat 2d vector. lineal color. trending on artstation. <br/>
|
| 38 |
+
**style:** Low-Poly <br/>
|
| 39 |
+
**Preview:**
|
| 40 |
+
|
| 41 |
+
| Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
|
| 42 |
+
|:-------------------------------------------------------:|:-------------------------------------------------------:|:-------------------------------------------------------:|:-----------------------------------------------------:|:-------------------------------------------------------:|:-------------------------------------------------------:|
|
| 43 |
+
| <img src="./assets/Lowploy-Wolf/finetune_final_p0.svg"> | <img src="./assets/Lowploy-Wolf/finetune_final_p1.svg"> | <img src="./assets/Lowploy-Wolf/finetune_final_p2.svg"> | <img src="assets/Lowploy-Wolf/finetune_final_p3.svg"> | <img src="./assets/Lowploy-Wolf/finetune_final_p4.svg"> | <img src="./assets/Lowploy-Wolf/finetune_final_p5.svg"> |
|
| 44 |
+
|
| 45 |
+
**Script:**
|
| 46 |
+
|
| 47 |
+
```shell
|
| 48 |
+
python svgdreamer.py x=lowpoly "prompt='wolf. low poly. minimal flat 2d vector. lineal color. trending on artstation.'" neg_prompt='' result_path='./logs/Wolf' seed=670488
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
### Case: Scarlet Macaw
|
| 52 |
+
|
| 53 |
+
**Prompt:** A picture of a scarlet macaw, low-ploy, polygon, minimal flat 2d vector <br/>
|
| 54 |
+
**style:** Low-Poly <br/>
|
| 55 |
+
**Preview:**
|
| 56 |
+
|
| 57 |
+
| Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
|
| 58 |
+
|:---------------------------------------------------------------:|:---------------------------------------------------------------:|:---------------------------------------------------------------:|:-------------------------------------------------------------:|:---------------------------------------------------------------:|:---------------------------------------------------------------:|
|
| 59 |
+
| <img src="./assets/Lowpoly-ScarletMacaw/finetune_final_p0.svg"> | <img src="./assets/Lowpoly-ScarletMacaw/finetune_final_p1.svg"> | <img src="./assets/Lowpoly-ScarletMacaw/finetune_final_p2.svg"> | <img src="assets/Lowpoly-ScarletMacaw/finetune_final_p3.svg"> | <img src="./assets/Lowpoly-ScarletMacaw/finetune_final_p4.svg"> | <img src="./assets/Lowpoly-ScarletMacaw/finetune_final_p5.svg"> |
|
| 60 |
+
|
| 61 |
+
**Script:**
|
| 62 |
+
|
| 63 |
+
```shell
|
| 64 |
+
python svgdreamer.py x=lowpoly "prompt='A picture of a scarlet macaw, low-ploy, polygon, minimal flat 2d vector'" "neg_prompt='unrealistic, blurry, low quality, out of focus, ugly, low contrast, dull, low res, low-resolution, oversaturation, worst quality, normal quality, text, watermark, logo, banner, extra digits, cropped, jpeg artifacts, signature, username, error, sketch ,duplicate, monochrome, horror, geometry, mutation, disgusting'" save_step=50 result_path='.log/ScarletMacaw'
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
### Case: Polar Bear
|
| 68 |
+
|
| 69 |
+
**Prompt:** polar bear. low poly. minimal flat 2d vector. lineal color. trending on artstation. <br/>
|
| 70 |
+
**style:** Low-Poly <br/>
|
| 71 |
+
**Preview:**
|
| 72 |
+
|
| 73 |
+
| Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
|
| 74 |
+
|:------------------------------------------------------------:|:------------------------------------------------------------:|:------------------------------------------------------------:|:----------------------------------------------------------:|:------------------------------------------------------------:|:------------------------------------------------------------:|
|
| 75 |
+
| <img src="./assets/Lowpoly-PolarBear/finetune_final_p0.svg"> | <img src="./assets/Lowpoly-PolarBear/finetune_final_p1.svg"> | <img src="./assets/Lowpoly-PolarBear/finetune_final_p2.svg"> | <img src="assets/Lowpoly-PolarBear/finetune_final_p3.svg"> | <img src="./assets/Lowpoly-PolarBear/finetune_final_p4.svg"> | <img src="./assets/Lowpoly-PolarBear/finetune_final_p5.svg"> |
|
| 76 |
+
|
| 77 |
+
**Script:**
|
| 78 |
+
|
| 79 |
+
```shell
|
| 80 |
+
python svgdreamer.py x=lowpoly "prompt='polar bear. low poly. minimal flat 2d vector. lineal color. trending on artstation.'" "neg_prompt='unrealistic, blurry, low quality, out of focus, ugly, low contrast, dull, low res, low-resolution, oversaturation, worst quality, normal quality, text, watermark, logo, banner, extra digits, cropped, jpeg artifacts, signature, username, error, sketch ,duplicate, monochrome, horror, geometry, mutation, disgusting'" save_step=50 result_path='.log/PolarBear'
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
### Others
|
| 84 |
+
|
| 85 |
+
````shell
|
| 86 |
+
python svgdreamer.py x=painting "prompt='self portrait of Van Gogh. oil painting. cmyk portrait. multi colored. defiant and beautiful. cmyk. expressive eyes.'" x.num_paths=256 result_path='./logs/VanGogh-Portrait'
|
| 87 |
+
python svgdreamer.py x=lowpoly "prompt='A picture of a scarlet macaw, low-ploy, polygon, minimal flat 2d vector'" "neg_prompt='unrealistic, blurry, low quality, out of focus, ugly, low contrast, dull, low res, low-resolution, oversaturation, worst quality, normal quality, text, watermark, logo, banner, extra digits, cropped, jpeg artifacts, signature, username, error, sketch ,duplicate, monochrome, horror, geometry, mutation, disgusting'" save_step=50 result_path='.log/ScarletMacaw' mv=True multirun=True
|
| 88 |
+
python svgdreamer.py x=ink "prompt='Big Wild Goose Pagoda. ink style. Minimalist abstract art grayscale watercolor. simple painting style'" "neg_prompt='text, extra, missing, unfinished, watermark, signature, username, scan, frame'" result_path='./logs/BigWildGoosePagoda'
|
| 89 |
+
python svgdreamer.py x=ink "prompt='Black and white. simple horse flash tattoo. ink style. Minimalist abstract art grayscale watercolor. simple painting style'" "neg_prompt='text, extra, missing, unfinished, watermark, signature, username, scan, frame'" result_path='./logs/HorseInk'
|
| 90 |
+
python svgdreamer.py x=pixelart "prompt='Pikachu in pastel colors, childish and fun. Pixel art. trending on artstation.'" x.guidance.t_schedule='randint' result_path='./logs/Pikachu'
|
| 91 |
+
````
|
README.md
CHANGED
|
@@ -134,7 +134,7 @@ python svgdreamer.py x=iconography "prompt='Sydney opera house. oil painting. by
|
|
| 134 |
**Script:**
|
| 135 |
|
| 136 |
```shell
|
| 137 |
-
python svgdreamer.py x=painting "prompt='Abstract Vincent van Gogh Oil Painting Elephant, featuring earthy tones of green and brown.'" x.num_paths=
|
| 138 |
```
|
| 139 |
|
| 140 |
#### Pixel-Art style
|
|
@@ -211,14 +211,7 @@ python svgdreamer.py x=ink "prompt='Big Wild Goose Pagoda. ink style. Minimalist
|
|
| 211 |
|
| 212 |
#### More Cases
|
| 213 |
|
| 214 |
-
|
| 215 |
-
python svgdreamer.py x=iconography "prompt='illustration of an New York City, in vector art, tending on artstation.'" result_path='./logs/NewYorkCity'
|
| 216 |
-
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'
|
| 217 |
-
python svgdreamer.py x=lowpoly "prompt='wolf. low poly. minimal flat 2d vector. lineal color. trending on artstation.'" neg_prompt='' save_step=50 x.grid=30 result_path='./logs/Wolf' multirun=True
|
| 218 |
-
python svgdreamer.py x=lowpoly "prompt='A picture of a scarlet macaw, low-ploy, polygon, minimal flat 2d vector'" "neg_prompt='unrealistic, blurry, low quality, out of focus, ugly, low contrast, dull, low res, low-resolution, oversaturation, worst quality, normal quality, text, watermark, logo, banner, extra digits, cropped, jpeg artifacts, signature, username, error, sketch ,duplicate, monochrome, horror, geometry, mutation, disgusting'" save_step=50 result_path='.log/ScarletMacaw' mv=True multirun=True
|
| 219 |
-
python svgdreamer.py x=ink "prompt='The lonely Big Wild Goose Pagoda. ink style. Minimalist abstract art grayscale watercolor.'" "neg_prompt='text, extra, missing, unfinished, watermark, signature, username, scan, frame'" result_path='./logs/BigWildGoosePagoda'
|
| 220 |
-
python svgdreamer.py x=ink "prompt='Big Wild Goose Pagoda. ink style. Minimalist abstract art grayscale watercolor. simple painting style'" "neg_prompt='text, extra, missing, unfinished, watermark, signature, username, scan, frame'" result_path='./logs/BigWildGoosePagoda'
|
| 221 |
-
````
|
| 222 |
|
| 223 |
## 🔑 Tips
|
| 224 |
|
|
|
|
| 134 |
**Script:**
|
| 135 |
|
| 136 |
```shell
|
| 137 |
+
python svgdreamer.py x=painting "prompt='Abstract Vincent van Gogh Oil Painting Elephant, featuring earthy tones of green and brown.'" x.num_paths=256 result_path='./logs/Elephant-OilPainting'
|
| 138 |
```
|
| 139 |
|
| 140 |
#### Pixel-Art style
|
|
|
|
| 211 |
|
| 212 |
#### More Cases
|
| 213 |
|
| 214 |
+
**See [Examples.md](https://github.com/ximinng/DiffSketcher/blob/main/Examples.md) for more cases.**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
|
| 216 |
## 🔑 Tips
|
| 217 |
|
assets/Lowploy-Wolf/finetune_final_p0.svg
ADDED
|
|
assets/Lowploy-Wolf/finetune_final_p1.svg
ADDED
|
|
assets/Lowploy-Wolf/finetune_final_p2.svg
ADDED
|
|
assets/Lowploy-Wolf/finetune_final_p3.svg
ADDED
|
|
assets/Lowploy-Wolf/finetune_final_p4.svg
ADDED
|
|
assets/Lowploy-Wolf/finetune_final_p5.svg
ADDED
|
|
assets/Lowpoly-PolarBear/finetune_final_p0.svg
ADDED
|
|
assets/Lowpoly-PolarBear/finetune_final_p1.svg
ADDED
|
|
assets/Lowpoly-PolarBear/finetune_final_p2.svg
ADDED
|
|
assets/Lowpoly-PolarBear/finetune_final_p3.svg
ADDED
|
|
assets/Lowpoly-PolarBear/finetune_final_p4.svg
ADDED
|
|
assets/Lowpoly-PolarBear/finetune_final_p5.svg
ADDED
|
|
assets/Lowpoly-ScarletMacaw/finetune_final_p0.svg
ADDED
|
|
assets/Lowpoly-ScarletMacaw/finetune_final_p1.svg
ADDED
|
|
assets/Lowpoly-ScarletMacaw/finetune_final_p2.svg
ADDED
|
|
assets/Lowpoly-ScarletMacaw/finetune_final_p3.svg
ADDED
|
|
assets/Lowpoly-ScarletMacaw/finetune_final_p4.svg
ADDED
|
|
assets/Lowpoly-ScarletMacaw/finetune_final_p5.svg
ADDED
|
|
conf/x/ink.yaml
CHANGED
|
@@ -40,7 +40,7 @@ sive:
|
|
| 40 |
attn_coeff: 1.0 # attn fusion, w * cross-attn + (1-w) * self-attn
|
| 41 |
mask_tau: 0.3 # the threshold used to convert the attention map into a mask
|
| 42 |
bg:
|
| 43 |
-
style: "
|
| 44 |
num_iter: 10
|
| 45 |
num_paths: 256
|
| 46 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
@@ -60,7 +60,7 @@ sive:
|
|
| 60 |
use_distance_weighted_loss: False
|
| 61 |
xing_loss_weight: 0.001
|
| 62 |
fg:
|
| 63 |
-
style: "
|
| 64 |
num_iter: 10
|
| 65 |
num_paths: 256 # number of strokes
|
| 66 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
|
|
| 40 |
attn_coeff: 1.0 # attn fusion, w * cross-attn + (1-w) * self-attn
|
| 41 |
mask_tau: 0.3 # the threshold used to convert the attention map into a mask
|
| 42 |
bg:
|
| 43 |
+
style: "ink" # 'iconography' ,"pixelart", "sketch", 'painting', 'ink'
|
| 44 |
num_iter: 10
|
| 45 |
num_paths: 256
|
| 46 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
|
|
| 60 |
use_distance_weighted_loss: False
|
| 61 |
xing_loss_weight: 0.001
|
| 62 |
fg:
|
| 63 |
+
style: "ink" # 'iconography' ,"pixelart", "sketch", 'painting', 'ink'
|
| 64 |
num_iter: 10
|
| 65 |
num_paths: 256 # number of strokes
|
| 66 |
path_schedule: 'repeat' # 'repeat', 'list'
|
conf/x/painting.yaml
CHANGED
|
@@ -40,7 +40,7 @@ sive:
|
|
| 40 |
attn_coeff: 1.0 # attn fusion, w * cross-attn + (1-w) * self-attn
|
| 41 |
mask_tau: 0.3 # the threshold used to convert the attention map into a mask
|
| 42 |
bg:
|
| 43 |
-
style: "
|
| 44 |
num_iter: 10
|
| 45 |
num_paths: 256
|
| 46 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
@@ -60,7 +60,7 @@ sive:
|
|
| 60 |
use_distance_weighted_loss: False
|
| 61 |
xing_loss_weight: 0.001
|
| 62 |
fg:
|
| 63 |
-
style: "
|
| 64 |
num_iter: 10
|
| 65 |
num_paths: 256 # number of strokes
|
| 66 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
|
|
| 40 |
attn_coeff: 1.0 # attn fusion, w * cross-attn + (1-w) * self-attn
|
| 41 |
mask_tau: 0.3 # the threshold used to convert the attention map into a mask
|
| 42 |
bg:
|
| 43 |
+
style: "painting" # 'iconography' ,"pixelart", "sketch", 'painting', 'ink'
|
| 44 |
num_iter: 10
|
| 45 |
num_paths: 256
|
| 46 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
|
|
| 60 |
use_distance_weighted_loss: False
|
| 61 |
xing_loss_weight: 0.001
|
| 62 |
fg:
|
| 63 |
+
style: "painting" # 'iconography' ,"pixelart", "sketch", 'painting', 'ink'
|
| 64 |
num_iter: 10
|
| 65 |
num_paths: 256 # number of strokes
|
| 66 |
path_schedule: 'repeat' # 'repeat', 'list'
|
conf/x/sketch.yaml
CHANGED
|
@@ -40,7 +40,7 @@ sive:
|
|
| 40 |
attn_coeff: 1.0 # attn fusion, w * cross-attn + (1-w) * self-attn
|
| 41 |
mask_tau: 0.3 # the threshold used to convert the attention map into a mask
|
| 42 |
bg:
|
| 43 |
-
style: "
|
| 44 |
num_iter: 10
|
| 45 |
num_paths: 256
|
| 46 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
@@ -60,7 +60,7 @@ sive:
|
|
| 60 |
use_distance_weighted_loss: False
|
| 61 |
xing_loss_weight: 0.001
|
| 62 |
fg:
|
| 63 |
-
style: "
|
| 64 |
num_iter: 10
|
| 65 |
num_paths: 256 # number of strokes
|
| 66 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
|
|
| 40 |
attn_coeff: 1.0 # attn fusion, w * cross-attn + (1-w) * self-attn
|
| 41 |
mask_tau: 0.3 # the threshold used to convert the attention map into a mask
|
| 42 |
bg:
|
| 43 |
+
style: "sketch" # 'iconography' ,"pixelart", "sketch", 'painting', 'ink'
|
| 44 |
num_iter: 10
|
| 45 |
num_paths: 256
|
| 46 |
path_schedule: 'repeat' # 'repeat', 'list'
|
|
|
|
| 60 |
use_distance_weighted_loss: False
|
| 61 |
xing_loss_weight: 0.001
|
| 62 |
fg:
|
| 63 |
+
style: "sketch" # 'iconography' ,"pixelart", "sketch", 'painting', 'ink'
|
| 64 |
num_iter: 10
|
| 65 |
num_paths: 256 # number of strokes
|
| 66 |
path_schedule: 'repeat' # 'repeat', 'list'
|
svgdreamer/painter/component_painter_params.py
CHANGED
|
@@ -161,7 +161,7 @@ class CompPainter:
|
|
| 161 |
self.shape_groups.append(path_group)
|
| 162 |
self.cur_shape_groups.append(path_group)
|
| 163 |
|
| 164 |
-
elif self.style
|
| 165 |
fill_color_init = torch.FloatTensor(np.random.uniform(size=[4]))
|
| 166 |
fill_color_init[-1] = 1.0
|
| 167 |
|
|
@@ -178,7 +178,7 @@ class CompPainter:
|
|
| 178 |
self.shape_groups.append(path_group)
|
| 179 |
self.cur_shape_groups.append(path_group)
|
| 180 |
|
| 181 |
-
elif self.style
|
| 182 |
path = self.get_path()
|
| 183 |
self.shapes.append(path)
|
| 184 |
self.cur_shapes.append(path)
|
|
|
|
| 161 |
self.shape_groups.append(path_group)
|
| 162 |
self.cur_shape_groups.append(path_group)
|
| 163 |
|
| 164 |
+
elif self.style in ['pixelart', 'low-poly']:
|
| 165 |
fill_color_init = torch.FloatTensor(np.random.uniform(size=[4]))
|
| 166 |
fill_color_init[-1] = 1.0
|
| 167 |
|
|
|
|
| 178 |
self.shape_groups.append(path_group)
|
| 179 |
self.cur_shape_groups.append(path_group)
|
| 180 |
|
| 181 |
+
elif self.style in ['sketch', 'ink']:
|
| 182 |
path = self.get_path()
|
| 183 |
self.shapes.append(path)
|
| 184 |
self.cur_shapes.append(path)
|
svgdreamer/pipelines/SVGDreamer_pipeline.py
CHANGED
|
@@ -35,7 +35,9 @@ import ImageReward as RM
|
|
| 35 |
class SVGDreamerPipeline(ModelState):
|
| 36 |
|
| 37 |
def __init__(self, args):
|
|
|
|
| 38 |
assert args.x.style in ["iconography", "pixelart", "low-poly", "painting", "sketch", "ink"]
|
|
|
|
| 39 |
assert args.x.vpsd.n_particle >= args.x.vpsd.vsd_n_particle
|
| 40 |
assert args.x.vpsd.n_particle >= args.x.vpsd.phi_n_particle
|
| 41 |
assert args.x.vpsd.n_phi_sample >= 1
|
|
|
|
| 35 |
class SVGDreamerPipeline(ModelState):
|
| 36 |
|
| 37 |
def __init__(self, args):
|
| 38 |
+
# assert
|
| 39 |
assert args.x.style in ["iconography", "pixelart", "low-poly", "painting", "sketch", "ink"]
|
| 40 |
+
args.skip_sive = True if args.x.style in ["pixelart", "low-poly"] else args.skip_sive
|
| 41 |
assert args.x.vpsd.n_particle >= args.x.vpsd.vsd_n_particle
|
| 42 |
assert args.x.vpsd.n_particle >= args.x.vpsd.phi_n_particle
|
| 43 |
assert args.x.vpsd.n_phi_sample >= 1
|