mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-07-29 14:20:57 -05:00
finished get_num_tensors
This commit is contained in:
16
pmid.hpp
16
pmid.hpp
@@ -61,6 +61,11 @@ struct FuseBlock {
|
||||
|
||||
}
|
||||
|
||||
|
||||
size_t get_num_tensors() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
void map_by_name(std::map<std::string, struct ggml_tensor*>& tensors, const std::string prefix) {
|
||||
tensors[prefix + "fc1.weight"] = fc1_w;
|
||||
tensors[prefix + "fc1.bias"] = fc1_b;
|
||||
@@ -130,6 +135,13 @@ struct FuseModule{
|
||||
|
||||
}
|
||||
|
||||
size_t get_num_tensors() {
|
||||
size_t n = mlp1.get_num_tensors();
|
||||
n += mlp2.get_num_tensors();
|
||||
n += 2;
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t calculate_mem_size(ggml_type wtype) {
|
||||
size_t mem_size = mlp1.calculate_mem_size(wtype);
|
||||
mem_size += mlp2.calculate_mem_size(wtype);
|
||||
@@ -213,8 +225,8 @@ struct PhotoMakerIDEncoder : public GGMLModule {
|
||||
}
|
||||
|
||||
size_t get_num_tensors() {
|
||||
size_t num_tensors = (3 + 2 + 37);
|
||||
|
||||
size_t num_tensors = (3 + 2 + 37 * vision_model.num_hidden_layers);
|
||||
num_tensors += fuse_module.get_num_tensors() + 1;
|
||||
return num_tensors;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ public:
|
||||
|
||||
ControlNet control_net;
|
||||
|
||||
std::string trigger_word = "img"; // should be user settable
|
||||
|
||||
StableDiffusionGGML() = default;
|
||||
|
||||
StableDiffusionGGML(int n_threads,
|
||||
|
||||
Reference in New Issue
Block a user