mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-09-24 20:20:37 +00:00
fix: resolve MSVC narrowing conversion warnings (#1969)
This commit is contained in:
parent
ca37fad89a
commit
5a5400bf0c
@ -146,7 +146,7 @@ namespace SenseNovaU1 {
|
|||||||
auto x = ggml_ext_timestep_embedding(ctx->ggml_ctx,
|
auto x = ggml_ext_timestep_embedding(ctx->ggml_ctx,
|
||||||
timesteps,
|
timesteps,
|
||||||
static_cast<int>(frequency_embedding_size),
|
static_cast<int>(frequency_embedding_size),
|
||||||
10000.f,
|
10000,
|
||||||
1.f);
|
1.f);
|
||||||
x = mlp_0->forward(ctx, x);
|
x = mlp_0->forward(ctx, x);
|
||||||
x = ggml_silu_inplace(ctx->ggml_ctx, x);
|
x = ggml_silu_inplace(ctx->ggml_ctx, x);
|
||||||
|
|||||||
@ -564,7 +564,7 @@ public:
|
|||||||
int64_t chunk_frames = 5 * decoder->t_upscale;
|
int64_t chunk_frames = 5 * decoder->t_upscale;
|
||||||
int64_t pad = (chunk_frames - (num_frames % chunk_frames)) % chunk_frames;
|
int64_t pad = (chunk_frames - (num_frames % chunk_frames)) % chunk_frames;
|
||||||
|
|
||||||
result = ggml_ext_pad_ext(ctx->ggml_ctx, ctx->backend, result, 0, 0, 0, 0, 0, 0, 0, pad, false, false);
|
result = ggml_ext_pad_ext(ctx->ggml_ctx, ctx->backend, result, 0, 0, 0, 0, 0, 0, 0, static_cast<int>(pad), false, false);
|
||||||
|
|
||||||
int64_t num_chunks = (num_frames + pad) / chunk_frames;
|
int64_t num_chunks = (num_frames + pad) / chunk_frames;
|
||||||
auto to_trim = decoder->t_upscale - 1;
|
auto to_trim = decoder->t_upscale - 1;
|
||||||
|
|||||||
@ -2789,9 +2789,9 @@ static sd::Tensor<float> sample_lms(denoise_cb_t model,
|
|||||||
sd::Tensor<float> d_cur = (x - denoised) / sigma;
|
sd::Tensor<float> d_cur = (x - denoised) / sigma;
|
||||||
x += d_cur * lms_coeff[0];
|
x += d_cur * lms_coeff[0];
|
||||||
if (max_order > 1) { // if max_order == 1, the history is not used (order always < 2)
|
if (max_order > 1) { // if max_order == 1, the history is not used (order always < 2)
|
||||||
int hist_size_p1 = hist.size() + 1;
|
int hist_size_p1 = static_cast<int>(hist.size()) + 1;
|
||||||
if (i) { // history does not exist at 1st step
|
if (i) { // history does not exist at 1st step
|
||||||
int hist_max = hist.size() - 1;
|
int hist_max = static_cast<int>(hist.size()) - 1;
|
||||||
for (int c = 2; c <= order; c++)
|
for (int c = 2; c <= order; c++)
|
||||||
x += hist[std::min(hist_max, hist_size_p1 - c + shift)] * lms_coeff[c - 1];
|
x += hist[std::min(hist_max, hist_size_p1 - c + shift)] * lms_coeff[c - 1];
|
||||||
// max_order == 4 => hist[] index = 2, 1, 0
|
// max_order == 4 => hist[] index = 2, 1, 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user