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);
|
||||||
|
|||||||
@ -20,22 +20,22 @@ namespace WAN {
|
|||||||
constexpr int WAN_GRAPH_SIZE = 10240;
|
constexpr int WAN_GRAPH_SIZE = 10240;
|
||||||
|
|
||||||
struct WanConfig {
|
struct WanConfig {
|
||||||
std::string model_type = "t2v";
|
std::string model_type = "t2v";
|
||||||
std::tuple<int, int, int> patch_size = {1, 2, 2};
|
std::tuple<int, int, int> patch_size = {1, 2, 2};
|
||||||
int64_t text_len = 512;
|
int64_t text_len = 512;
|
||||||
int64_t in_dim = 16;
|
int64_t in_dim = 16;
|
||||||
int64_t dim = 2048;
|
int64_t dim = 2048;
|
||||||
int64_t ffn_dim = 8192;
|
int64_t ffn_dim = 8192;
|
||||||
int freq_dim = 256;
|
int freq_dim = 256;
|
||||||
int64_t text_dim = 4096;
|
int64_t text_dim = 4096;
|
||||||
int64_t out_dim = 16;
|
int64_t out_dim = 16;
|
||||||
int64_t num_heads = 16;
|
int64_t num_heads = 16;
|
||||||
int num_layers = 32;
|
int num_layers = 32;
|
||||||
int vace_layers = 0;
|
int vace_layers = 0;
|
||||||
int64_t vace_in_dim = 96;
|
int64_t vace_in_dim = 96;
|
||||||
std::map<int, int> vace_layers_mapping = {};
|
std::map<int, int> vace_layers_mapping = {};
|
||||||
int64_t audio_dim = 1024;
|
int64_t audio_dim = 1024;
|
||||||
int num_audio_token = 4; // excludes the learned padding token
|
int num_audio_token = 4; // excludes the learned padding token
|
||||||
std::vector<int> audio_inject_layers = {};
|
std::vector<int> audio_inject_layers = {};
|
||||||
std::map<int, int> audio_inject_mapping = {}; // block index -> injector index
|
std::map<int, int> audio_inject_mapping = {}; // block index -> injector index
|
||||||
std::string adain_mode = "attn_norm";
|
std::string adain_mode = "attn_norm";
|
||||||
|
|||||||
@ -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