File size: 1,876 Bytes
e145aad
 
 
 
 
97efb33
 
e145aad
97efb33
 
 
e145aad
97efb33
 
 
e145aad
 
97efb33
 
 
 
 
 
e145aad
 
97efb33
 
e145aad
 
 
 
 
 
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
import subprocess #line:1
import threading #line:2
import sys #line:3
import os #line:4
os .environ ['LD_PRELOAD']='/home/studio-lab-user/.conda/envs/default/lib/libtcmalloc_minimal.so.4'#line:6
def zrok_launch (OO0OOOO00O0OO0O00 ,OO0000O0O0OO00O00 ):#line:8
    subprocess .run (f"mkdir -p /tmp/models /tmp/ControlNet",shell =True ,stdout =subprocess .DEVNULL ,stderr =subprocess .DEVNULL )#line:14
    try :#line:16
        O0000O000OO0OOO00 =subprocess .Popen (['python','zrok.py',OO0OOOO00O0OO0O00 ],stdout =subprocess .PIPE ,stderr =subprocess .PIPE ,text =True )#line:17
        OOO0O000OOO00000O =subprocess .Popen (['python','webui.py']+OO0000O0O0OO00O00 ,stdout =sys .stdout ,stderr =sys .stdout ,text =True )#line:19
        def OO0000OO0000O00OO (O0OOOOOOOO0OO00O0 ):#line:21
            try :#line:22
                if O0OOOOOOOO0OO00O0 .stdout is not None :#line:23
                    for O0O000O000OOO0O0O in O0OOOOOOOO0OO00O0 .stdout :#line:24
                        print (O0O000O000OOO0O0O .strip ())#line:25
            except Exception :#line:27
                pass #line:28
        OO0O0OO000O0OOO00 =threading .Thread (target =OO0000OO0000O00OO ,args =(O0000O000OO0OOO00 ,))#line:30
        O0OOOO0O000O00OO0 =threading .Thread (target =OO0000OO0000O00OO ,args =(OOO0O000OOO00000O ,))#line:31
        OO0O0OO000O0OOO00 .start ()#line:33
        O0OOOO0O000O00OO0 .start ()#line:34
        OO0O0OO000O0OOO00 .join ()#line:36
        O0OOOO0O000O00OO0 .join ()#line:37
    except KeyboardInterrupt :#line:39
        pass #line:40
    except Exception as O0000OO000000OOO0 :#line:42
        print ("Error:",str (O0000OO000000OOO0 ))#line:43
if __name__ =="__main__":#line:45
    if len (sys .argv )<2 :#line:46
        sys .exit (1 )#line:47
    token =sys .argv [1 ]#line:49
    launch_args =sys .argv [2 :]#line:50
    zrok_launch (token ,launch_args )