diff --git a/examples/server/routes_openai.cpp b/examples/server/routes_openai.cpp index 7386363c..5f52fabd 100644 --- a/examples/server/routes_openai.cpp +++ b/examples/server/routes_openai.cpp @@ -291,10 +291,10 @@ void register_openai_api_endpoints(httplib::Server& svr, ServerRuntime& rt) { continue; } std::string params = request.gen_params.embed_image_metadata - ? get_image_params(*runtime->ctx_params, - request.gen_params, - request.gen_params.seed + i / images_per_batch) - : ""; + ? get_image_params(*runtime->ctx_params, + request.gen_params, + request.gen_params.seed + i / images_per_batch) + : ""; auto image_bytes = encode_image_to_vector(request.output_format == "jpeg" ? EncodedImageFormat::JPEG : request.output_format == "webp" @@ -365,10 +365,10 @@ void register_openai_api_endpoints(httplib::Server& svr, ServerRuntime& rt) { continue; } std::string params = request.gen_params.embed_image_metadata - ? get_image_params(*runtime->ctx_params, - request.gen_params, - request.gen_params.seed + i / images_per_batch) - : ""; + ? get_image_params(*runtime->ctx_params, + request.gen_params, + request.gen_params.seed + i / images_per_batch) + : ""; auto image_bytes = encode_image_to_vector(request.output_format == "jpeg" ? EncodedImageFormat::JPEG : EncodedImageFormat::PNG, results[i].data, results[i].width, diff --git a/src/model/common/rope.hpp b/src/model/common/rope.hpp index af66dd90..9ec90bab 100644 --- a/src/model/common/rope.hpp +++ b/src/model/common/rope.hpp @@ -353,13 +353,13 @@ namespace Rope { __STATIC_INLINE__ std::vector> gen_refs_ids(int patch_size, int bs, - int axes_dim_num, - int start_index, - const std::vector& ref_latents, - RefIndexMode ref_index_mode, - float ref_index_scale, - bool scale_rope, - int base_offset = 0) { + int axes_dim_num, + int start_index, + const std::vector& ref_latents, + RefIndexMode ref_index_mode, + float ref_index_scale, + bool scale_rope, + int base_offset = 0) { std::vector> ids; int curr_h_offset = 0; int curr_w_offset = 0; @@ -404,12 +404,12 @@ namespace Rope { int patch_size, int bs, int axes_dim_num, - int context_len, - std::set txt_arange_dims, - const std::vector& ref_latents, - RefIndexMode ref_index_mode, - float ref_index_scale, - bool is_longcat) { + int context_len, + std::set txt_arange_dims, + const std::vector& ref_latents, + RefIndexMode ref_index_mode, + float ref_index_scale, + bool is_longcat) { int x_index = is_longcat ? 1 : 0; auto txt_ids = is_longcat ? gen_longcat_txt_ids(bs, context_len, axes_dim_num) : gen_flux_txt_ids(bs, context_len, axes_dim_num, txt_arange_dims); @@ -429,12 +429,12 @@ namespace Rope { int w, int patch_size, int bs, - int context_len, - std::set txt_arange_dims, - const std::vector& ref_latents, - RefIndexMode ref_index_mode, - float ref_index_scale, - int theta, + int context_len, + std::set txt_arange_dims, + const std::vector& ref_latents, + RefIndexMode ref_index_mode, + float ref_index_scale, + int theta, bool circular_h, bool circular_w, const std::vector& axes_dim, @@ -557,7 +557,7 @@ namespace Rope { if (ref_latents.size() > 0) { int ref_start_index = ref_index_mode == RefIndexMode::DECREASE ? 0 : 1; auto refs_ids = gen_refs_ids(patch_size, bs, axes_dim_num, ref_start_index, ref_latents, ref_index_mode, 1.f, true); - ids = concat_ids(ids, refs_ids, bs); + ids = concat_ids(ids, refs_ids, bs); } return ids; } diff --git a/src/model/diffusion/anima.hpp b/src/model/diffusion/anima.hpp index 9bcf076b..1c1ec2ed 100644 --- a/src/model/diffusion/anima.hpp +++ b/src/model/diffusion/anima.hpp @@ -609,12 +609,12 @@ namespace Anima { patch_size, bs, static_cast(axes_dim.size()), - 0, - {}, - empty_ref_latents, - Rope::RefIndexMode::FIXED, - 1.0f, - false); + 0, + {}, + empty_ref_latents, + Rope::RefIndexMode::FIXED, + 1.0f, + false); std::vector axis_thetas = { static_cast(theta) * calc_ntk_factor(t_extrapolation_ratio, axes_dim[0]), diff --git a/src/model/diffusion/flux.hpp b/src/model/diffusion/flux.hpp index 53f9ac31..e3cd6ba7 100644 --- a/src/model/diffusion/flux.hpp +++ b/src/model/diffusion/flux.hpp @@ -1629,13 +1629,13 @@ namespace Flux { *diffusion_params.timesteps, tensor_or_empty(diffusion_params.context), tensor_or_empty(diffusion_params.c_concat), - tensor_or_empty(diffusion_params.y), - tensor_or_empty(extra->guidance), - diffusion_params.ref_latents ? *diffusion_params.ref_latents : empty_ref_latents, - diffusion_params.ref_index_mode, - extra->skip_layers ? *extra->skip_layers : empty_skip_layers, - tensor_or_empty(extra->pulid_id), - extra->pulid_id_weight); + tensor_or_empty(diffusion_params.y), + tensor_or_empty(extra->guidance), + diffusion_params.ref_latents ? *diffusion_params.ref_latents : empty_ref_latents, + diffusion_params.ref_index_mode, + extra->skip_layers ? *extra->skip_layers : empty_skip_layers, + tensor_or_empty(extra->pulid_id), + extra->pulid_id_weight); } void test() { diff --git a/src/model/diffusion/qwen_image.hpp b/src/model/diffusion/qwen_image.hpp index e9414c6d..6a577e8e 100644 --- a/src/model/diffusion/qwen_image.hpp +++ b/src/model/diffusion/qwen_image.hpp @@ -498,10 +498,10 @@ namespace Qwen { // pe: [L, d_head/2, 2, 2] // return: [N, C, H, W] or [N*C, T, H, W] - int64_t W = x->ne[0]; - int64_t H = x->ne[1]; - int64_t T = 1; - int64_t N = addition_t_cond != nullptr ? addition_t_cond->ne[0] : x->ne[3]; + int64_t W = x->ne[0]; + int64_t H = x->ne[1]; + int64_t T = 1; + int64_t N = addition_t_cond != nullptr ? addition_t_cond->ne[0] : x->ne[3]; bool has_time_axis = false; if (x->ne[3] != 1) { T = x->ne[2]; diff --git a/src/model/vae/wan_vae.hpp b/src/model/vae/wan_vae.hpp index a5fd0936..d28b5b25 100644 --- a/src/model/vae/wan_vae.hpp +++ b/src/model/vae/wan_vae.hpp @@ -1234,7 +1234,7 @@ namespace WAN { auto in = ggml_ext_slice(ctx->ggml_ctx, x, 2, i, i + 1); // [b*c, 1, h, w] _conv_idx = 0; auto out = decoder->forward(ctx, in, b, _feat_map, _conv_idx, i); - out = unpatchify(ctx->ggml_ctx, out, patch_size, b); + out = unpatchify(ctx->ggml_ctx, out, patch_size, b); // sd::ggml_graph_cut::mark_graph_cut(out, "wan_vae.decode_partial.final", "out"); return out; } diff --git a/src/stable-diffusion.cpp b/src/stable-diffusion.cpp index 7b23a2d3..6d1438a1 100644 --- a/src/stable-diffusion.cpp +++ b/src/stable-diffusion.cpp @@ -756,13 +756,13 @@ public: } } else if (sd_version_is_qwen_image(version)) { bool enable_vision = version != VERSION_QWEN_IMAGE_LAYERED; - cond_stage_model = std::make_shared(backend_for(SDBackendModule::TE), + cond_stage_model = std::make_shared(backend_for(SDBackendModule::TE), tensor_storage_map, version, "", enable_vision, model_manager); - diffusion_model = std::make_shared(backend_for(SDBackendModule::DIFFUSION), + diffusion_model = std::make_shared(backend_for(SDBackendModule::DIFFUSION), tensor_storage_map, "model.diffusion_model", version, @@ -4118,7 +4118,7 @@ static std::optional prepare_image_generation_latents(sd if (ref_images.empty() && sd_version_is_unet_edit(sd_ctx->sd->version)) { LOG_WARN("This model needs at least one reference image; using an empty reference"); - ref_images.push_back(sd::zeros({request->width, request->height, image_channels, 1})); + ref_images.push_back(sd::zeros({request->width, request->height, image_channels, 1})); request->guidance.img_cfg = request->guidance.txt_cfg; request->use_img_uncond = false; }