xingxm commited on
Commit
292a2a2
·
1 Parent(s): 8c92c01

feat(readme): add more cases

Browse files
README.md CHANGED
@@ -43,8 +43,17 @@ Before running the code, download the stable diffusion model. Append `diffuser.d
43
 
44
  ### SIVE + VPSD
45
 
46
- **Prompt:** An image of Batman. full body action pose, complete detailed body. white background. empty background, high
47
- quality, 4K, ultra realistic <br/>
 
 
 
 
 
 
 
 
 
48
  **Script:**
49
 
50
  ```shell
@@ -63,14 +72,14 @@ append `x.vpsd.n_particle=4` to the end of the script.
63
 
64
  ### SIVE
65
 
66
- **Prompt:** an astronaut walking across a desert, planet mars in the background, floating beside planets, space art <br/>
 
67
  **Preview:**
68
 
69
- | attn-map | bg init | fg init | bg final | fg final | final |
70
- |------------------------------------------------|---------------------------------------------------|---------------------------------------------------|----------------------------------------------------|----------------------------------------------------|--------------------------------------------------|
71
  | <img src="./assets/SIVE-astronaut-1/attn.png"> | <img src="./assets/SIVE-astronaut-1/init_bg.svg"> | <img src="./assets/SIVE-astronaut-1/init_fg.svg"> | <img src="./assets/SIVE-astronaut-1/final_bg.svg"> | <img src="./assets/SIVE-astronaut-1/final_fg.svg"> | <img src="./assets/SIVE-astronaut-1/result.svg"> |
72
 
73
-
74
  **Script:**
75
 
76
  ```shell
@@ -84,12 +93,12 @@ python svgdreamer.py x=iconography_s1 skip_sive=False "prompt='a man in an astro
84
  **Prompt:** Sydney opera house. oil painting. by Van Gogh <br/>
85
  **Preview:**
86
 
87
- | Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
88
- |--------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|
89
- | init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
90
  | <img src="./assets/Icon-SydneyOperaHouse/init_p0.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p1.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p2.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p3.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p4.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p5.svg"> |
91
- | final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
92
- | <img src="./assets/Icon-SydneyOperaHouse/p_0.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_1.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_2.svg"> | <img src="assets/Icon-SydneyOperaHouse/p_3.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_4.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_5.svg"> |
93
 
94
  **Script:**
95
 
@@ -102,12 +111,12 @@ python svgdreamer.py x=iconography "prompt='Sydney opera house. oil painting. by
102
  **Prompt:** Abstract Vincent van Gogh Oil Painting Elephant, featuring earthy tones of green and brown <br/>
103
  **Preview:**
104
 
105
- | Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
106
- |----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|
107
- | init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
108
  | <img src="./assets/Painting-Elephant/init_p0.svg"> | <img src="./assets/Painting-Elephant/init_p1.svg"> | <img src="./assets/Painting-Elephant/init_p2.svg"> | <img src="./assets/Painting-Elephant/init_p3.svg"> | <img src="./assets/Painting-Elephant/init_p4.svg"> | <img src="./assets/Painting-Elephant/init_p5.svg"> |
109
- | final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
110
- | <img src="./assets/Painting-Elephant/p_0.svg"> | <img src="./assets/Painting-Elephant/p_1.svg"> | <img src="./assets/Painting-Elephant/p_2.svg"> | <img src="./assets/Painting-Elephant/p_3.svg"> | <img src="./assets/Painting-Elephant/p_4.svg"> | <img src="./assets/Painting-Elephant/p_5.svg"> |
111
 
112
  **Script:**
113
 
@@ -120,12 +129,12 @@ python svgdreamer.py x=painting "prompt='Abstract Vincent van Gogh Oil Painting
120
  **Prompt:** Darth vader with lightsaber <br/>
121
  **Preview:**
122
 
123
- | Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
124
- |------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|
125
- | init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
126
  | <img src="./assets/Pixelart-DarthVader/init_p0.svg"> | <img src="./assets/Pixelart-DarthVader/init_p1.svg"> | <img src="./assets/Pixelart-DarthVader/init_p2.svg"> | <img src="./assets/Pixelart-DarthVader/init_p3.svg"> | <img src="./assets/Pixelart-DarthVader/init_p4.svg"> | <img src="./assets/Pixelart-DarthVader/init_p5.svg"> |
127
- | final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
128
- | <img src="./assets/Pixelart-DarthVader/p0.svg"> | <img src="./assets/Pixelart-DarthVader/p1.svg"> | <img src="./assets/Pixelart-DarthVader/p2.svg"> | <img src="./assets/Pixelart-DarthVader/p3.svg"> | <img src="./assets/Pixelart-DarthVader/p4.svg"> | <img src="./assets/Pixelart-DarthVader/p5.svg"> |
129
 
130
  **Script:**
131
 
@@ -142,9 +151,14 @@ python svgdreamer.py x=lowpoly "prompt='A picture of a bald eagle. low-ploy. pol
142
  python svgdreamer.py x=sketch "prompt='A free-hand drawing of A speeding Lamborghini. black and white drawing.'" result_path='./logs/Lamborghini'
143
  # Style: ink and wash
144
  python svgdreamer.py x=ink "prompt='Big Wild Goose Pagoda. ink style. Minimalist abstract art grayscale watercolor.'" result_path='./logs/BigWildGoosePagoda'
 
 
 
 
 
145
  # Style: painting
146
  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'
147
- ```
148
 
149
  ## 🔑 Tips
150
 
 
43
 
44
  ### SIVE + VPSD
45
 
46
+ **Prompt:** an image of Batman. full body action pose, complete detailed body, white background, high quality, 4K, ultra
47
+ realistic <br/>
48
+ **Preview:**
49
+
50
+ | Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
51
+ |:---------------------------------------------:|:---------------------------------------------:|:---------------------------------------------:|:--------------------------------------------:|:---------------------------------------------:|:---------------------------------------------:|
52
+ | init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
53
+ | <img src="./assets/case-batman/init_p0.svg"> | <img src="./assets/case-batman/init_p1.svg"> | <img src="./assets/case-batman/init_p2.svg"> | <img src="./assets/case-batman/init_p3.svg"> | <img src="./assets/case-batman/init_p4.svg"> | <img src="./assets/case-batman/init_p5.svg"> |
54
+ | final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
55
+ | <img src="./assets/case-batman/final_p0.svg"> | <img src="./assets/case-batman/final_p1.svg"> | <img src="./assets/case-batman/final_p2.svg"> | <img src="assets/case-batman/final_p3.svg"> | <img src="./assets/case-batman/final_p4.svg"> | <img src="./assets/case-batman/final_p5.svg"> |
56
+
57
  **Script:**
58
 
59
  ```shell
 
72
 
73
  ### SIVE
74
 
75
+ **Prompt:** an astronaut walking across a desert, planet mars in the background, floating beside planets, space
76
+ art <br/>
77
  **Preview:**
78
 
79
+ | attn-map | bg init | fg init | bg final | fg final | final |
80
+ |:----------------------------------------------:|:-------------------------------------------------:|:-------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|:------------------------------------------------:|
81
  | <img src="./assets/SIVE-astronaut-1/attn.png"> | <img src="./assets/SIVE-astronaut-1/init_bg.svg"> | <img src="./assets/SIVE-astronaut-1/init_fg.svg"> | <img src="./assets/SIVE-astronaut-1/final_bg.svg"> | <img src="./assets/SIVE-astronaut-1/final_fg.svg"> | <img src="./assets/SIVE-astronaut-1/result.svg"> |
82
 
 
83
  **Script:**
84
 
85
  ```shell
 
93
  **Prompt:** Sydney opera house. oil painting. by Van Gogh <br/>
94
  **Preview:**
95
 
96
+ | Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
97
+ |:------------------------------------------------------:|:------------------------------------------------------:|:------------------------------------------------------:|:------------------------------------------------------:|:------------------------------------------------------:|:------------------------------------------------------:|
98
+ | init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
99
  | <img src="./assets/Icon-SydneyOperaHouse/init_p0.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p1.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p2.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p3.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p4.svg"> | <img src="./assets/Icon-SydneyOperaHouse/init_p5.svg"> |
100
+ | final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
101
+ | <img src="./assets/Icon-SydneyOperaHouse/p_0.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_1.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_2.svg"> | <img src="assets/Icon-SydneyOperaHouse/p_3.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_4.svg"> | <img src="./assets/Icon-SydneyOperaHouse/p_5.svg"> |
102
 
103
  **Script:**
104
 
 
111
  **Prompt:** Abstract Vincent van Gogh Oil Painting Elephant, featuring earthy tones of green and brown <br/>
112
  **Preview:**
113
 
114
+ | Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
115
+ |:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:|
116
+ | init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
117
  | <img src="./assets/Painting-Elephant/init_p0.svg"> | <img src="./assets/Painting-Elephant/init_p1.svg"> | <img src="./assets/Painting-Elephant/init_p2.svg"> | <img src="./assets/Painting-Elephant/init_p3.svg"> | <img src="./assets/Painting-Elephant/init_p4.svg"> | <img src="./assets/Painting-Elephant/init_p5.svg"> |
118
+ | final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
119
+ | <img src="./assets/Painting-Elephant/p_0.svg"> | <img src="./assets/Painting-Elephant/p_1.svg"> | <img src="./assets/Painting-Elephant/p_2.svg"> | <img src="./assets/Painting-Elephant/p_3.svg"> | <img src="./assets/Painting-Elephant/p_4.svg"> | <img src="./assets/Painting-Elephant/p_5.svg"> |
120
 
121
  **Script:**
122
 
 
129
  **Prompt:** Darth vader with lightsaber <br/>
130
  **Preview:**
131
 
132
+ | Particle 1 | Particle 2 | Particle 3 | Particle 4 | Particle 5 | Particle 6 |
133
+ |:----------------------------------------------------:|:----------------------------------------------------:|:----------------------------------------------------:|:----------------------------------------------------:|:----------------------------------------------------:|:----------------------------------------------------:|
134
+ | init p1 | init p2 | init p3 | init p4 | init p5 | init p6 |
135
  | <img src="./assets/Pixelart-DarthVader/init_p0.svg"> | <img src="./assets/Pixelart-DarthVader/init_p1.svg"> | <img src="./assets/Pixelart-DarthVader/init_p2.svg"> | <img src="./assets/Pixelart-DarthVader/init_p3.svg"> | <img src="./assets/Pixelart-DarthVader/init_p4.svg"> | <img src="./assets/Pixelart-DarthVader/init_p5.svg"> |
136
+ | final p1 | final p2 | final p3 | final p4 | final p5 | final p6 |
137
+ | <img src="./assets/Pixelart-DarthVader/p0.svg"> | <img src="./assets/Pixelart-DarthVader/p1.svg"> | <img src="./assets/Pixelart-DarthVader/p2.svg"> | <img src="./assets/Pixelart-DarthVader/p3.svg"> | <img src="./assets/Pixelart-DarthVader/p4.svg"> | <img src="./assets/Pixelart-DarthVader/p5.svg"> |
138
 
139
  **Script:**
140
 
 
151
  python svgdreamer.py x=sketch "prompt='A free-hand drawing of A speeding Lamborghini. black and white drawing.'" 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.'" result_path='./logs/BigWildGoosePagoda'
154
+ ```
155
+
156
+ #### More Cases
157
+
158
+ ````shell
159
  # Style: painting
160
  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'
161
+ ````
162
 
163
  ## 🔑 Tips
164
 
assets/case-batman/final_p0.svg ADDED
assets/case-batman/final_p1.svg ADDED
assets/case-batman/final_p2.svg ADDED
assets/case-batman/final_p3.svg ADDED
assets/case-batman/final_p4.svg ADDED
assets/case-batman/final_p5.svg ADDED
assets/case-batman/init_p0.svg ADDED
assets/case-batman/init_p1.svg ADDED
assets/case-batman/init_p2.svg ADDED
assets/case-batman/init_p3.svg ADDED
assets/case-batman/init_p4.svg ADDED
assets/case-batman/init_p5.svg ADDED
svgdreamer/painter/painter_params.py CHANGED
@@ -364,7 +364,7 @@ class Painter(DiffVGState):
364
  self.shapes[i].id = path.id
365
  self.shapes[i].points.requires_grad = True
366
  extra_point_params.append(self.shapes[i].points)
367
- if self.style == 'painting':
368
  self.shapes[i].stroke_width.requires_grad = True
369
  extra_width_params.append(self.shapes[i].stroke_width)
370
 
@@ -398,9 +398,6 @@ class Painter(DiffVGState):
398
  shape_ids=torch.tensor([len(self.shapes) - 1]),
399
  fill_color=None,
400
  stroke_color=stroke_color_init)
401
- # new shape
402
- self.shape_groups[i].stroke_color.requires_grad = True
403
- extra_color_params.append(self.shape_groups[i].stroke_color)
404
 
405
  # save reinit svg
406
  self.pretty_save_svg(fpath)
 
364
  self.shapes[i].id = path.id
365
  self.shapes[i].points.requires_grad = True
366
  extra_point_params.append(self.shapes[i].points)
367
+ if self.style in ['painting', 'ink']:
368
  self.shapes[i].stroke_width.requires_grad = True
369
  extra_width_params.append(self.shapes[i].stroke_width)
370
 
 
398
  shape_ids=torch.tensor([len(self.shapes) - 1]),
399
  fill_color=None,
400
  stroke_color=stroke_color_init)
 
 
 
401
 
402
  # save reinit svg
403
  self.pretty_save_svg(fpath)