mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
further tweaks to model management
- Work around problem with OmegaConf.update() that prevented model names from containing periods. - Fix logic bug in !delete_model that didn't check for existence of model in config file.
This commit is contained in:
parent
9460763eff
commit
088cd2c4dd
@ -1,14 +1,14 @@
|
||||
stable-diffusion-2_1-768:
|
||||
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:
|
||||
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)
|
||||
repo_id: runwayml/stable-diffusion-v1-5
|
||||
format: diffusers
|
||||
@ -16,7 +16,7 @@ stable-diffusion-1_5:
|
||||
default: True
|
||||
vae:
|
||||
repo_id: stabilityai/sd-vae-ft-mse
|
||||
stable-diffusion-1_4:
|
||||
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
|
||||
@ -25,7 +25,7 @@ stable-diffusion-1_4:
|
||||
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 (ckpt version) (4.27 GB)
|
||||
repo_id: runwayml/stable-diffusion-inpainting
|
||||
config: v1-inpainting-inference.yaml
|
||||
@ -37,12 +37,12 @@ inpainting-1_5:
|
||||
recommended: True
|
||||
width: 512
|
||||
height: 512
|
||||
waifu-diffusion-1_4:
|
||||
waifu-diffusion-1.4:
|
||||
description: Latest waifu diffusion 1.4 (diffusers version)
|
||||
format: diffusers
|
||||
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 (ckpt version) (4.27 GB)
|
||||
repo_id: hakurei/waifu-diffusion-v1-3
|
||||
config: v1-inference.yaml
|
||||
@ -54,7 +54,7 @@ waifu-diffusion-1_3:
|
||||
recommended: False
|
||||
width: 512
|
||||
height: 512
|
||||
trinart-2_0:
|
||||
trinart-2.0:
|
||||
description: An SD model finetuned with ~40,000 assorted high resolution manga/anime-style pictures (2.13 GB)
|
||||
repo_id: naclbit/trinart_stable_diffusion_v2
|
||||
format: diffusers
|
||||
@ -73,19 +73,19 @@ trinart_characters-2_0:
|
||||
recommended: False
|
||||
width: 512
|
||||
height: 512
|
||||
anything-4_0:
|
||||
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)
|
||||
repo_id: Fictiverse/Stable_Diffusion_PaperCut_Model
|
||||
format: diffusers
|
||||
vae:
|
||||
repo_id: stabilityai/sd-vae-ft-mse
|
||||
recommended: False
|
||||
voxel_art-1_0:
|
||||
voxel_art-1.0:
|
||||
description: Stable Diffusion trained on voxel art (use "VoxelArt" in your prompts) (4.27 GB)
|
||||
repo_id: Fictiverse/Stable_Diffusion_VoxelArt_Model
|
||||
config: v1-inference.yaml
|
||||
|
@ -613,8 +613,6 @@ def import_diffuser_model(path_or_repo:str, gen, opt, completer)->str:
|
||||
description = model_description):
|
||||
print('** model failed to import')
|
||||
return None
|
||||
if input('Make this the default model? [n] ').startswith(('y','Y')):
|
||||
manager.set_default_model(model_name)
|
||||
return model_name
|
||||
|
||||
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')
|
||||
return None
|
||||
|
||||
if input('Make this the default model? [n] ').startswith(('y','Y')):
|
||||
manager.set_model_default(model_name)
|
||||
return model_name
|
||||
|
||||
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:
|
||||
print("** Can't delete active model. !switch to another model first. **")
|
||||
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.commit(opt.conf)
|
||||
print(f'** {model_name} deleted')
|
||||
|
@ -230,6 +230,9 @@ class ModelManager(object):
|
||||
Delete the named model.
|
||||
'''
|
||||
omega = self.config
|
||||
if model_name not in omega:
|
||||
print(f'** Unknown model {model_name}')
|
||||
return
|
||||
del omega[model_name]
|
||||
if model_name in self.stack:
|
||||
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}"'
|
||||
|
||||
if model_name not in omega:
|
||||
omega[model_name] = dict()
|
||||
OmegaConf.update(omega,model_name,model_attributes,merge=False)
|
||||
omega[model_name] = model_attributes
|
||||
|
||||
if 'weights' in omega[model_name]:
|
||||
omega[model_name]['weights'].replace('\\','/')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user