From 9f1bda2a6c37decc7503e4121069c696aa696313 Mon Sep 17 00:00:00 2001 From: telamonian Date: Tue, 27 Aug 2024 01:55:29 -0400 Subject: [PATCH] simplify `standalone` command by removing redundant gpu options --- comfy_cli/cmdline.py | 80 +---------------------------------------- comfy_cli/standalone.py | 4 +-- 2 files changed, 2 insertions(+), 82 deletions(-) diff --git a/comfy_cli/cmdline.py b/comfy_cli/cmdline.py index 13bdd0a..28b619c 100644 --- a/comfy_cli/cmdline.py +++ b/comfy_cli/cmdline.py @@ -568,48 +568,6 @@ def standalone( help="Create standalone Python for specified processor", ), ] = None, - nvidia: Annotated[ - Optional[bool], - typer.Option( - show_default=False, - help="Create standalone Python for Nvidia gpu", - callback=g_gpu_exclusivity.validate, - ), - ] = None, - cuda_version: Annotated[CUDAVersion, typer.Option(show_default=True)] = CUDAVersion.v12_1, - amd: Annotated[ - Optional[bool], - typer.Option( - show_default=False, - help="Create standalone Python for AMD gpu", - callback=g_gpu_exclusivity.validate, - ), - ] = None, - m_series: Annotated[ - Optional[bool], - typer.Option( - show_default=False, - help="Create standalone Python for Mac M-Series gpu", - callback=g_gpu_exclusivity.validate, - ), - ] = None, - intel_arc: Annotated[ - Optional[bool], - typer.Option( - hidden=True, - show_default=False, - help="(Beta support) Create standalone Python for Intel Arc gpu, based on https://github.com/comfyanonymous/ComfyUI/pull/3439", - callback=g_gpu_exclusivity.validate, - ), - ] = None, - cpu: Annotated[ - Optional[bool], - typer.Option( - show_default=False, - help="Create standalone Python for CPU", - callback=g_gpu_exclusivity.validate, - ), - ] = None, rehydrate: Annotated[ bool, typer.Option( @@ -623,48 +581,12 @@ def standalone( platform = utils.get_os() if platform is None else platform proc = utils.get_proc() if proc is None else proc - if cpu: - gpu = GPU_OPTION.CPU - elif nvidia: - gpu = GPU_OPTION.NVIDIA - elif amd: - gpu = GPU_OPTION.AMD - elif m_series: - gpu = GPU_OPTION.MAC_M_SERIES - elif intel_arc: - gpu = GPU_OPTION.INTEL_ARC - else: - if platform == constants.OS.MACOS: - gpu = ui.prompt_select_enum( - "What type of Mac do you have?", - [GPU_OPTION.MAC_M_SERIES, GPU_OPTION.MAC_INTEL], - ) - else: - gpu = ui.prompt_select_enum( - "What GPU do you have?", - [GPU_OPTION.NVIDIA, GPU_OPTION.AMD, GPU_OPTION.INTEL_ARC, GPU_OPTION.CPU], - ) - - if gpu == GPU_OPTION.INTEL_ARC: - print("[bold yellow]Installing on Intel ARC is not yet completely supported[/bold yellow]") - env_check = env_checker.EnvChecker() - if env_check.conda_env is None: - print("[bold red]Intel ARC support requires conda environment to be activated.[/bold red]") - raise typer.Exit(code=1) - if intel_arc is None: - confirm_result = ui.prompt_confirm_action( - "Are you sure you want to try beta install feature on Intel ARC?", True - ) - if not confirm_result: - raise typer.Exit(code=0) - print("[bold yellow]Installing on Intel ARC is in beta stage.[/bold yellow]") - if rehydrate: sty = StandalonePython.FromTarball(fpath="python.tgz") sty.rehydrate_comfy_deps() else: sty = StandalonePython.FromDistro(platform=platform, proc=proc) - sty.dehydrate_comfy_deps(comfyDir=comfy_path, gpu=gpu, extraSpecs=cli_spec) + sty.dehydrate_comfy_deps(comfyDir=comfy_path, extraSpecs=cli_spec) sty.to_tarball() diff --git a/comfy_cli/standalone.py b/comfy_cli/standalone.py index af8b123..e07a242 100644 --- a/comfy_cli/standalone.py +++ b/comfy_cli/standalone.py @@ -10,7 +10,7 @@ from rich.progress import Progress, TextColumn from rich.table import Table -from comfy_cli.constants import GPU_OPTION, OS, PROC +from comfy_cli.constants import OS, PROC from comfy_cli.typing import PathLike from comfy_cli.utils import download_progress, get_os, get_proc from comfy_cli.uv import DependencyCompiler @@ -152,13 +152,11 @@ def install_comfy(self, *args: list[str], gpu_arg: str = "--nvidia"): def dehydrate_comfy_deps( self, comfyDir: PathLike, - gpu: GPU_OPTION, extraSpecs: Optional[list[str]] = None, ): self.dep_comp = DependencyCompiler( cwd=comfyDir, executable=self.executable, - gpu=gpu, outDir=self.rpath, extraSpecs=extraSpecs, )