style: format code

This commit is contained in:
leejet 2024-01-29 23:05:18 +08:00
parent 36ec16ac99
commit 349439f239
14 changed files with 200 additions and 202 deletions

View File

@ -3,7 +3,6 @@ UseTab: Never
IndentWidth: 4 IndentWidth: 4
TabWidth: 4 TabWidth: 4
AllowShortIfStatementsOnASingleLine: false AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 0 ColumnLimit: 0
AccessModifierOffset: -4 AccessModifierOffset: -4
NamespaceIndentation: All NamespaceIndentation: All

View File

@ -486,7 +486,6 @@ struct ResidualAttentionBlock {
ln2_w = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, hidden_size); ln2_w = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, hidden_size);
ln2_b = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, hidden_size); ln2_b = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, hidden_size);
} }
void map_by_name(std::map<std::string, struct ggml_tensor*>& tensors, const std::string prefix) { void map_by_name(std::map<std::string, struct ggml_tensor*>& tensors, const std::string prefix) {

View File

@ -1,8 +1,8 @@
#ifndef __CONTROL_HPP__ #ifndef __CONTROL_HPP__
#define __CONTROL_HPP__ #define __CONTROL_HPP__
#include "ggml_extend.hpp"
#include "common.hpp" #include "common.hpp"
#include "ggml_extend.hpp"
#include "model.h" #include "model.h"
#define CONTROL_NET_GRAPH_SIZE 1536 #define CONTROL_NET_GRAPH_SIZE 1536
@ -659,7 +659,9 @@ struct ControlNet : public GGMLModule {
bool last = i == num_zero_convs; bool last = i == num_zero_convs;
int c = last ? middle_out_channel : zero_convs[i].channels; int c = last ? middle_out_channel : zero_convs[i].channels;
if (!last && steps == 3) { if (!last && steps == 3) {
w /= 2; h /= 2; steps = 0; w /= 2;
h /= 2;
steps = 0;
} }
controls.push_back(ggml_new_tensor_4d(control_ctx, GGML_TYPE_F32, w, h, c, 1)); controls.push_back(ggml_new_tensor_4d(control_ctx, GGML_TYPE_F32, w, h, c, 1));
control_buffer_size += ggml_nbytes(controls[i]); control_buffer_size += ggml_nbytes(controls[i]);

View File

@ -6,8 +6,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "stable-diffusion.h"
#include "preprocessing.hpp" #include "preprocessing.hpp"
#include "stable-diffusion.h"
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h" #include "stb_image.h"

View File

@ -177,14 +177,12 @@ uint8_t* preprocess_canny(uint8_t* img, int width, int height, float highThresho
float kX[9] = { float kX[9] = {
-1, 0, 1, -1, 0, 1,
-2, 0, 2, -2, 0, 2,
-1, 0, 1 -1, 0, 1};
};
float kY[9] = { float kY[9] = {
1, 2, 1, 1, 2, 1,
0, 0, 0, 0, 0, 0,
-1, -2, -1 -1, -2, -1};
};
// generate kernel // generate kernel
int kernel_size = 5; int kernel_size = 5;

View File

@ -7,8 +7,8 @@
#include "util.h" #include "util.h"
#include "clip.hpp" #include "clip.hpp"
#include "denoiser.hpp"
#include "control.hpp" #include "control.hpp"
#include "denoiser.hpp"
#include "esrgan.hpp" #include "esrgan.hpp"
#include "lora.hpp" #include "lora.hpp"
#include "tae.hpp" #include "tae.hpp"

View File

@ -1,6 +1,6 @@
#include "util.h" #include "util.h"
#include <algorithm>
#include <stdarg.h> #include <stdarg.h>
#include <algorithm>
#include <codecvt> #include <codecvt>
#include <fstream> #include <fstream>
#include <locale> #include <locale>