Skip to content

Commit

Permalink
put install script in install_comfyui
Browse files Browse the repository at this point in the history
  • Loading branch information
PladsElsker committed Nov 5, 2023
1 parent dd19991 commit 59b42ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
17 changes: 16 additions & 1 deletion install_comfyui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,27 @@
default_install_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ComfyUI')


def main(install_location):
def main(install_location, should_install_manager=False):
import git
git_repo_url = 'https://github.com/comfyanonymous/ComfyUI.git'
os.mkdir(install_location)
git.Repo.clone_from(git_repo_url, install_location)

if should_install_manager:
manager_location = manager_location_from_comfyui_location(install_location)
install_manager(manager_location)


def install_manager(manager_location):
import git
git_repo_url = 'https://github.com/ltdrdata/ComfyUI-Manager.git'
os.mkdir(manager_location)
git.Repo.clone_from(git_repo_url, manager_location)


def manager_location_from_comfyui_location(comfyui_location):
return os.path.join(comfyui_location, 'custom_nodes', 'ComfyUI-Manager')


def update(install_location):
print("[sd-webui-comfyui]", f"Updating comfyui at {install_location}...")
Expand Down
20 changes: 0 additions & 20 deletions install_comfyui_manager.py

This file was deleted.

7 changes: 1 addition & 6 deletions lib_comfyui/webui/tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import textwrap
import gradio as gr
import install_comfyui
import install_comfyui_manager
from lib_comfyui import external_code, ipc
from lib_comfyui.webui import settings, gradio_utils
from lib_comfyui.default_workflow_types import sandbox_tab_workflow_type
Expand Down Expand Up @@ -59,13 +58,9 @@ def automatic_install_comfyui(should_install_manager, install_location):
print(message, file=sys.stderr)
return gr.Markdown.update(message)

install_comfyui.main(install_location)
install_comfyui.main(install_location, should_install_manager)
shared.opts.comfyui_install_location = install_location

if should_install_manager:
manager_install_location = os.path.join(install_location, 'custom_nodes', 'ComfyUI-Manager')
install_comfyui_manager.main(manager_install_location)

return gr.Markdown.update('Installed! Now please reload the UI.')


Expand Down

0 comments on commit 59b42ad

Please sign in to comment.