Skip to content

Commit 12e506c

Browse files
committed
fix: failed to build in c11
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 0469508 commit 12e506c

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

stable-diffusion.cpp

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "control.hpp"
1111
#include "denoiser.hpp"
1212
#include "diffusion_model.hpp"
13-
#include "esrgan.hpp"
1413
#include "lora.hpp"
1514
#include "pmid.hpp"
1615
#include "tae.hpp"
@@ -322,7 +321,7 @@ class StableDiffusionGGML {
322321
auto cc_clip_l = model_loader.has_prefix_tensors("cond_stage_model.") && !model_loader.has_prefix_tensors("text_encoders.clip_l.");
323322
auto cc_clip_g = model_loader.has_prefix_tensors("cond_stage_model.") && !model_loader.has_prefix_tensors("text_encoders.clip_g.");
324323
auto cc_t5xxl = model_loader.has_prefix_tensors("cond_stage_model.") && !model_loader.has_prefix_tensors("text_encoders.t5xxl.");
325-
auto cc_vae = model_loader.has_prefix_tensors("first_stage_model.") && !model_loader.has_prefix_tensors("vae.");
324+
auto cc_vae = model_loader.has_prefix_tensors("first_stage_model.") && !model_loader.has_prefix_tensors("vae.");
326325

327326
if (version == VERSION_SVD) {
328327
clip_vision = std::make_shared<FrozenCLIPVisionEmbedder>(backend, conditioner_wtype);
@@ -1903,24 +1902,24 @@ sd_sampling_stream_t* get_sampling_stream(sd_ctx_t* sd_ctx,
19031902
struct ggml_tensor* denoised = ggml_dup_tensor(work_ctx, x);
19041903

19051904
return new sd_sampling_stream_t{
1906-
.cond = cond,
1907-
.uncond = uncond,
1908-
.control_hint = control_hint,
1909-
.x = x,
1910-
.noised_input = noised_input,
1911-
.out_cond = out_cond,
1912-
.out_uncond = out_uncond,
1913-
.denoised = denoised,
1914-
.work_ctx = work_ctx,
1915-
.cfg_scale = cfg_scale,
1916-
.guidance = guidance,
1917-
.sampler = get_sampler(sample_method),
1918-
.sample_steps = sample_steps,
1919-
.control_strength = control_strength,
1920-
.sigmas = sigmas,
1921-
.rng = rng,
1922-
.sampling_start = static_cast<size_t>(ggml_time_ms()),
1923-
.sampled_steps = 0,
1905+
cond,
1906+
uncond,
1907+
control_hint,
1908+
x,
1909+
noised_input,
1910+
out_cond,
1911+
out_uncond,
1912+
denoised,
1913+
work_ctx,
1914+
cfg_scale,
1915+
guidance,
1916+
get_sampler(sample_method),
1917+
sample_steps,
1918+
control_strength,
1919+
sigmas,
1920+
rng,
1921+
static_cast<size_t>(ggml_time_ms()),
1922+
0,
19241923
};
19251924
}
19261925

@@ -2283,9 +2282,9 @@ sd_image_t sd_samping_stream_get_image(sd_ctx_t* sd_ctx, sd_sampling_stream_t* s
22832282
LOG_INFO("decode_first_stage completed, taking %.2fs", (t1 - t0) * 1.0f / 1000);
22842283

22852284
return sd_image_t{
2286-
.width = static_cast<uint32_t>(decoded_image->ne[0]),
2287-
.height = static_cast<uint32_t>(decoded_image->ne[1]),
2288-
.channel = static_cast<uint32_t>(decoded_image->ne[2]),
2289-
.data = sd_tensor_to_image(decoded_image),
2285+
static_cast<uint32_t>(decoded_image->ne[0]),
2286+
static_cast<uint32_t>(decoded_image->ne[1]),
2287+
static_cast<uint32_t>(decoded_image->ne[2]),
2288+
sd_tensor_to_image(decoded_image),
22902289
};
22912290
}

0 commit comments

Comments
 (0)