mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2025-12-12 13:28:37 +00:00
chore: clean up stb includes (#919)
This commit is contained in:
parent
9e28be6479
commit
8a45d0ff7f
@ -16,14 +16,6 @@
|
||||
#include "tae.hpp"
|
||||
#include "vae.hpp"
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#define STB_IMAGE_STATIC
|
||||
#include "stb_image.h"
|
||||
|
||||
// #define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
// #define STB_IMAGE_WRITE_STATIC
|
||||
// #include "stb_image_write.h"
|
||||
|
||||
const char* model_version_to_str[] = {
|
||||
"SD 1.x",
|
||||
"SD 1.x Inpaint",
|
||||
@ -1150,7 +1142,7 @@ public:
|
||||
std::vector<int> skip_layers(guidance.slg.layers, guidance.slg.layers + guidance.slg.layer_count);
|
||||
|
||||
float cfg_scale = guidance.txt_cfg;
|
||||
float img_cfg_scale = isfinite(guidance.img_cfg) ? guidance.img_cfg : guidance.txt_cfg;
|
||||
float img_cfg_scale = std::isfinite(guidance.img_cfg) ? guidance.img_cfg : guidance.txt_cfg;
|
||||
float slg_scale = guidance.slg.scale;
|
||||
|
||||
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) {
|
||||
"eta: %.2f, "
|
||||
"shifted_timestep: %d)",
|
||||
sample_params->guidance.txt_cfg,
|
||||
isfinite(sample_params->guidance.img_cfg)
|
||||
std::isfinite(sample_params->guidance.img_cfg)
|
||||
? sample_params->guidance.img_cfg
|
||||
: sample_params->guidance.txt_cfg,
|
||||
sample_params->guidance.distilled_guidance,
|
||||
@ -2153,7 +2145,7 @@ sd_image_t* generate_image_internal(sd_ctx_t* sd_ctx,
|
||||
seed = rand();
|
||||
}
|
||||
|
||||
if (!isfinite(guidance.img_cfg)) {
|
||||
if (!std::isfinite(guidance.img_cfg)) {
|
||||
guidance.img_cfg = guidance.txt_cfg;
|
||||
}
|
||||
|
||||
|
||||
3
util.cpp
3
util.cpp
@ -26,9 +26,6 @@
|
||||
#include "ggml.h"
|
||||
#include "stable-diffusion.h"
|
||||
|
||||
#define STB_IMAGE_RESIZE_IMPLEMENTATION
|
||||
#include "stb_image_resize.h"
|
||||
|
||||
bool ends_with(const std::string& str, const std::string& ending) {
|
||||
if (str.length() >= ending.length()) {
|
||||
return (str.compare(str.length() - ending.length(), ending.length(), ending) == 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user