File size: 592 Bytes
8d3f4a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import shlex
import subprocess
from pathlib import Path
from IPython import get_ipython

list_1 = [
    "rm -rf ~/tmp/* ~/tmp ~/ComfyUI/models/checkpoints ~/ComfyUI/models/loras ~/ComfyUI/models/controlnet"
]

list_2 = [
    "ln -vs /tmp ~/tmp",
    "ln -vs /tmp/ckpt ~/ComfyUI/models/checkpoints",
    "ln -vs /tmp/lora ~/ComfyUI/models/loras",
    "ln -vs /tmp/controlnet ~/ComfyUI/models/controlnet"
]

for cmd in list_1:
    get_ipython().system(cmd)

for cmd in list_2:
    run = shlex.split(cmd)
    run = [str(Path(arg).expanduser()) for arg in run]
    subprocess.run(run, check=True)