Diffusers 0.28 compatibility
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"_class_name": "AutoencoderKL",
|
||||
"_diffusers_version": "0.8.0",
|
||||
"_name_or_path": "hf-models/stable-diffusion-v2-768x768/vae",
|
||||
"act_fn": "silu",
|
||||
"block_out_channels": [
|
||||
128,
|
||||
256,
|
||||
512,
|
||||
512
|
||||
],
|
||||
"down_block_types": [
|
||||
"DownEncoderBlock2D",
|
||||
"DownEncoderBlock2D",
|
||||
"DownEncoderBlock2D",
|
||||
"DownEncoderBlock2D"
|
||||
],
|
||||
"in_channels": 3,
|
||||
"latent_channels": 4,
|
||||
"layers_per_block": 2,
|
||||
"norm_num_groups": 32,
|
||||
"out_channels": 3,
|
||||
"sample_size": 512,
|
||||
"up_block_types": [
|
||||
"UpDecoderBlock2D",
|
||||
"UpDecoderBlock2D",
|
||||
"UpDecoderBlock2D",
|
||||
"UpDecoderBlock2D"
|
||||
]
|
||||
}
|
||||
@@ -74,15 +74,15 @@ class geowizard_model_loader:
|
||||
self.current_config = custom_config
|
||||
# setup pretrained models
|
||||
original_config = OmegaConf.load(os.path.join(script_directory, f"configs/v1-inference.yaml"))
|
||||
vae_config = OmegaConf.load(os.path.join(script_directory, f"configs/vae_config.yaml"))
|
||||
|
||||
dtype = convert_dtype(dtype)
|
||||
|
||||
from diffusers.loaders.single_file_utils import (convert_ldm_vae_checkpoint, create_vae_diffusers_config)
|
||||
from diffusers.loaders.single_file_utils import (convert_ldm_vae_checkpoint)
|
||||
|
||||
sd = vae.get_sd()
|
||||
converted_vae_config = create_vae_diffusers_config(original_config, image_size=512)
|
||||
converted_vae = convert_ldm_vae_checkpoint(sd, converted_vae_config)
|
||||
self.vae = AutoencoderKL(**converted_vae_config)
|
||||
converted_vae = convert_ldm_vae_checkpoint(sd, vae_config)
|
||||
self.vae = AutoencoderKL(**vae_config)
|
||||
self.vae.load_state_dict(converted_vae, strict=False)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user