mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-04-08 11:24:14 +00:00
Added upgrade comfyui
This commit is contained in:
parent
f02dfa01a3
commit
45d9f98e98
@ -47,6 +47,30 @@ def install_comfyui():
|
||||
lollmsElfServer.InfoMessage(f"It looks like I could not install Comfyui because of this error:\n{ex}\nThis is commonly caused by a previous version that I couldn't delete. PLease remove {lollmsElfServer.lollms_paths.personal_path}/shared/comfyui manually then try again")
|
||||
return {"status":False, 'error':str(ex)}
|
||||
|
||||
@router.get("/upgrade_comfyui")
|
||||
def upgrade_comfyui():
|
||||
try:
|
||||
if lollmsElfServer.config.headless_server_mode:
|
||||
return {"status":False,"error":"Service upgrade is blocked when in headless mode for obvious security reasons!"}
|
||||
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
return {"status":False,"error":"Service upgrade is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
|
||||
lollmsElfServer.ShowBlockingMessage("Upgrading comfyui server\nPlease stand by")
|
||||
from lollms.services.comfyui.lollms_comfyui import upgrade_comfyui
|
||||
upgrade_comfyui(lollmsElfServer)
|
||||
ASCIIColors.success("Done")
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
return {"status":True}
|
||||
|
||||
|
||||
except Exception as ex:
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
lollmsElfServer.InfoMessage(f"It looks like I could not install Comfyui because of this error:\n{ex}\nThis is commonly caused by a previous version that I couldn't delete. PLease remove {lollmsElfServer.lollms_paths.personal_path}/shared/comfyui manually then try again")
|
||||
return {"status":False, 'error':str(ex)}
|
||||
|
||||
|
||||
|
||||
@router.get("/start_comfyui")
|
||||
def start_comfyui():
|
||||
try:
|
||||
|
@ -47,6 +47,30 @@ def install_sd():
|
||||
lollmsElfServer.InfoMessage(f"It looks like I could not install SD because of this error:\n{ex}\nThis is commonly caused by a previous version that I couldn't delete. PLease remove {lollmsElfServer.lollms_paths.personal_path}/shared/auto_sd manually then try again")
|
||||
return {"status":False, 'error':str(ex)}
|
||||
|
||||
|
||||
@router.get("/upgrade_sd")
|
||||
def upgrade_sd():
|
||||
try:
|
||||
if lollmsElfServer.config.headless_server_mode:
|
||||
return {"status":False,"error":"Service installation is blocked when in headless mode for obvious security reasons!"}
|
||||
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
return {"status":False,"error":"Service installation is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
|
||||
lollmsElfServer.ShowBlockingMessage("Installing SD api server\nPlease stand by")
|
||||
from lollms.services.sd.lollms_sd import upgrade_sd
|
||||
upgrade_sd(lollmsElfServer)
|
||||
ASCIIColors.success("Done")
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
return {"status":True}
|
||||
except Exception as ex:
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
lollmsElfServer.InfoMessage(f"It looks like I could not install SD because of this error:\n{ex}\nThis is commonly caused by a previous version that I couldn't delete. PLease remove {lollmsElfServer.lollms_paths.personal_path}/shared/auto_sd manually then try again")
|
||||
return {"status":False, 'error':str(ex)}
|
||||
|
||||
|
||||
|
||||
|
||||
@router.get("/start_sd")
|
||||
def start_sd():
|
||||
try:
|
||||
|
@ -74,9 +74,14 @@ def install_comfyui(lollms_app:LollmsApplication):
|
||||
|
||||
subprocess.run(["git", "clone", "https://github.com/ParisNeo/ComfyUI.git", str(comfyui_folder)])
|
||||
subprocess.run(["git", "clone", "https://github.com/ParisNeo/ComfyUI-Manager.git", str(comfyui_folder/"custom_nodes/ComfyUI-Manager")])
|
||||
subprocess.run(["git", "clone", "https://github.com/jags111/efficiency-nodes-comfyui.git", str(comfyui_folder/"custom_nodes/efficiency-nodes-comfyui")])
|
||||
if show_yes_no_dialog("warning!","Do you want to install a model from civitai?\nIsuggest Juggernaut XL."):
|
||||
subprocess.run(["git", "clone", "https://github.com/jags111/efficiency-nodes-comfyui.git", str(comfyui_folder/"custom_nodes/efficiency-nodes-comfyui")])
|
||||
|
||||
if show_yes_no_dialog("warning!","Do you want to install an image model from civitai?\nIsuggest Juggernaut XL."):
|
||||
download_file("https://civitai.com/api/download/models/357609", comfyui_folder/"models/checkpoints","Juggernaut_XL.safetensors")
|
||||
|
||||
if show_yes_no_dialog("warning!","Do you want to install a video model from hugging face?\nIsuggest SVD XL."):
|
||||
download_file("https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt/blob/main/svd_xt.safetensors", comfyui_folder/"models/checkpoints","svd_xt.safetensors")
|
||||
|
||||
create_conda_env("comfyui","3.10")
|
||||
if lollms_app.config.hardware_mode in ["nvidia", "nvidia-tensorcores"]:
|
||||
run_python_script_in_env("comfyui", "-m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121")
|
||||
@ -90,6 +95,19 @@ def install_comfyui(lollms_app:LollmsApplication):
|
||||
ASCIIColors.green("Comfyui installed successfully")
|
||||
lollms_app.HideBlockingMessage()
|
||||
|
||||
def upgrade_comfyui(lollms_app:LollmsApplication):
|
||||
root_dir = lollms_app.lollms_paths.personal_path
|
||||
shared_folder = root_dir/"shared"
|
||||
comfyui_folder = shared_folder / "comfyui"
|
||||
if not comfyui_folder.exists():
|
||||
lollms_app.InfoMessage("Comfyui is not installed, install it first")
|
||||
return
|
||||
|
||||
subprocess.run(["git", "pull", str(comfyui_folder)])
|
||||
subprocess.run(["git", "pull", str(comfyui_folder/"custom_nodes/ComfyUI-Manager")])
|
||||
subprocess.run(["git", "pull", str(comfyui_folder/"custom_nodes/efficiency-nodes-comfyui")])
|
||||
ASCIIColors.success("DONE")
|
||||
|
||||
|
||||
def get_comfyui(lollms_paths:LollmsPaths):
|
||||
root_dir = lollms_paths.personal_path
|
||||
|
@ -80,6 +80,37 @@ def install_sd(lollms_app:LollmsApplication):
|
||||
ASCIIColors.green("Stable diffusion installed successfully")
|
||||
|
||||
|
||||
def upgrade_sd(lollms_app:LollmsApplication):
|
||||
root_dir = lollms_app.lollms_paths.personal_path
|
||||
shared_folder = root_dir/"shared"
|
||||
sd_folder = shared_folder / "auto_sd"
|
||||
if sd_folder.exists():
|
||||
if show_yes_no_dialog("warning!","I have detected that there is a previous installation of stable diffusion.\nShould I remove it and continue installing?"):
|
||||
shutil.rmtree(sd_folder)
|
||||
elif not show_yes_no_dialog("warning!","Continue installation?"):
|
||||
return
|
||||
|
||||
ASCIIColors.cyan("Installing autosd conda environment with python 3.10")
|
||||
create_conda_env("autosd","3.10")
|
||||
ASCIIColors.cyan("Done")
|
||||
|
||||
subprocess.run(["git", "clone", "https://github.com/ParisNeo/stable-diffusion-webui.git", str(sd_folder)])
|
||||
subprocess.run(["git", "clone", "https://github.com/ParisNeo/SD-CN-Animation.git", str(sd_folder/"extensions/SD-CN-Animation")])
|
||||
|
||||
|
||||
def upgrade_sd(lollms_app:LollmsApplication):
|
||||
root_dir = lollms_app.lollms_paths.personal_path
|
||||
shared_folder = root_dir/"shared"
|
||||
sd_folder = shared_folder / "auto_sd"
|
||||
if not sd_folder.exists():
|
||||
lollms_app.InfoMessage("Comfyui is not installed, install it first")
|
||||
return
|
||||
|
||||
subprocess.run(["git", "pull", str(sd_folder)])
|
||||
subprocess.run(["git", "pull", str(sd_folder/"extensions/SD-CN-Animation")])
|
||||
ASCIIColors.success("DONE")
|
||||
|
||||
|
||||
def get_sd(lollms_paths:LollmsPaths):
|
||||
root_dir = lollms_paths.personal_path
|
||||
shared_folder = root_dir/"shared"
|
||||
|
Loading…
x
Reference in New Issue
Block a user