hugging-apps/echo-memory
0
1from .sd_vae_decoder import SDVAEDecoder, SDVAEDecoderStateDictConverter2 3 4class SDXLVAEDecoder(SDVAEDecoder):5 def __init__(self, upcast_to_float32=True):6 super().__init__()7 self.scaling_factor = 0.130258 9 @staticmethod10 def state_dict_converter():11 return SDXLVAEDecoderStateDictConverter()12 13 14class SDXLVAEDecoderStateDictConverter(SDVAEDecoderStateDictConverter):15 def __init__(self):16 super().__init__()17 18 def from_diffusers(self, state_dict):19 state_dict = super().from_diffusers(state_dict)20 return state_dict, {"upcast_to_float32": True}21 22 def from_civitai(self, state_dict):23 state_dict = super().from_civitai(state_dict)24 return state_dict, {"upcast_to_float32": True}25 