diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-22 19:05:03 +0300 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-22 19:05:03 +0300 |
commit | 3ec5ce941626c3c5ff4aac884c926ceb4ba60d37 (patch) | |
tree | 3d44d84afa9cf7efec71c8ecf9bd247fc3801a44 /modules/sd_models_types.py | |
parent | 016554e43740e0b7ded75e89255de81270de9d6c (diff) | |
download | stable-diffusion-webui-gfx803-3ec5ce941626c3c5ff4aac884c926ceb4ba60d37.tar.gz |
add type annotations for extra fields of shared.sd_model
Diffstat (limited to 'modules/sd_models_types.py')
-rw-r--r-- | modules/sd_models_types.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/sd_models_types.py b/modules/sd_models_types.py new file mode 100644 index 00000000..5ffd2f4f --- /dev/null +++ b/modules/sd_models_types.py @@ -0,0 +1,31 @@ +from ldm.models.diffusion.ddpm import LatentDiffusion
+from typing import TYPE_CHECKING
+
+
+if TYPE_CHECKING:
+ from modules.sd_models import CheckpointInfo
+
+
+class WebuiSdModel(LatentDiffusion):
+ """This class is not actually instantinated, but its fields are created and fieeld by webui"""
+
+ lowvram: bool
+ """True if lowvram/medvram optimizations are enabled -- see modules.lowvram for more info"""
+
+ sd_model_hash: str
+ """short hash, 10 first characters of SHA1 hash of the model file; may be None if --no-hashing flag is used"""
+
+ sd_model_checkpoint: str
+ """path to the file on disk that model weights were obtained from"""
+
+ sd_checkpoint_info: 'CheckpointInfo'
+ """structure with additional information about the file with model's weights"""
+
+ is_sdxl: bool
+ """True if the model's architecture is SDXL"""
+
+ is_sd2: bool
+ """True if the model's architecture is SD 2.x"""
+
+ is_sd1: bool
+ """True if the model's architecture is SD 1.x"""
|