Merge branch 'main' into lstein-import-safetensors

This commit is contained in:
Lincoln Stein 2023-01-18 10:58:38 -05:00 committed by GitHub
commit b9ab9ffb4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 32 deletions

View File

@ -1,18 +1,32 @@
stable-diffusion-2.1-768:
description: Stable Diffusion version 2.1 diffusers model, trained on 768x768 images (5.21 GB)
repo_id: stabilityai/stable-diffusion-2-1
format: diffusers
recommended: True
stable-diffusion-2.1-base:
description: Stable Diffusion version 2.1 diffusers base model, trained on 512x512 images (5.21 GB)
repo_id: stabilityai/stable-diffusion-2-1-base
format: diffusers
recommended: False
stable-diffusion-1.5: stable-diffusion-1.5:
description: Stable Diffusion version 1.5 weight file (4.27 GB) description: Stable Diffusion version 1.5 weight file (4.27 GB)
repo_id: runwayml/stable-diffusion-v1-5 repo_id: runwayml/stable-diffusion-v1-5
format: diffusers format: diffusers
recommended: True recommended: True
default: True
vae: vae:
repo_id: stabilityai/sd-vae-ft-mse repo_id: stabilityai/sd-vae-ft-mse
default: True stable-diffusion-1.4:
stable-diffusion-2.1: description: The original Stable Diffusion version 1.4 weight file (4.27 GB)
description: Stable Diffusion version 2.1 diffusers model (5.21 GB) repo_id: CompVis/stable-diffusion-v1-4
repo_id: stabilityai/stable-diffusion-2-1 recommended: False
format: diffusers format: diffusers
recommended: True vae:
repo_id: stabilityai/sd-vae-ft-mse
width: 512
height: 512
inpainting-1.5: inpainting-1.5:
description: RunwayML SD 1.5 model optimized for inpainting (4.27 GB) description: RunwayML SD 1.5 model optimized for inpainting (ckpt version) (4.27 GB)
repo_id: runwayml/stable-diffusion-inpainting repo_id: runwayml/stable-diffusion-inpainting
config: v1-inpainting-inference.yaml config: v1-inpainting-inference.yaml
file: sd-v1-5-inpainting.ckpt file: sd-v1-5-inpainting.ckpt
@ -23,19 +37,13 @@ inpainting-1.5:
recommended: True recommended: True
width: 512 width: 512
height: 512 height: 512
stable-diffusion-1.4:
description: The original Stable Diffusion version 1.4 weight file (4.27 GB)
repo_id: CompVis/stable-diffusion-v1-4
recommended: False
format: diffusers
vae:
repo_id: stabilityai/sd-vae-ft-mse
waifu-diffusion-1.4: waifu-diffusion-1.4:
description: Waifu diffusion 1.4 description: Latest waifu diffusion 1.4 (diffusers version)
format: diffusers format: diffusers
repo_id: hakurei/waifu-diffusion repo_id: hakurei/waifu-diffusion
recommended: True
waifu-diffusion-1.3: waifu-diffusion-1.3:
description: Stable Diffusion 1.4 fine tuned on anime-styled images (4.27 GB) description: Stable Diffusion 1.4 fine tuned on anime-styled images (ckpt version) (4.27 GB)
repo_id: hakurei/waifu-diffusion-v1-3 repo_id: hakurei/waifu-diffusion-v1-3
config: v1-inference.yaml config: v1-inference.yaml
file: model-epoch09-float32.ckpt file: model-epoch09-float32.ckpt
@ -53,8 +61,8 @@ trinart-2.0:
recommended: False recommended: False
vae: vae:
repo_id: stabilityai/sd-vae-ft-mse repo_id: stabilityai/sd-vae-ft-mse
trinart_characters-2.0: trinart_characters-2_0:
description: An SD model finetuned with 19.2M anime/manga style images (4.27 GB) description: An SD model finetuned with 19.2M anime/manga style images (ckpt version) (4.27 GB)
repo_id: naclbit/trinart_derrida_characters_v2_stable_diffusion repo_id: naclbit/trinart_derrida_characters_v2_stable_diffusion
config: v1-inference.yaml config: v1-inference.yaml
file: derrida_final.ckpt file: derrida_final.ckpt
@ -65,6 +73,11 @@ trinart_characters-2.0:
recommended: False recommended: False
width: 512 width: 512
height: 512 height: 512
anything-4.0:
description: High-quality, highly detailed anime style images with just a few prompts
format: diffusers
repo_id: andite/anything-v4.0
recommended: False
papercut-1.0: papercut-1.0:
description: SD 1.5 fine-tuned for papercut art (use "PaperCut" in your prompts) (2.13 GB) description: SD 1.5 fine-tuned for papercut art (use "PaperCut" in your prompts) (2.13 GB)
repo_id: Fictiverse/Stable_Diffusion_PaperCut_Model repo_id: Fictiverse/Stable_Diffusion_PaperCut_Model
@ -72,8 +85,6 @@ papercut-1.0:
vae: vae:
repo_id: stabilityai/sd-vae-ft-mse repo_id: stabilityai/sd-vae-ft-mse
recommended: False recommended: False
width: 512
height: 512
voxel_art-1.0: voxel_art-1.0:
description: Stable Diffusion trained on voxel art (use "VoxelArt" in your prompts) (4.27 GB) description: Stable Diffusion trained on voxel art (use "VoxelArt" in your prompts) (4.27 GB)
repo_id: Fictiverse/Stable_Diffusion_VoxelArt_Model repo_id: Fictiverse/Stable_Diffusion_VoxelArt_Model

View File

@ -52,7 +52,7 @@ version of InvokeAI with the option to upgrade to experimental versions later.
find python, then open the Python installer again and choose find python, then open the Python installer again and choose
"Modify" existing installation. "Modify" existing installation.
- Installation requires an up to date version of the Microsoft Visual C libraries. Please install the 2015-2022 libraries available here: https://learn.microsoft.com/en-us/cpp/windows/deploying-native-desktop-applications-visual-cpp?view=msvc-170 - Installation requires an up to date version of the Microsoft Visual C libraries. Please install the 2015-2022 libraries available here: https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170
=== "Mac users" === "Mac users"

View File

@ -613,8 +613,6 @@ def import_diffuser_model(path_or_repo:str, gen, opt, completer)->str:
description = model_description): description = model_description):
print('** model failed to import') print('** model failed to import')
return None return None
if input('Make this the default model? [n] ').startswith(('y','Y')):
manager.set_default_model(model_name)
return model_name return model_name
def import_ckpt_model(path_or_url:str, gen, opt, completer)->str: def import_ckpt_model(path_or_url:str, gen, opt, completer)->str:
@ -647,8 +645,6 @@ def import_ckpt_model(path_or_url:str, gen, opt, completer)->str:
print('** model failed to import') print('** model failed to import')
return None return None
if input('Make this the default model? [n] ').startswith(('y','Y')):
manager.set_model_default(model_name)
return model_name return model_name
def _verify_load(model_name:str, gen)->bool: def _verify_load(model_name:str, gen)->bool:
@ -726,6 +722,9 @@ def del_config(model_name:str, gen, opt, completer):
if model_name == current_model: if model_name == current_model:
print("** Can't delete active model. !switch to another model first. **") print("** Can't delete active model. !switch to another model first. **")
return return
if model_name not in gen.model_manager.config:
print(f"** Unknown model {model_name}")
return
gen.model_manager.del_model(model_name) gen.model_manager.del_model(model_name)
gen.model_manager.commit(opt.conf) gen.model_manager.commit(opt.conf)
print(f'** {model_name} deleted') print(f'** {model_name} deleted')

View File

@ -230,6 +230,9 @@ class ModelManager(object):
Delete the named model. Delete the named model.
''' '''
omega = self.config omega = self.config
if model_name not in omega:
print(f'** Unknown model {model_name}')
return
del omega[model_name] del omega[model_name]
if model_name in self.stack: if model_name in self.stack:
self.stack.remove(model_name) self.stack.remove(model_name)
@ -253,9 +256,8 @@ class ModelManager(object):
assert (clobber or model_name not in omega), f'attempt to overwrite existing model definition "{model_name}"' assert (clobber or model_name not in omega), f'attempt to overwrite existing model definition "{model_name}"'
if model_name not in omega: omega[model_name] = model_attributes
omega[model_name] = dict()
OmegaConf.update(omega,model_name,model_attributes,merge=False)
if 'weights' in omega[model_name]: if 'weights' in omega[model_name]:
omega[model_name]['weights'].replace('\\','/') omega[model_name]['weights'].replace('\\','/')
@ -755,16 +757,20 @@ class ModelManager(object):
print('** Legacy version <= 2.2.5 model directory layout detected. Reorganizing.') print('** Legacy version <= 2.2.5 model directory layout detected. Reorganizing.')
print('** This is a quick one-time operation.') print('** This is a quick one-time operation.')
from shutil import move from shutil import move, rmtree
# transformer files get moved into the hub directory # transformer files get moved into the hub directory
hub = models_dir / 'hub' hub = models_dir / 'hub'
os.makedirs(hub, exist_ok=True) os.makedirs(hub, exist_ok=True)
for model in legacy_locations: for model in legacy_locations:
source = models_dir /model source = models_dir / model
dest = hub / model.stem
print(f'** {source} => {dest}')
if source.exists(): if source.exists():
print(f'** Moving {models_dir / model} into hub') if dest.exists():
move(models_dir / model, hub) rmtree(source)
else:
move(source, dest)
# anything else gets moved into the diffusers directory # anything else gets moved into the diffusers directory
diffusers = models_dir / 'diffusers' diffusers = models_dir / 'diffusers'
@ -775,7 +781,12 @@ class ModelManager(object):
if full_path.is_relative_to(hub) or full_path.is_relative_to(diffusers): if full_path.is_relative_to(hub) or full_path.is_relative_to(diffusers):
continue continue
if Path(dir).match('models--*--*'): if Path(dir).match('models--*--*'):
move(full_path,diffusers) dest = diffusers / dir
print(f'** {full_path} => {dest}')
if dest.exists():
rmtree(full_path)
else:
move(full_path,dest)
# now clean up by removing any empty directories # now clean up by removing any empty directories
empty = [root for root, dirs, files, in os.walk(models_dir) if not len(dirs) and not len(files)] empty = [root for root, dirs, files, in os.walk(models_dir) if not len(dirs) and not len(files)]