Skip to content

Commit d91d187

Browse files
committed
format code
1 parent 05a44ff commit d91d187

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

mmdit.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ struct MMDiTRunner : public GGMLRunner {
920920
struct ggml_tensor* y,
921921
struct ggml_tensor** output = NULL,
922922
struct ggml_context* output_ctx = NULL,
923-
std::vector<int> skip_layers = std::vector<int>()) {
923+
std::vector<int> skip_layers = std::vector<int>()) {
924924
// x: [N, in_channels, h, w]
925925
// timesteps: [N, ]
926926
// context: [N, max_position, hidden_size]([N, 154, 4096]) or [1, max_position, hidden_size]

stable-diffusion.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,11 +789,10 @@ class StableDiffusionGGML {
789789
bool has_unconditioned = cfg_scale != 1.0 && uncond.c_crossattn != NULL;
790790
bool has_skiplayer = slg_scale != 0.0 && skip_layers.size() > 0;
791791

792-
793792
// denoise wrapper
794793
struct ggml_tensor* out_cond = ggml_dup_tensor(work_ctx, x);
795794
struct ggml_tensor* out_uncond = NULL;
796-
struct ggml_tensor* out_skip = NULL;
795+
struct ggml_tensor* out_skip = NULL;
797796

798797
if (has_unconditioned) {
799798
out_uncond = ggml_dup_tensor(work_ctx, x);
@@ -887,8 +886,8 @@ class StableDiffusionGGML {
887886
negative_data = (float*)out_uncond->data;
888887
}
889888

890-
int stepCount = sigmas.size();
891-
bool is_skiplayer_step = has_skiplayer && step > (int)(skip_layer_start * stepCount) && step < (int)(skip_layer_end * stepCount);
889+
int step_count = sigmas.size();
890+
bool is_skiplayer_step = has_skiplayer && step > (int)(skip_layer_start * step_count) && step < (int)(skip_layer_end * step_count);
892891
float* skip_layer_data = NULL;
893892
if (is_skiplayer_step) {
894893
LOG_DEBUG("Skipping layers at step %d\n", step);

stable-diffusion.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ SD_API sd_image_t* txt2img(sd_ctx_t* sd_ctx,
163163
float style_strength,
164164
bool normalize_input,
165165
const char* input_id_images_path,
166-
std::vector<int> skip_layers = {},
167-
float slg_scale = 2.5,
168-
float skip_layer_start = 0.01,
169-
float skip_layer_end = 0.2);
166+
std::vector<int> skip_layers = {},
167+
float slg_scale = 2.5,
168+
float skip_layer_start = 0.01,
169+
float skip_layer_end = 0.2);
170170

171171
SD_API sd_image_t* img2img(sd_ctx_t* sd_ctx,
172172
sd_image_t init_image,

0 commit comments

Comments
 (0)