sd_models_types.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from ldm.models.diffusion.ddpm import LatentDiffusion
  2. from typing import TYPE_CHECKING
  3. if TYPE_CHECKING:
  4. from modules.sd_models import CheckpointInfo
  5. class WebuiSdModel(LatentDiffusion):
  6. """This class is not actually instantinated, but its fields are created and fieeld by webui"""
  7. lowvram: bool
  8. """True if lowvram/medvram optimizations are enabled -- see modules.lowvram for more info"""
  9. sd_model_hash: str
  10. """short hash, 10 first characters of SHA1 hash of the model file; may be None if --no-hashing flag is used"""
  11. sd_model_checkpoint: str
  12. """path to the file on disk that model weights were obtained from"""
  13. sd_checkpoint_info: 'CheckpointInfo'
  14. """structure with additional information about the file with model's weights"""
  15. is_sdxl: bool
  16. """True if the model's architecture is SDXL or SSD"""
  17. is_ssd: bool
  18. """True if the model is SSD"""
  19. is_sd2: bool
  20. """True if the model's architecture is SD 2.x"""
  21. is_sd1: bool
  22. """True if the model's architecture is SD 1.x"""
  23. is_sd3: bool
  24. """True if the model's architecture is SD 3"""
  25. latent_channels: int
  26. """number of layer in latent image representation; will be 16 in SD3 and 4 in other version"""