comfyui is now working

This commit is contained in:
Saifeddine ALOUI 2024-03-18 00:31:20 +01:00
parent d5ee445164
commit 37a2c2366c
2 changed files with 18 additions and 0 deletions

View File

@ -87,6 +87,7 @@ def install_comfyui(lollms_app:LollmsApplication):
lollms_app.comfyui = LollmsComfyUI(lollms_app)
ASCIIColors.green("Comfyui installed successfully")
lollms_app.HideBlockingMessage()
def get_comfyui(lollms_paths:LollmsPaths):

View File

@ -57,6 +57,23 @@ def create_conda_env(env_name, python_version):
# Create a new Conda environment with the specified Python version
#run_command(Commands.CREATE, "-n", env_name, f"python={python_version}")
def run_pip_in_env(env_name, pip_args, cwd=None):
from conda.cli.python_api import run_command, Commands
import platform
# Set the current working directory if provided, otherwise use the current directory
if cwd is None:
cwd = os.getcwd()
# Activate the Conda environment
python_path = Path(sys.executable).parent.parent/"miniconda3"/"envs"/env_name/"python"
process = subprocess.Popen(f'{python_path} -m pip {pip_args}', shell=True)
# Wait for the process to finish
process.wait()
#subprocess.Popen(f'conda activate {env_name} && {script_path}', shell=True, cwd=cwd)
#run_command(Commands.RUN, "-n", env_name, "python " + str(script_path), cwd=cwd)
def run_python_script_in_env(env_name, script_path, cwd=None):
from conda.cli.python_api import run_command, Commands
import platform