Skip to content

Commit 6c68e39

Browse files
committed
format code
1 parent f80f61a commit 6c68e39

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

examples/cli/main.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,10 @@ void parse_args(int argc, const char** argv, SDParams& params) {
828828
"--taesd-preview-only",
829829
std::string("prevents usage of taesd for decoding the final image. (for use with --preview ") + previews_str[PREVIEW_TAE] + ")",
830830
true, &params.taesd_preview},
831-
{"",
832-
"--preview-noisy",
833-
"enables previewing noisy inputs of the models rather than the denoised outputs",
834-
true, &params.preview_noisy}
835-
};
831+
{"",
832+
"--preview-noisy",
833+
"enables previewing noisy inputs of the models rather than the denoised outputs",
834+
true, &params.preview_noisy}};
836835

837836
auto on_mode_arg = [&](int argc, const char** argv, int index) {
838837
if (++index >= argc) {

latent-preview.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const float sd_latent_rgb_proj[4][3]{
126126
{0.3250f, 0.4974f, 0.2350f},
127127
{-0.2829f, 0.1762f, 0.2721f},
128128
{-0.2120f, -0.2616f, -0.7177f}};
129-
float sd_latent_rgb_bias[3] = {0,0,0};
129+
float sd_latent_rgb_bias[3] = {0, 0, 0};
130130

131131
void preview_latent_video(uint8_t* buffer, struct ggml_tensor* latents, const float (*latent_rgb_proj)[3], const float latent_rgb_bias[3], int width, int height, int frames, int dim) {
132132
size_t buffer_head = 0;
@@ -135,7 +135,7 @@ void preview_latent_video(uint8_t* buffer, struct ggml_tensor* latents, const fl
135135
for (int i = 0; i < width; i++) {
136136
size_t latent_id = (i * latents->nb[0] + j * latents->nb[1] + k * latents->nb[2]);
137137
float r = 0, g = 0, b = 0;
138-
if(latent_rgb_proj!=NULL){
138+
if (latent_rgb_proj != NULL) {
139139
for (int d = 0; d < dim; d++) {
140140
float value = *(float*)((char*)latents->data + latent_id + d * latents->nb[ggml_n_dims(latents) - 1]);
141141
r += value * latent_rgb_proj[d][0];
@@ -148,7 +148,7 @@ void preview_latent_video(uint8_t* buffer, struct ggml_tensor* latents, const fl
148148
g = *(float*)((char*)latents->data + latent_id + 1 * latents->nb[ggml_n_dims(latents) - 1]);
149149
b = *(float*)((char*)latents->data + latent_id + 2 * latents->nb[ggml_n_dims(latents) - 1]);
150150
}
151-
if(latent_rgb_bias!=NULL){
151+
if (latent_rgb_bias != NULL) {
152152
// bias
153153
r += latent_rgb_bias[0];
154154
g += latent_rgb_bias[1];

stable-diffusion.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ class StableDiffusionGGML {
369369
diffusion_model = std::make_shared<MMDiTModel>(backend,
370370
offload_params_to_cpu,
371371
sd_ctx_params->diffusion_flash_attn,
372-
model_loader.tensor_storages_types);
372+
model_loader.tensor_storages_types);
373373
} else if (sd_version_is_flux(version)) {
374374
bool is_chroma = false;
375375
for (auto pair : model_loader.tensor_storages_types) {
@@ -443,11 +443,11 @@ class StableDiffusionGGML {
443443
"",
444444
enable_vision);
445445
diffusion_model = std::make_shared<QwenImageModel>(backend,
446-
offload_params_to_cpu,
447-
model_loader.tensor_storages_types,
448-
"model.diffusion_model",
449-
version,
450-
sd_ctx_params->diffusion_flash_attn);
446+
offload_params_to_cpu,
447+
model_loader.tensor_storages_types,
448+
"model.diffusion_model",
449+
version,
450+
sd_ctx_params->diffusion_flash_attn);
451451
} else { // SD1.x SD2.x SDXL
452452
if (strstr(SAFE_STR(sd_ctx_params->photo_maker_path), "v2")) {
453453
cond_stage_model = std::make_shared<FrozenCLIPEmbedderWithCustomWords>(clip_backend,
@@ -1157,7 +1157,7 @@ class StableDiffusionGGML {
11571157

11581158
if (preview_mode == PREVIEW_PROJ) {
11591159
const float (*latent_rgb_proj)[channel] = NULL;
1160-
float *latent_rgb_bias = NULL;
1160+
float* latent_rgb_bias = NULL;
11611161

11621162
if (dim == 48) {
11631163
if (sd_version_is_wan(version)) {
@@ -1214,7 +1214,7 @@ class StableDiffusionGGML {
12141214

12151215
uint8_t* data = (uint8_t*)malloc(frames * width * height * channel * sizeof(uint8_t));
12161216

1217-
preview_latent_video(data, latents, latent_rgb_proj,latent_rgb_bias, width, height, frames, dim);
1217+
preview_latent_video(data, latents, latent_rgb_proj, latent_rgb_bias, width, height, frames, dim);
12181218
sd_image_t* images = (sd_image_t*)malloc(frames * sizeof(sd_image_t));
12191219
for (int i = 0; i < frames; i++) {
12201220
images[i] = {width, height, channel, data + i * width * height * channel};
@@ -1274,7 +1274,7 @@ class StableDiffusionGGML {
12741274
}
12751275

12761276
step_callback(step, frames, images, is_noisy);
1277-
1277+
12781278
ggml_tensor_scale(result, 0);
12791279
for (int i = 0; i < frames; i++) {
12801280
free(images[i].data);

0 commit comments

Comments
 (0)