def load_state_dict(self, state_dict, strict=True):
        """Load state dictionary into the model.

        Args:
            state_dict (dict): State dictionary to load.
            strict (bool, optional): Whether to strictly enforce that all keys match. Defaults to True.
        """
        core_dict = {}
        additional_dicts = {
            "denoise_encoder": {},
            "information_transformer_layes": {},
            "condition_embedding": {},
            "agg_net": {},
            "spatial_ch_projs": {},
        }

        for key, value in state_dict.items():
            if key.startswith("denoise_encoder."):
                additional_dicts["denoise_encoder"][key[len("denoise_encoder.") :]] = value
            elif key.startswith("information_transformer_layes."):
                additional_dicts["information_transformer_layes"][key[len("information_transformer_layes.") :]] = value
            elif key.startswith("condition_embedding."):
                additional_dicts["condition_embedding"][key[len("condition_embedding.") :]] = value
            elif key.startswith("agg_net."):
                additional_dicts["agg_net"][key[len("agg_net.") :]] = value
            elif key.startswith("spatial_ch_projs."):
                additional_dicts["spatial_ch_projs"][key[len("spatial_ch_projs.") :]] = value
            else:
                core_dict[key] = value

        super().load_state_dict(core_dict, strict=False)
        for module_name, module_dict in additional_dicts.items():
            module = getattr(self, module_name, None)
            if module is not None and module_dict:
                module.load_state_dict(module_dict, strict=strict)
Load state dictionary into the model.

        Args:
            state_dict (dict): State dictionary to load.
            strict (bool, optional): Whether to strictly enforce that all keys match. Defaults to True.
        
examples/community/pipeline_faithdiff_stable_diffusion_xl.py