mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-07-29 14:20:57 -05:00
feat: support for SDXS-512 model (#1180)
* feat: add U-Net specials of SDXS * docs: update distilled_sd.md for SDXS-512 * feat: for SDXS use AutoencoderTiny as the primary VAE * docs: update distilled_sd.md for SDXS-512 * fix: SDXS code cleaning after review by stduhpf * format code * fix sdxs with --taesd-preview-only --------- Co-authored-by: leejet <leejet714@gmail.com>
This commit is contained in:
@@ -1038,6 +1038,7 @@ SDVersion ModelLoader::get_sd_version() {
|
||||
int64_t patch_embedding_channels = 0;
|
||||
bool has_img_emb = false;
|
||||
bool has_middle_block_1 = false;
|
||||
bool has_output_block_71 = false;
|
||||
|
||||
for (auto& [name, tensor_storage] : tensor_storage_map) {
|
||||
if (!(is_xl)) {
|
||||
@@ -1094,6 +1095,9 @@ SDVersion ModelLoader::get_sd_version() {
|
||||
tensor_storage.name.find("unet.mid_block.resnets.1.") != std::string::npos) {
|
||||
has_middle_block_1 = true;
|
||||
}
|
||||
if (tensor_storage.name.find("model.diffusion_model.output_blocks.7.1") != std::string::npos) {
|
||||
has_output_block_71 = true;
|
||||
}
|
||||
if (tensor_storage.name == "cond_stage_model.transformer.text_model.embeddings.token_embedding.weight" ||
|
||||
tensor_storage.name == "cond_stage_model.model.token_embedding.weight" ||
|
||||
tensor_storage.name == "text_model.embeddings.token_embedding.weight" ||
|
||||
@@ -1155,6 +1159,9 @@ SDVersion ModelLoader::get_sd_version() {
|
||||
return VERSION_SD1_PIX2PIX;
|
||||
}
|
||||
if (!has_middle_block_1) {
|
||||
if (!has_output_block_71) {
|
||||
return VERSION_SDXS;
|
||||
}
|
||||
return VERSION_SD1_TINY_UNET;
|
||||
}
|
||||
return VERSION_SD1;
|
||||
|
||||
Reference in New Issue
Block a user