mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-07-30 23:00:41 -05:00
feat: add flux 1 lite 8B (freepik) support (#474)
* Flux Lite (Freepik) support * format code --------- Co-authored-by: leejet <leejet714@gmail.com>
This commit is contained in:
20
model.cpp
20
model.cpp
@@ -1364,15 +1364,20 @@ bool ModelLoader::init_from_ckpt_file(const std::string& file_path, const std::s
|
||||
|
||||
SDVersion ModelLoader::get_sd_version() {
|
||||
TensorStorage token_embedding_weight;
|
||||
bool is_flux = false;
|
||||
bool is_sd3 = false;
|
||||
bool is_flux = false;
|
||||
bool is_schnell = true;
|
||||
bool is_lite = true;
|
||||
bool is_sd3 = false;
|
||||
for (auto& tensor_storage : tensor_storages) {
|
||||
if (tensor_storage.name.find("model.diffusion_model.guidance_in.in_layer.weight") != std::string::npos) {
|
||||
return VERSION_FLUX_DEV;
|
||||
is_schnell = false;
|
||||
}
|
||||
if (tensor_storage.name.find("model.diffusion_model.double_blocks.") != std::string::npos) {
|
||||
is_flux = true;
|
||||
}
|
||||
if (tensor_storage.name.find("model.diffusion_model.double_blocks.8") != std::string::npos) {
|
||||
is_lite = false;
|
||||
}
|
||||
if (tensor_storage.name.find("joint_blocks.0.x_block.attn2.ln_q.weight") != std::string::npos) {
|
||||
return VERSION_SD3_5_2B;
|
||||
}
|
||||
@@ -1403,7 +1408,14 @@ SDVersion ModelLoader::get_sd_version() {
|
||||
}
|
||||
}
|
||||
if (is_flux) {
|
||||
return VERSION_FLUX_SCHNELL;
|
||||
if (is_schnell) {
|
||||
GGML_ASSERT(!is_lite);
|
||||
return VERSION_FLUX_SCHNELL;
|
||||
} else if (is_lite) {
|
||||
return VERSION_FLUX_LITE;
|
||||
} else {
|
||||
return VERSION_FLUX_DEV;
|
||||
}
|
||||
}
|
||||
if (is_sd3) {
|
||||
return VERSION_SD3_2B;
|
||||
|
||||
Reference in New Issue
Block a user