mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-03 22:58:58 +00:00
Compatibility for ldm .yaml configs (#2247)
This commit is contained in:
@@ -313,10 +313,12 @@ def forge_loader(sd, additional_state_dicts=None):
|
||||
has_prediction_type = 'scheduler' in huggingface_components and hasattr(huggingface_components['scheduler'], 'config') and 'prediction_type' in huggingface_components['scheduler'].config
|
||||
|
||||
if yaml_config is not None:
|
||||
model_config_params = yaml_config.get('model', {}).get('params', {})
|
||||
if "parameterization" in model_config_params:
|
||||
if model_config_params["parameterization"] == "v":
|
||||
yaml_config_prediction_type = 'v_prediction'
|
||||
yaml_config_prediction_type: str = (
|
||||
yaml_config.get('model', {}).get('params', {}).get('parameterization', '')
|
||||
or yaml_config.get('model', {}).get('params', {}).get('denoiser_config', {}).get('params', {}).get('scaling_config').get('target', '')
|
||||
)
|
||||
if yaml_config_prediction_type == 'v' or yaml_config_prediction_type.endswith(".VScaling"):
|
||||
yaml_config_prediction_type = 'v_prediction'
|
||||
|
||||
if has_prediction_type:
|
||||
if yaml_config_prediction_type is not None:
|
||||
|
||||
Reference in New Issue
Block a user