mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2025-12-28 05:35:00 +00:00
remove old stuff
This commit is contained in:
parent
24cfce26dc
commit
a9f4957a27
@ -379,29 +379,7 @@ def check_fp8(model):
|
||||
|
||||
|
||||
def set_model_type(model, state_dict):
|
||||
model.is_sd1 = False
|
||||
model.is_sd2 = False
|
||||
model.is_sdxl = False
|
||||
model.is_ssd = False
|
||||
model.is_sd3 = False
|
||||
|
||||
if "model.diffusion_model.x_embedder.proj.weight" in state_dict:
|
||||
model.is_sd3 = True
|
||||
model.model_type = ModelType.SD3
|
||||
elif hasattr(model, 'conditioner'):
|
||||
model.is_sdxl = True
|
||||
|
||||
if 'model.diffusion_model.middle_block.1.transformer_blocks.0.attn1.to_q.weight' not in state_dict.keys():
|
||||
model.is_ssd = True
|
||||
model.model_type = ModelType.SSD
|
||||
else:
|
||||
model.model_type = ModelType.SDXL
|
||||
elif hasattr(model.cond_stage_model, 'model'):
|
||||
model.is_sd2 = True
|
||||
model.model_type = ModelType.SD2
|
||||
else:
|
||||
model.is_sd1 = True
|
||||
model.model_type = ModelType.SD1
|
||||
pass
|
||||
|
||||
|
||||
def set_model_fields(model):
|
||||
|
||||
@ -1,39 +1,39 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from modules.sd_models import CheckpointInfo
|
||||
|
||||
|
||||
class WebuiSdModel:
|
||||
"""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 or SSD"""
|
||||
|
||||
is_ssd: bool
|
||||
"""True if the model is SSD"""
|
||||
|
||||
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"""
|
||||
|
||||
is_sd3: bool
|
||||
"""True if the model's architecture is SD 3"""
|
||||
|
||||
latent_channels: int
|
||||
"""number of layer in latent image representation; will be 16 in SD3 and 4 in other version"""
|
||||
# from typing import TYPE_CHECKING
|
||||
#
|
||||
#
|
||||
# if TYPE_CHECKING:
|
||||
# from modules.sd_models import CheckpointInfo
|
||||
#
|
||||
#
|
||||
# class WebuiSdModel:
|
||||
# """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 or SSD"""
|
||||
#
|
||||
# is_ssd: bool
|
||||
# """True if the model is SSD"""
|
||||
#
|
||||
# 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"""
|
||||
#
|
||||
# is_sd3: bool
|
||||
# """True if the model's architecture is SD 3"""
|
||||
#
|
||||
# latent_channels: int
|
||||
# """number of layer in latent image representation; will be 16 in SD3 and 4 in other version"""
|
||||
|
||||
@ -44,7 +44,7 @@ options_templates: dict = None
|
||||
opts: options.Options = None
|
||||
restricted_opts: set[str] = None
|
||||
|
||||
sd_model: sd_models_types.WebuiSdModel = None
|
||||
sd_model = None
|
||||
|
||||
settings_components: dict = None
|
||||
"""assigned from ui.py, a mapping on setting names to gradio components responsible for those settings"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user