mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-03-04 21:14:54 +08:00
vae fix for flux
This commit is contained in:
parent
7e2d51965f
commit
9c0fd83b5e
@ -270,7 +270,8 @@ class FLUX1Inferencer(torch.nn.Module):
|
|||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
self.model = BaseModel(state_dict=state_dict, prefix=diffusion_model_prefix, device="cpu", dtype=devices.dtype)
|
self.model = BaseModel(state_dict=state_dict, prefix=diffusion_model_prefix, device="cpu", dtype=devices.dtype)
|
||||||
self.first_stage_model = SDVAE(device="cpu", dtype=devices.dtype_vae)
|
self.first_stage_model = SDVAE(device="cpu", dtype=devices.dtype_vae)
|
||||||
self.first_stage_model.dtype = self.model.diffusion_model.dtype
|
self.first_stage_model.dtype = devices.dtype_vae
|
||||||
|
self.vae = self.first_stage_model # real vae
|
||||||
|
|
||||||
self.alphas_cumprod = 1 / (self.model.model_sampling.sigmas ** 2 + 1)
|
self.alphas_cumprod = 1 / (self.model.model_sampling.sigmas ** 2 + 1)
|
||||||
|
|
||||||
|
@ -956,6 +956,8 @@ def load_model(checkpoint_info=None, already_loaded_state_dict=None, checkpoint_
|
|||||||
else:
|
else:
|
||||||
weight_dtype_conversion = {
|
weight_dtype_conversion = {
|
||||||
'first_stage_model': None,
|
'first_stage_model': None,
|
||||||
|
'text_encoders': None,
|
||||||
|
'vae': None,
|
||||||
'alphas_cumprod': None,
|
'alphas_cumprod': None,
|
||||||
'': torch.float16 if loadable_unet_dtype in (torch.float16, torch.float32, torch.bfloat16) else None,
|
'': torch.float16 if loadable_unet_dtype in (torch.float16, torch.float32, torch.bfloat16) else None,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user