-
Notifications
You must be signed in to change notification settings - Fork 11
/
runaria3.py
41 lines (35 loc) · 1.17 KB
/
runaria3.py
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
import os, pickle, subprocess
arialines = None
downloadcnet = False
vclvarpath = '/content/vclvariables'
def pickleload(prevvalue, inputfile):
inputpath = os.path.join(vclvarpath, inputfile + '.pkl')
if os.path.exists(inputpath):
with open(inputpath, 'rb') as f:
vartopass = pickle.load(f)
return vartopass
else:
return prevvalue
# Dumped from the main colab
arialines = pickleload(None, 'arialist')
colaboptions = pickleload(None, 'colaboptions')
if colaboptions:
downloadcnet = colaboptions["controlnet"]
downloadmodels = colaboptions["download_model"]
def subprocessing(execline):
try:
print("[1;32m" + execline)
print('[0m')
subprocess.run(execline, shell=True, check=True)
except Exception as e:
print("Exception: " + str(e))
if arialines:
for line in arialines:
if not '4x-UltraSharp.pth' in line:
ariaexecline = line[2:].replace('\\n",', '').replace('/content/stable-diffusion-webui', '/content/volatile-concentration-localux')
if 'ControlNet' in ariaexecline:
if downloadcnet:
subprocessing(ariaexecline)
else:
if downloadmodels:
subprocessing(ariaexecline)