Skip to content

Commit 7da49ed

Browse files
committed
latent-preview: fix compile warnings
1 parent 3060053 commit 7da49ed

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

latent-preview.h

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11

22
// https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/latent_formats.py#L152-L169
33
const float flux_latent_rgb_proj[16][3] = {
4-
{-0.0346, 0.0244, 0.0681},
5-
{0.0034, 0.0210, 0.0687},
6-
{0.0275, -0.0668, -0.0433},
7-
{-0.0174, 0.0160, 0.0617},
8-
{0.0859, 0.0721, 0.0329},
9-
{0.0004, 0.0383, 0.0115},
10-
{0.0405, 0.0861, 0.0915},
11-
{-0.0236, -0.0185, -0.0259},
12-
{-0.0245, 0.0250, 0.1180},
13-
{0.1008, 0.0755, -0.0421},
14-
{-0.0515, 0.0201, 0.0011},
15-
{0.0428, -0.0012, -0.0036},
16-
{0.0817, 0.0765, 0.0749},
17-
{-0.1264, -0.0522, -0.1103},
18-
{-0.0280, -0.0881, -0.0499},
19-
{-0.1262, -0.0982, -0.0778}};
4+
{-0.0346f, 0.0244f, 0.0681f},
5+
{0.0034f, 0.0210f, 0.0687f},
6+
{0.0275f, -0.0668f, -0.0433f},
7+
{-0.0174f, 0.0160f, 0.0617f},
8+
{0.0859f, 0.0721f, 0.0329f},
9+
{0.0004f, 0.0383f, 0.0115f},
10+
{0.0405f, 0.0861f, 0.0915f},
11+
{-0.0236f, -0.0185f, -0.0259f},
12+
{-0.0245f, 0.0250f, 0.1180f},
13+
{0.1008f, 0.0755f, -0.0421f},
14+
{-0.0515f, 0.0201f, 0.0011f},
15+
{0.0428f, -0.0012f, -0.0036f},
16+
{0.0817f, 0.0765f, 0.0749f},
17+
{-0.1264f, -0.0522f, -0.1103f},
18+
{-0.0280f, -0.0881f, -0.0499f},
19+
{-0.1262f, -0.0982f, -0.0778f}};
2020

2121
// https://github.com/Stability-AI/sd3.5/blob/main/sd3_impls.py#L228-L246
2222
const float sd3_latent_rgb_proj[16][3] = {
23-
{-0.0645, 0.0177, 0.1052},
24-
{0.0028, 0.0312, 0.0650},
25-
{0.1848, 0.0762, 0.0360},
26-
{0.0944, 0.0360, 0.0889},
27-
{0.0897, 0.0506, -0.0364},
28-
{-0.0020, 0.1203, 0.0284},
29-
{0.0855, 0.0118, 0.0283},
30-
{-0.0539, 0.0658, 0.1047},
31-
{-0.0057, 0.0116, 0.0700},
32-
{-0.0412, 0.0281, -0.0039},
33-
{0.1106, 0.1171, 0.1220},
34-
{-0.0248, 0.0682, -0.0481},
35-
{0.0815, 0.0846, 0.1207},
36-
{-0.0120, -0.0055, -0.0867},
37-
{-0.0749, -0.0634, -0.0456},
38-
{-0.1418, -0.1457, -0.1259},
23+
{-0.0645f, 0.0177f, 0.1052f},
24+
{0.0028f, 0.0312f, 0.0650f},
25+
{0.1848f, 0.0762f, 0.0360f},
26+
{0.0944f, 0.0360f, 0.0889f},
27+
{0.0897f, 0.0506f, -0.0364f},
28+
{-0.0020f, 0.1203f, 0.0284f},
29+
{0.0855f, 0.0118f, 0.0283f},
30+
{-0.0539f, 0.0658f, 0.1047f},
31+
{-0.0057f, 0.0116f, 0.0700f},
32+
{-0.0412f, 0.0281f, -0.0039f},
33+
{0.1106f, 0.1171f, 0.1220f},
34+
{-0.0248f, 0.0682f, -0.0481f},
35+
{0.0815f, 0.0846f, 0.1207f},
36+
{-0.0120f, -0.0055f, -0.0867f},
37+
{-0.0749f, -0.0634f, -0.0456f},
38+
{-0.1418f, -0.1457f, -0.1259f},
3939
};
4040

4141
// https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/latent_formats.py#L32-L38
4242
const float sdxl_latent_rgb_proj[4][3] = {
43-
{0.3651, 0.4232, 0.4341},
44-
{-0.2533, -0.0042, 0.1068},
45-
{0.1076, 0.1111, -0.0362},
46-
{-0.3165, -0.2492, -0.2188}};
43+
{0.3651f, 0.4232f, 0.4341f},
44+
{-0.2533f, -0.0042f, 0.1068f},
45+
{0.1076f, 0.1111f, -0.0362f},
46+
{-0.3165f, -0.2492f, -0.2188f}};
4747

4848
// https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/latent_formats.py#L32-L38
4949
const float sd_latent_rgb_proj[4][3]{
50-
{0.3512, 0.2297, 0.3227},
51-
{0.3250, 0.4974, 0.2350},
52-
{-0.2829, 0.1762, 0.2721},
53-
{-0.2120, -0.2616, -0.7177}};
50+
{0.3512f, 0.2297f, 0.3227f},
51+
{0.3250f, 0.4974f, 0.2350f},
52+
{-0.2829f, 0.1762f, 0.2721f},
53+
{-0.2120f, -0.2616f, -0.7177f}};
5454

5555
void preview_latent_image(uint8_t* buffer, struct ggml_tensor* latents, const float (*latent_rgb_proj)[3], int width, int height, int dim) {
5656
size_t buffer_head = 0;

0 commit comments

Comments
 (0)