|
16 | 16 | #include "tae.hpp" |
17 | 17 | #include "vae.hpp" |
18 | 18 |
|
19 | | -#define STB_IMAGE_IMPLEMENTATION |
20 | | -#define STB_IMAGE_STATIC |
21 | | -#include "stb_image.h" |
22 | | - |
23 | | -// #define STB_IMAGE_WRITE_IMPLEMENTATION |
24 | | -// #define STB_IMAGE_WRITE_STATIC |
25 | | -// #include "stb_image_write.h" |
26 | | - |
27 | 19 | const char* model_version_to_str[] = { |
28 | 20 | "SD 1.x", |
29 | 21 | "SD 1.x Inpaint", |
@@ -1150,7 +1142,7 @@ class StableDiffusionGGML { |
1150 | 1142 | std::vector<int> skip_layers(guidance.slg.layers, guidance.slg.layers + guidance.slg.layer_count); |
1151 | 1143 |
|
1152 | 1144 | float cfg_scale = guidance.txt_cfg; |
1153 | | - float img_cfg_scale = isfinite(guidance.img_cfg) ? guidance.img_cfg : guidance.txt_cfg; |
| 1145 | + float img_cfg_scale = std::isfinite(guidance.img_cfg) ? guidance.img_cfg : guidance.txt_cfg; |
1154 | 1146 | float slg_scale = guidance.slg.scale; |
1155 | 1147 |
|
1156 | 1148 | if (img_cfg_scale != cfg_scale && !sd_version_is_inpaint_or_unet_edit(version)) { |
@@ -1987,7 +1979,7 @@ char* sd_sample_params_to_str(const sd_sample_params_t* sample_params) { |
1987 | 1979 | "eta: %.2f, " |
1988 | 1980 | "shifted_timestep: %d)", |
1989 | 1981 | sample_params->guidance.txt_cfg, |
1990 | | - isfinite(sample_params->guidance.img_cfg) |
| 1982 | + std::isfinite(sample_params->guidance.img_cfg) |
1991 | 1983 | ? sample_params->guidance.img_cfg |
1992 | 1984 | : sample_params->guidance.txt_cfg, |
1993 | 1985 | sample_params->guidance.distilled_guidance, |
@@ -2153,7 +2145,7 @@ sd_image_t* generate_image_internal(sd_ctx_t* sd_ctx, |
2153 | 2145 | seed = rand(); |
2154 | 2146 | } |
2155 | 2147 |
|
2156 | | - if (!isfinite(guidance.img_cfg)) { |
| 2148 | + if (!std::isfinite(guidance.img_cfg)) { |
2157 | 2149 | guidance.img_cfg = guidance.txt_cfg; |
2158 | 2150 | } |
2159 | 2151 |
|
|
0 commit comments