()
| 20 | const appDir = getAppDataDir(); |
| 21 | |
| 22 | export async function checkBasicRequirements() { |
| 23 | let isSetupedConfig = await checkIsSetupedConfig(); |
| 24 | let isCondaInstalled = false, |
| 25 | isPythonInstalled = false, |
| 26 | isTorchInstalled = false, |
| 27 | isComfyUIInstalled = false, |
| 28 | isComfyUIStarted = false, |
| 29 | isCustomComfyEnv = false, |
| 30 | isGitInstalled = false; |
| 31 | if (isSetupedConfig) { |
| 32 | isComfyUIInstalled = await checkIfInstalledComfyUI(); |
| 33 | const appConfig = appConfigManager.getSetupConfig(); |
| 34 | isCustomComfyEnv = appConfig?.isCustomComfyEnv ?? false; |
| 35 | /** |
| 36 | * if user delete ComfyUI, user should re-setup the config |
| 37 | */ |
| 38 | if (!isComfyUIInstalled) { |
| 39 | appConfigManager.delete(CONFIG_KEYS.appSetupConfig); |
| 40 | isSetupedConfig = false; |
| 41 | } |
| 42 | isComfyUIStarted = await comfyuiService.isComfyUIAlive(); |
| 43 | } |
| 44 | isCondaInstalled = await checkIfInstalled("conda"); |
| 45 | isPythonInstalled = !!conda.env?.PYTHON_PATH; |
| 46 | isGitInstalled = await checkIfInstalled("git --version"); |
| 47 | if (isCondaInstalled && isPythonInstalled) { |
| 48 | isTorchInstalled = await verifyIsTorchInstalled() |
| 49 | } |
| 50 | |
| 51 | return { |
| 52 | isCondaInstalled, |
| 53 | isPythonInstalled, |
| 54 | isCustomComfyEnv, |
| 55 | isGitInstalled, |
| 56 | isTorchInstalled, |
| 57 | isComfyUIInstalled, |
| 58 | isComfyUIStarted, |
| 59 | isSetupedConfig, |
| 60 | isBasicModelInstalled: true, |
| 61 | isBasicExtensionInstalled: true, |
| 62 | comfyUIVersion: await checkComfyUIVersion() |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | export async function checkComfyUIVersion() { |
| 67 | try { |
no test coverage detected