ltejedor/differentiable-rasterizer-vector-graphics ❓📝🔢🖼️ → 🖼️

▶️ 594 runs 📅 Mar 2025 ⚙️ Cog 0.9.20 🔗 GitHub
collage-generation image-to-image text-to-image vector-graphics

About

Controllable generative AI art

Example Output

Prompt:

"red panda"

Output

Example outputExample outputExample outputExample outputExample output

Performance Metrics

63.18s Prediction Time
165.40s Total Time
All Input Parameters
{
  "prompt": "red panda",
  "initial_positions": [
    [
      "image_5.png",
      -0.194643,
      0.121429
    ],
    [
      "image_4.png",
      0.301786,
      -0.217857
    ],
    [
      "image_8.png",
      0.294643,
      0.35
    ],
    [
      "image_9.png",
      -0.648214,
      0.157143
    ]
  ]
}
Input Parameters
loss Default: CLIP
Loss function to optimize the collage. Choose between CLIP and MSE. If MSE is selected, the prompt won't affect the image and target_image is required.
prompt Type: stringDefault: a photorealistic chicken
The global prompt for generating the collage.
patch_url Type: stringDefault: https://storage.googleapis.com/dm_arnheim_3_assets/collage_patches/animals.npy
An .npy file for the collage patches.
color_space Default: RGB space
num_patches Type: integerDefault: 100
Number of images to start with
optim_steps Type: integerDefault: 250
Number of optimization steps to run during collage generation.
target_image Type: string
Upload an image file for MSE loss. Required if loss is set to MSE.
background_red Type: integerDefault: 0
background_blue Type: integerDefault: 0
initial_colours Type: arrayDefault:
background_green Type: integerDefault: 0
initial_positions Type: arrayDefault:
List of lists representing the initial positions of patches.
initial_transformations Type: arrayDefault:
Output Schema

Output

Type: stringFormat: uri

Example Execution Logs
initial positions
[['image_5.png', '-0.194643', '0.121429'], ['image_4.png', '0.301786', '-0.217857'], ['image_8.png', '0.294643', '0.35'], ['image_9.png', '-0.648214', '0.157143']]
Tiling 1x1 collages
Optimisation:
Tile size: 448x448
Global size: 448x448 (WxH)
High res:
Tile size: 896x896
Global size: 896x896 (WxH)
Tile 0 prompts: ['a photorealistic sky with sun', 'a photorealistic sky', 'a photorealistic sky with moon', 'a photorealistic tree', 'a photorealistic tree', 'a photorealistic tree', 'a photorealistic field', 'a photorealistic field', 'a photorealistic chicken', 'red panda']
New collage creator for y0, x0 with bg
image (not stitch) min 0.0, max 0.0
Using cached version of animals.npy
Patch set animals.npy, fixed_scale_patches? True, fixed_scale_coeff=0.5, patch_max_proportion=5
Max size for fixed scale patches: (896,896)
<class 'bool'>
Patch 0 scaled by 0.50
Patch 1 scaled by 0.50
Patch 2 scaled by 0.50
Patch 3 scaled by 0.50
Patch 4 scaled by 0.50
Patch 5 scaled by 0.50
Patch 6 scaled by 0.50
Patch 7 scaled by 0.50
Patch 8 scaled by 0.50
Patch 9 scaled by 0.50
Patch 10 scaled by 0.50
Patch 11 scaled by 0.50
Patch 12 scaled by 0.50
Patch 13 scaled by 0.50
Patch 14 scaled by 0.50
Patch 15 scaled by 0.50
Patch 16 scaled by 0.50
Patch 17 scaled by 0.50
Patch 18 scaled by 0.50
Patch 19 scaled by 0.50
Patch 20 scaled by 0.50
Patch 21 scaled by 0.50
Patch 22 scaled by 0.50
Patch 23 scaled by 0.50
Patch 24 scaled by 0.50
Patch 25 scaled by 0.50
Patch 26 scaled by 0.50
Patch 27 scaled by 0.50
Patch 28 scaled by 0.50
Patch 29 scaled by 0.50
Patch 30 scaled by 0.50
Patch 31 scaled by 0.50
Patch 32 scaled by 0.50
Patch 33 scaled by 0.50
Patch 34 scaled by 0.50
Patch 35 scaled by 0.50
Patch 36 scaled by 0.50
Patch 37 scaled by 0.50
Patch 38 scaled by 0.50
Patch 39 scaled by 0.50
Patch 40 scaled by 0.50
Patch 41 scaled by 0.50
Patch 42 scaled by 0.50
Patch sizes during optimisation:
Patch 0 of shape (172, 136, 4)
Patch 1 of shape (192, 122, 4)
Patch 2 of shape (144, 334, 4)
Patch 3 of shape (142, 126, 4)
Patch 4 of shape (152, 182, 4)
Patch 5 of shape (148, 146, 4)
Patch 6 of shape (206, 194, 4)
Patch 7 of shape (148, 138, 4)
Patch 8 of shape (182, 260, 4)
Patch 9 of shape (159, 262, 4)
Patch 10 of shape (174, 226, 4)
Patch 11 of shape (157, 158, 4)
Patch 12 of shape (96, 193, 4)
Patch 13 of shape (254, 145, 4)
Patch 14 of shape (176, 116, 4)
Patch 15 of shape (166, 178, 4)
Patch 16 of shape (151, 209, 4)
Patch 17 of shape (129, 208, 4)
Patch 18 of shape (158, 161, 4)
Patch 19 of shape (122, 192, 4)
Patch 20 of shape (143, 230, 4)
Patch 21 of shape (195, 149, 4)
Patch 22 of shape (159, 178, 4)
Patch 23 of shape (71, 184, 4)
Patch 24 of shape (126, 218, 4)
Patch 25 of shape (134, 177, 4)
Patch 26 of shape (146, 162, 4)
Patch 27 of shape (156, 170, 4)
Patch 28 of shape (154, 233, 4)
Patch 29 of shape (233, 166, 4)
Patch 30 of shape (57, 201, 4)
Patch 31 of shape (148, 219, 4)
Patch 32 of shape (159, 218, 4)
Patch 33 of shape (146, 228, 4)
Patch 34 of shape (249, 136, 4)
Patch 35 of shape (170, 146, 4)
Patch 36 of shape (161, 133, 4)
Patch 37 of shape (150, 172, 4)
Patch 38 of shape (163, 206, 4)
Patch 39 of shape (154, 194, 4)
Patch 40 of shape (184, 417, 4)
Patch 41 of shape (134, 218, 4)
Patch 42 of shape (180, 256, 4)
43 patches, max (184, 417, 4), min (57, 201, 4)
Patch sizes for high-resolution final image:
Patch 0 of shape (344, 272, 4)
Patch 1 of shape (385, 245, 4)
Patch 2 of shape (288, 668, 4)
Patch 3 of shape (284, 252, 4)
Patch 4 of shape (303, 364, 4)
Patch 5 of shape (296, 292, 4)
Patch 6 of shape (412, 387, 4)
Patch 7 of shape (296, 275, 4)
Patch 8 of shape (364, 521, 4)
Patch 9 of shape (318, 524, 4)
Patch 10 of shape (349, 453, 4)
Patch 11 of shape (314, 316, 4)
Patch 12 of shape (193, 386, 4)
Patch 13 of shape (508, 290, 4)
Patch 14 of shape (352, 232, 4)
Patch 15 of shape (333, 355, 4)
Patch 16 of shape (302, 418, 4)
Patch 17 of shape (258, 416, 4)
Patch 18 of shape (316, 322, 4)
Patch 19 of shape (244, 384, 4)
Patch 20 of shape (286, 460, 4)
Patch 21 of shape (390, 298, 4)
Patch 22 of shape (318, 357, 4)
Patch 23 of shape (142, 368, 4)
Patch 24 of shape (253, 436, 4)
Patch 25 of shape (267, 354, 4)
Patch 26 of shape (292, 323, 4)
Patch 27 of shape (311, 341, 4)
Patch 28 of shape (307, 466, 4)
Patch 29 of shape (466, 332, 4)
Patch 30 of shape (114, 402, 4)
Patch 31 of shape (296, 438, 4)
Patch 32 of shape (318, 437, 4)
Patch 33 of shape (291, 455, 4)
Patch 34 of shape (498, 273, 4)
Patch 35 of shape (340, 291, 4)
Patch 36 of shape (322, 266, 4)
Patch 37 of shape (300, 344, 4)
Patch 38 of shape (326, 413, 4)
Patch 39 of shape (308, 387, 4)
Patch 40 of shape (367, 834, 4)
Patch 41 of shape (268, 436, 4)
Patch 42 of shape (360, 512, 4)
43 patches, max (367, 834, 4), min (114, 402, 4)
Global prompt is red panda
Composition prompts ['a photorealistic sky with sun', 'a photorealistic sky', 'a photorealistic sky with moon', 'a photorealistic tree', 'a photorealistic tree', 'a photorealistic tree', 'a photorealistic field', 'a photorealistic field', 'a photorealistic chicken', 'red panda']
PopulationAffineTransforms is_high_res=False, requires_grad=True
PopulationColourRGBTransforms for 100 patches, 2 individuals
PopulationColourRGBTransforms requires_grad=True
Background image of size torch.Size([3, 448, 448])
Starting optimization of collage.
Updated patches in 0.337s
torch.Size([2, 448, 448, 3])
/src/src/training.py:391: FutureWarning: `torch.nn.utils.clip_grad_norm` is now deprecated in favor of `torch.nn.utils.clip_grad_norm_`.
torch.nn.utils.clip_grad_norm(generator.parameters(),
image (stitch) min 0.0, max 1.0
Saving temporary image output_20250319_002503//optim_0.png (shape=(448, 896, 3))
[ WARN:0@8.649] global loadsave.cpp:848 imwrite_ Unsupported depth image for selected encoder is fallbacked to CV_8U.
Iteration   0, rendering loss -0.812805
0
torch.Size([2, 448, 448, 3])
1
torch.Size([2, 448, 448, 3])
2
torch.Size([2, 448, 448, 3])
3
torch.Size([2, 448, 448, 3])
4
torch.Size([2, 448, 448, 3])
5
torch.Size([2, 448, 448, 3])
6
torch.Size([2, 448, 448, 3])
7
torch.Size([2, 448, 448, 3])
8
torch.Size([2, 448, 448, 3])
9
torch.Size([2, 448, 448, 3])
10
torch.Size([2, 448, 448, 3])
11
torch.Size([2, 448, 448, 3])
12
torch.Size([2, 448, 448, 3])
13
torch.Size([2, 448, 448, 3])
14
torch.Size([2, 448, 448, 3])
15
torch.Size([2, 448, 448, 3])
16
torch.Size([2, 448, 448, 3])
17
torch.Size([2, 448, 448, 3])
18
torch.Size([2, 448, 448, 3])
19
torch.Size([2, 448, 448, 3])
20
torch.Size([2, 448, 448, 3])
21
torch.Size([2, 448, 448, 3])
22
torch.Size([2, 448, 448, 3])
23
torch.Size([2, 448, 448, 3])
24
torch.Size([2, 448, 448, 3])
25
torch.Size([2, 448, 448, 3])
26
torch.Size([2, 448, 448, 3])
27
torch.Size([2, 448, 448, 3])
28
torch.Size([2, 448, 448, 3])
29
torch.Size([2, 448, 448, 3])
30
torch.Size([2, 448, 448, 3])
31
torch.Size([2, 448, 448, 3])
32
torch.Size([2, 448, 448, 3])
33
torch.Size([2, 448, 448, 3])
34
torch.Size([2, 448, 448, 3])
35
torch.Size([2, 448, 448, 3])
36
torch.Size([2, 448, 448, 3])
37
torch.Size([2, 448, 448, 3])
38
torch.Size([2, 448, 448, 3])
39
torch.Size([2, 448, 448, 3])
40
torch.Size([2, 448, 448, 3])
41
torch.Size([2, 448, 448, 3])
42
torch.Size([2, 448, 448, 3])
43
torch.Size([2, 448, 448, 3])
44
torch.Size([2, 448, 448, 3])
45
torch.Size([2, 448, 448, 3])
46
torch.Size([2, 448, 448, 3])
47
torch.Size([2, 448, 448, 3])
48
torch.Size([2, 448, 448, 3])
49
torch.Size([2, 448, 448, 3])
image (stitch) min 0.0, max 1.0
Saving temporary image output_20250319_002503//optim_50.png (shape=(448, 896, 3))
Iteration  50, rendering loss -0.847153
50
torch.Size([2, 448, 448, 3])
51
torch.Size([2, 448, 448, 3])
52
torch.Size([2, 448, 448, 3])
53
torch.Size([2, 448, 448, 3])
54
torch.Size([2, 448, 448, 3])
55
torch.Size([2, 448, 448, 3])
56
torch.Size([2, 448, 448, 3])
57
torch.Size([2, 448, 448, 3])
58
torch.Size([2, 448, 448, 3])
59
torch.Size([2, 448, 448, 3])
60
torch.Size([2, 448, 448, 3])
61
torch.Size([2, 448, 448, 3])
62
torch.Size([2, 448, 448, 3])
63
torch.Size([2, 448, 448, 3])
64
torch.Size([2, 448, 448, 3])
65
torch.Size([2, 448, 448, 3])
66
torch.Size([2, 448, 448, 3])
67
torch.Size([2, 448, 448, 3])
68
torch.Size([2, 448, 448, 3])
69
torch.Size([2, 448, 448, 3])
70
torch.Size([2, 448, 448, 3])
71
torch.Size([2, 448, 448, 3])
72
torch.Size([2, 448, 448, 3])
73
torch.Size([2, 448, 448, 3])
74
torch.Size([2, 448, 448, 3])
75
torch.Size([2, 448, 448, 3])
76
torch.Size([2, 448, 448, 3])
77
torch.Size([2, 448, 448, 3])
78
torch.Size([2, 448, 448, 3])
79
torch.Size([2, 448, 448, 3])
80
torch.Size([2, 448, 448, 3])
81
torch.Size([2, 448, 448, 3])
82
torch.Size([2, 448, 448, 3])
83
torch.Size([2, 448, 448, 3])
84
torch.Size([2, 448, 448, 3])
85
torch.Size([2, 448, 448, 3])
86
torch.Size([2, 448, 448, 3])
87
torch.Size([2, 448, 448, 3])
88
torch.Size([2, 448, 448, 3])
89
torch.Size([2, 448, 448, 3])
90
torch.Size([2, 448, 448, 3])
91
torch.Size([2, 448, 448, 3])
92
torch.Size([2, 448, 448, 3])
93
torch.Size([2, 448, 448, 3])
94
torch.Size([2, 448, 448, 3])
95
torch.Size([2, 448, 448, 3])
96
torch.Size([2, 448, 448, 3])
97
torch.Size([2, 448, 448, 3])
98
torch.Size([2, 448, 448, 3])
99
torch.Size([2, 448, 448, 3])
image (stitch) min 0.0, max 1.0
Saving temporary image output_20250319_002503//optim_100.png (shape=(448, 896, 3))
Iteration 100, rendering loss -0.866760
Updated patches in 0.083s
100
torch.Size([2, 448, 448, 3])
101
torch.Size([2, 448, 448, 3])
102
torch.Size([2, 448, 448, 3])
103
torch.Size([2, 448, 448, 3])
104
torch.Size([2, 448, 448, 3])
105
torch.Size([2, 448, 448, 3])
106
torch.Size([2, 448, 448, 3])
107
torch.Size([2, 448, 448, 3])
108
torch.Size([2, 448, 448, 3])
109
torch.Size([2, 448, 448, 3])
110
torch.Size([2, 448, 448, 3])
111
torch.Size([2, 448, 448, 3])
112
torch.Size([2, 448, 448, 3])
113
torch.Size([2, 448, 448, 3])
114
torch.Size([2, 448, 448, 3])
115
torch.Size([2, 448, 448, 3])
116
torch.Size([2, 448, 448, 3])
117
torch.Size([2, 448, 448, 3])
118
torch.Size([2, 448, 448, 3])
119
torch.Size([2, 448, 448, 3])
120
torch.Size([2, 448, 448, 3])
121
torch.Size([2, 448, 448, 3])
122
torch.Size([2, 448, 448, 3])
123
torch.Size([2, 448, 448, 3])
124
torch.Size([2, 448, 448, 3])
125
torch.Size([2, 448, 448, 3])
126
torch.Size([2, 448, 448, 3])
127
torch.Size([2, 448, 448, 3])
128
torch.Size([2, 448, 448, 3])
129
torch.Size([2, 448, 448, 3])
130
torch.Size([2, 448, 448, 3])
131
torch.Size([2, 448, 448, 3])
132
torch.Size([2, 448, 448, 3])
133
torch.Size([2, 448, 448, 3])
134
torch.Size([2, 448, 448, 3])
135
torch.Size([2, 448, 448, 3])
136
torch.Size([2, 448, 448, 3])
137
torch.Size([2, 448, 448, 3])
138
torch.Size([2, 448, 448, 3])
139
torch.Size([2, 448, 448, 3])
140
torch.Size([2, 448, 448, 3])
141
torch.Size([2, 448, 448, 3])
142
torch.Size([2, 448, 448, 3])
143
torch.Size([2, 448, 448, 3])
144
torch.Size([2, 448, 448, 3])
145
torch.Size([2, 448, 448, 3])
146
torch.Size([2, 448, 448, 3])
147
torch.Size([2, 448, 448, 3])
148
torch.Size([2, 448, 448, 3])
149
torch.Size([2, 448, 448, 3])
image (stitch) min 0.0, max 1.0
Saving temporary image output_20250319_002503//optim_150.png (shape=(448, 896, 3))
Iteration 150, rendering loss -0.922791
150
torch.Size([2, 448, 448, 3])
151
torch.Size([2, 448, 448, 3])
152
torch.Size([2, 448, 448, 3])
153
torch.Size([2, 448, 448, 3])
154
torch.Size([2, 448, 448, 3])
155
torch.Size([2, 448, 448, 3])
156
torch.Size([2, 448, 448, 3])
157
torch.Size([2, 448, 448, 3])
158
torch.Size([2, 448, 448, 3])
159
torch.Size([2, 448, 448, 3])
160
torch.Size([2, 448, 448, 3])
161
torch.Size([2, 448, 448, 3])
162
torch.Size([2, 448, 448, 3])
163
torch.Size([2, 448, 448, 3])
164
torch.Size([2, 448, 448, 3])
165
torch.Size([2, 448, 448, 3])
166
torch.Size([2, 448, 448, 3])
167
torch.Size([2, 448, 448, 3])
168
torch.Size([2, 448, 448, 3])
169
torch.Size([2, 448, 448, 3])
170
torch.Size([2, 448, 448, 3])
171
torch.Size([2, 448, 448, 3])
172
torch.Size([2, 448, 448, 3])
173
torch.Size([2, 448, 448, 3])
174
torch.Size([2, 448, 448, 3])
175
torch.Size([2, 448, 448, 3])
176
torch.Size([2, 448, 448, 3])
177
torch.Size([2, 448, 448, 3])
178
torch.Size([2, 448, 448, 3])
179
torch.Size([2, 448, 448, 3])
180
torch.Size([2, 448, 448, 3])
181
torch.Size([2, 448, 448, 3])
182
torch.Size([2, 448, 448, 3])
183
torch.Size([2, 448, 448, 3])
184
torch.Size([2, 448, 448, 3])
185
torch.Size([2, 448, 448, 3])
186
torch.Size([2, 448, 448, 3])
187
torch.Size([2, 448, 448, 3])
188
torch.Size([2, 448, 448, 3])
189
torch.Size([2, 448, 448, 3])
190
torch.Size([2, 448, 448, 3])
191
torch.Size([2, 448, 448, 3])
192
torch.Size([2, 448, 448, 3])
193
torch.Size([2, 448, 448, 3])
194
torch.Size([2, 448, 448, 3])
195
torch.Size([2, 448, 448, 3])
196
torch.Size([2, 448, 448, 3])
197
torch.Size([2, 448, 448, 3])
198
torch.Size([2, 448, 448, 3])
199
torch.Size([2, 448, 448, 3])
image (stitch) min 0.0, max 1.0
Saving temporary image output_20250319_002503//optim_200.png (shape=(448, 896, 3))
Iteration 200, rendering loss -0.958267
Updated patches in 0.082s
200
torch.Size([2, 448, 448, 3])
201
torch.Size([2, 448, 448, 3])
202
torch.Size([2, 448, 448, 3])
203
torch.Size([2, 448, 448, 3])
204
torch.Size([2, 448, 448, 3])
205
torch.Size([2, 448, 448, 3])
206
torch.Size([2, 448, 448, 3])
207
torch.Size([2, 448, 448, 3])
208
torch.Size([2, 448, 448, 3])
209
torch.Size([2, 448, 448, 3])
210
torch.Size([2, 448, 448, 3])
211
torch.Size([2, 448, 448, 3])
212
torch.Size([2, 448, 448, 3])
213
torch.Size([2, 448, 448, 3])
214
torch.Size([2, 448, 448, 3])
215
torch.Size([2, 448, 448, 3])
216
torch.Size([2, 448, 448, 3])
217
torch.Size([2, 448, 448, 3])
218
torch.Size([2, 448, 448, 3])
219
torch.Size([2, 448, 448, 3])
220
torch.Size([2, 448, 448, 3])
221
torch.Size([2, 448, 448, 3])
222
torch.Size([2, 448, 448, 3])
223
torch.Size([2, 448, 448, 3])
224
torch.Size([2, 448, 448, 3])
225
torch.Size([2, 448, 448, 3])
226
torch.Size([2, 448, 448, 3])
227
torch.Size([2, 448, 448, 3])
228
torch.Size([2, 448, 448, 3])
229
torch.Size([2, 448, 448, 3])
230
torch.Size([2, 448, 448, 3])
231
torch.Size([2, 448, 448, 3])
232
torch.Size([2, 448, 448, 3])
233
torch.Size([2, 448, 448, 3])
234
torch.Size([2, 448, 448, 3])
235
torch.Size([2, 448, 448, 3])
236
torch.Size([2, 448, 448, 3])
237
torch.Size([2, 448, 448, 3])
238
torch.Size([2, 448, 448, 3])
239
torch.Size([2, 448, 448, 3])
240
torch.Size([2, 448, 448, 3])
241
torch.Size([2, 448, 448, 3])
242
torch.Size([2, 448, 448, 3])
243
torch.Size([2, 448, 448, 3])
244
torch.Size([2, 448, 448, 3])
245
torch.Size([2, 448, 448, 3])
246
torch.Size([2, 448, 448, 3])
247
torch.Size([2, 448, 448, 3])
248
torch.Size([2, 448, 448, 3])
image (stitch) min 0.0, max 1.0
Saving model to output_20250319_002503/...
249
PopulationAffineTransforms is_high_res=True, requires_grad=False
PopulationColourRGBTransforms for 100 patches, 1 individuals
PopulationColourRGBTransforms requires_grad=False
Background image of size torch.Size([3, 896, 896])
Lowest loss: -1.0089111328125 @ index 1:
[0, 0] idx [0:896], [0:896]
Finished [0, 0] idx [0:896], [0:896]
torch.Size([1, 896, 896, 4])
Image has alpha channel
PopulationAffineTransforms is_high_res=True, requires_grad=False
PopulationColourRGBTransforms for 100 patches, 1 individuals
PopulationColourRGBTransforms requires_grad=False
Background image of size torch.Size([3, 896, 896])
Lowest loss: -1.0089111328125 @ index 1:
Not using background_image
[0, 0] idx [0:896], [0:896]
Setting alpha to zero outside of patches
Finished [0, 0] idx [0:896], [0:896]
torch.Size([1, 896, 896, 4])
Image has alpha channel
Version Details
Version ID
c2405500b0f1671678ef21dab202ecb6ae5ad50d82628e169b3a0cd66a86c6ca
Version Created
April 3, 2025
Run on Replicate →