better handle scan single file diffusion

This commit is contained in:
Qing
2024-04-12 18:52:33 +08:00
parent 0a262fa811
commit 76823355fe
3 changed files with 7 additions and 10 deletions

View File

@@ -68,7 +68,7 @@ def get_sd_model_type(model_abs_path: str) -> ModelType:
if "Trying to set a tensor of shape torch.Size([320, 4, 3, 3])" in str(e):
model_type = ModelType.DIFFUSERS_SD
else:
raise e
logger.info(f"Ignore non sd or sdxl file: {model_abs_path}")
return model_type
@@ -96,7 +96,7 @@ def get_sdxl_model_type(model_abs_path: str) -> ModelType:
if "but got torch.Size([320, 4, 3, 3])" in str(e):
model_type = ModelType.DIFFUSERS_SDXL
else:
raise e
logger.info(f"Ignore non sd or sdxl file: {model_abs_path}")
return model_type