forked from Astropulse/stable-diffusion-aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.cmd
52 lines (43 loc) · 1.31 KB
/
run.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@echo off
echo Loading Python and Anaconda environment, this may take up to a minute...
set conda_env_name=lda
set paths="%ProgramData%\miniconda3"
set paths=%paths%;"%USERPROFILE%\miniconda3"
set paths=%paths%;"%ProgramData%\anaconda3"
set paths=%paths%;"%USERPROFILE%\anaconda3"
set custom_conda_path=%1
shift
set python=%1
:loop
shift
if [%1]==[] goto afterloop
set python=%python% %1
goto loop
:afterloop
IF NOT %custom_conda_path%=="Select Folder" (
if NOT %custom_conda_path%=="image_server.py" (
set paths=%custom_conda_path%
) else (
set python="image_server.py"
)
)
for %%a in (%paths%) do (
if EXIST "%%a\Scripts\activate.bat" (
SET CONDA_PATH=%%a
::echo anaconda3/miniconda3 detected in %%a
goto :foundPath
)
)
IF "%CONDA_PATH%"=="" (
IF NOT %custom_conda_path%=="Select Folder" (
call color 04 && echo Anaconda3/Miniconda3 not found in custom path: %custom_conda_path%. Please check your settings
) else (
call color 04 && echo Anaconda3/Miniconda3 not found. Please install from here https://docs.conda.io/en/latest/miniconda.html
)
pause
exit
)
:foundPath
call %CONDA_PATH%\Scripts\activate.bat
call %CONDA_PATH%\Scripts\activate.bat "%conda_env_name%"
call python scripts\%python% || color 04 && echo An error has occured. && conda deactivate && timeout /t -1 && exit