enhanced binding

This commit is contained in:
Saifeddine ALOUI 2024-03-24 03:41:45 +01:00
parent e6cb0ec26a
commit 2209934b94
4 changed files with 7 additions and 2 deletions

View File

@ -421,6 +421,7 @@ class LLMBinding:
def add_default_configurations(self, binding_config:TypedConfig):
binding_config.addConfigs([
{"name":"model_name","type":"str","value":'', "help":"Last known model for fast model recovery"},
{"name":"clip_model_name","type":"str","value":'ViT-L-14/openai','options':["ViT-L-14/openai","ViT-H-14/laion2b_s32b_b79k"], "help":"Clip model to be used for images understanding"},
{"name":"caption_model_name","type":"str","value":'blip-large','options':['blip-base', 'git-large-coco', 'blip-large','blip2-2.7b', 'blip2-flan-t5-xl'], "help":"Clip model to be used for images understanding"},
{"name":"vqa_model_name","type":"str","value":'Salesforce/blip-vqa-capfilt-large','options':['Salesforce/blip-vqa-capfilt-large', 'Salesforce/blip-vqa-base', 'Salesforce/blip-image-captioning-large','Salesforce/blip2-opt-2.7b', 'Salesforce/blip2-flan-t5-xxl'], "help":"Salesforce question/answer model"},

View File

@ -49,6 +49,7 @@ def list_bindings():
if card.exists():
try:
bnd = load_config(card)
bnd["name"]=f.stem
bnd["folder"]=f.stem
installed = (lollmsElfServer.lollms_paths.personal_configuration_path/"bindings"/f.stem/f"config.yaml").exists()
bnd["installed"]=installed

View File

@ -76,7 +76,8 @@ async def update_setting(request: Request):
per.model = None
gc.collect()
lollmsElfServer.binding = BindingBuilder().build_binding(lollmsElfServer.config, lollmsElfServer.lollms_paths, InstallOption.INSTALL_IF_NECESSARY, lollmsCom=lollmsElfServer)
lollmsElfServer.model = None
lollmsElfServer.config.model_name = lollmsElfServer.binding.binding_config.model_name
lollmsElfServer.model = lollmsElfServer.binding.build_model()
lollmsElfServer.config.save_config()
ASCIIColors.green("Binding loaded successfully")
except Exception as ex:
@ -98,6 +99,7 @@ async def update_setting(request: Request):
for per in lollmsElfServer.mounted_personalities:
if per is not None:
per.model = None
lollmsElfServer.binding.binding_config.model_name = lollmsElfServer.config.model_name
lollmsElfServer.model = lollmsElfServer.binding.build_model()
if lollmsElfServer.model is not None:
ASCIIColors.yellow("New model OK")

View File

@ -88,7 +88,8 @@ def install_comfyui(lollms_app:LollmsApplication):
download_file("https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt/blob/main/svd_xt.safetensors", comfyui_folder/"models/checkpoints","svd_xt.safetensors")
if show_yes_no_dialog("warning!","Do you want to install all control net models?"):
(comfyui_folder/"models/controlnet").mkdir(parents=True, exist_ok=True)
(comfyui_folder/"models/controlnet").mkdir(parents=True, exist_ok=True)
download_file("https://huggingface.co/thibaud/controlnet-openpose-sdxl-1.0/resolve/main/OpenPoseXL2.safetensors", comfyui_folder/"models/controlnet","OpenPoseXL2.safetensors")
download_file("https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/kohya_controllllite_xl_openpose_anime.safetensors", comfyui_folder/"models/controlnet","kohya_controllllite_xl_openpose_anime.safetensors")
download_file("https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/kohya_controllllite_xl_canny.safetensors", comfyui_folder/"models/controlnet","kohya_controllllite_xl_canny.safetensors")
download_file("https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/kohya_controllllite_xl_depth.safetensors", comfyui_folder/"models/controlnet","kohya_controllllite_xl_depth.safetensors")