revise kernel

and add unused files
This commit is contained in:
lllyasviel
2024-08-07 16:51:24 -07:00
committed by GitHub
parent a07c758658
commit a6baf4a4b5
11 changed files with 700 additions and 52 deletions

View File

@@ -58,7 +58,7 @@ def model():
model_path = os.path.join(paths.models_path, "VAE-approx", model_name)
download_model(model_path, 'https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/download/v1.0.0-pre/' + model_name)
loaded_model = VAEApprox(latent_channels=shared.sd_model.latent_channels)
loaded_model = VAEApprox(latent_channels=shared.sd_model.forge_objects.vae.latent_channels)
loaded_model.load_state_dict(torch.load(model_path, map_location='cpu' if devices.device.type != 'cuda' else None))
loaded_model.eval()
loaded_model.to(devices.device, devices.dtype)