mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Compare commits
3 Commits
lstein/fea
...
improve-co
Author | SHA1 | Date | |
---|---|---|---|
bbb48c5475 | |||
e68c49167a | |||
46950a9bd0 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -188,3 +188,4 @@ installer/install.sh
|
|||||||
installer/update.bat
|
installer/update.bat
|
||||||
installer/update.sh
|
installer/update.sh
|
||||||
installer/InvokeAI-Installer/
|
installer/InvokeAI-Installer/
|
||||||
|
.aider*
|
||||||
|
@ -30,8 +30,12 @@ def convert_ldm_vae_to_diffusers(
|
|||||||
converted_vae_checkpoint = convert_ldm_vae_checkpoint(checkpoint, vae_config)
|
converted_vae_checkpoint = convert_ldm_vae_checkpoint(checkpoint, vae_config)
|
||||||
|
|
||||||
vae = AutoencoderKL(**vae_config)
|
vae = AutoencoderKL(**vae_config)
|
||||||
vae.load_state_dict(converted_vae_checkpoint)
|
with torch.no_grad():
|
||||||
vae.to(precision)
|
vae.load_state_dict(converted_vae_checkpoint)
|
||||||
|
del converted_vae_checkpoint # Free memory
|
||||||
|
import gc
|
||||||
|
gc.collect()
|
||||||
|
vae.to(precision)
|
||||||
|
|
||||||
if dump_path:
|
if dump_path:
|
||||||
vae.save_pretrained(dump_path, safe_serialization=True)
|
vae.save_pretrained(dump_path, safe_serialization=True)
|
||||||
@ -52,7 +56,11 @@ def convert_ckpt_to_diffusers(
|
|||||||
model to be written.
|
model to be written.
|
||||||
"""
|
"""
|
||||||
pipe = download_from_original_stable_diffusion_ckpt(Path(checkpoint_path).as_posix(), **kwargs)
|
pipe = download_from_original_stable_diffusion_ckpt(Path(checkpoint_path).as_posix(), **kwargs)
|
||||||
pipe = pipe.to(precision)
|
with torch.no_grad():
|
||||||
|
del kwargs # Free memory
|
||||||
|
import gc
|
||||||
|
gc.collect()
|
||||||
|
pipe = pipe.to(precision)
|
||||||
|
|
||||||
# TO DO: save correct repo variant
|
# TO DO: save correct repo variant
|
||||||
if dump_path:
|
if dump_path:
|
||||||
@ -75,7 +83,11 @@ def convert_controlnet_to_diffusers(
|
|||||||
model to be written.
|
model to be written.
|
||||||
"""
|
"""
|
||||||
pipe = download_controlnet_from_original_ckpt(checkpoint_path.as_posix(), **kwargs)
|
pipe = download_controlnet_from_original_ckpt(checkpoint_path.as_posix(), **kwargs)
|
||||||
pipe = pipe.to(precision)
|
with torch.no_grad():
|
||||||
|
del kwargs # Free memory
|
||||||
|
import gc
|
||||||
|
gc.collect()
|
||||||
|
pipe = pipe.to(precision)
|
||||||
|
|
||||||
# TO DO: save correct repo variant
|
# TO DO: save correct repo variant
|
||||||
if dump_path:
|
if dump_path:
|
||||||
|
Reference in New Issue
Block a user