Compatibility for ldm .yaml configs (#2247)

This commit is contained in:
catboxanon
2024-11-02 10:16:51 -04:00
committed by GitHub
parent e5b34baae6
commit 90a6970fb7

View File

@@ -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: