Spaces:
Runtime error
Runtime error
Commit
•
7f0507b
1
Parent(s):
804e493
Update app.py
Browse files
app.py
CHANGED
@@ -8,11 +8,8 @@ import subprocess
|
|
8 |
import pathlib
|
9 |
import gc
|
10 |
import time
|
11 |
-
|
12 |
-
|
13 |
-
except:
|
14 |
-
start_huggingface= int(time.time())-5
|
15 |
-
|
16 |
def Gitclone(URI:str,ClonePath:pathlib.Path ) -> int :
|
17 |
if pathlib.Path.exists(ClonePath):
|
18 |
return 0
|
@@ -45,6 +42,22 @@ print("cloning stable-diffusion-webui repo")
|
|
45 |
Gitclone(r"https://tinyurl.com/Anapnoe-ux-Repo",user_home / r"stable-diffusion-webui")
|
46 |
os.chdir(str(user_home / r"stable-diffusion-webui"))
|
47 |
os.system("git reset --hard "+commit_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
#install extensions
|
49 |
print("installing extensions")
|
50 |
#Gitclone(r"https://github.com/vorstcavry/embeddings",user_home / r"stable-diffusion-webui" / r"embeddings" / r"negative")
|
@@ -84,21 +97,7 @@ Gitclone(r"https://tinyurl.com/aspect-ratio-v",user_home / r"stable-diffusion-we
|
|
84 |
#Gitclone(r"https://github.com/IDEA-Research/DWPose",user_home / r"stable-diffusion-webui" / r"extensions" / r"DWPose")
|
85 |
#Gitclone(r"https://github.com/Bing-su/adetailer",user_home / r"stable-diffusion-webui" / r"extensions" / r"adetailer")
|
86 |
Gitclone(r"https://github.com/NoCrypt/sd_hf_out",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd_hf_out")
|
87 |
-
Gitclone(r"https://github.com/NoCrypt/ncpt_colab_timer",user_home / r"stable-diffusion-webui" / r"extensions" / r"ncpt_colab_timer")
|
88 |
-
Gitclone(r"https://github.com/vorstcavry/static",user_home / r"stable-diffusion-webui" / r"static")
|
89 |
-
!echo -n {start_huggingface} > /home/user/app/stable-diffusion-webui/static/colabTimer.txt
|
90 |
-
|
91 |
-
import subprocess
|
92 |
-
|
93 |
-
# Replace this with the desired text and file path
|
94 |
-
|
95 |
-
output_file = "/home/user/app/stable-diffusion-webui/static/colabTimer.txt"
|
96 |
|
97 |
-
try:
|
98 |
-
subprocess.run(["echo", "-n", {start_huggingface}], stdout=open(output_file, "w"), shell=True, check=True)
|
99 |
-
print(f"Text has been written to {output_file}")
|
100 |
-
except subprocess.CalledProcessError as e:
|
101 |
-
print(f"An error occurred: {e}")
|
102 |
#Gitclone(r"https://github.com/Iyashinouta/sd-model-downloader",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-model-downloader")
|
103 |
#Gitclone(r"https://github.com/AIrjen/OneButtonPrompt",user_home / r"stable-diffusion-webui" / r"extensions" / r"OneButtonPrompt")
|
104 |
#Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards",user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-wildcards")
|
|
|
8 |
import pathlib
|
9 |
import gc
|
10 |
import time
|
11 |
+
import subprocess
|
12 |
+
|
|
|
|
|
|
|
13 |
def Gitclone(URI:str,ClonePath:pathlib.Path ) -> int :
|
14 |
if pathlib.Path.exists(ClonePath):
|
15 |
return 0
|
|
|
42 |
Gitclone(r"https://tinyurl.com/Anapnoe-ux-Repo",user_home / r"stable-diffusion-webui")
|
43 |
os.chdir(str(user_home / r"stable-diffusion-webui"))
|
44 |
os.system("git reset --hard "+commit_id)
|
45 |
+
os.chdir(user_home / r"stable-diffusion-webui")
|
46 |
+
Gitclone(r"https://github.com/NoCrypt/ncpt_colab_timer",user_home / r"stable-diffusion-webui" / r"extensions" / r"ncpt_colab_timer")
|
47 |
+
Gitclone(r"https://github.com/vorstcavry/static",user_home / r"stable-diffusion-webui" / r"static")
|
48 |
+
|
49 |
+
def run_echo_command():
|
50 |
+
try:
|
51 |
+
start_huggingface
|
52 |
+
except NameError:
|
53 |
+
start_huggingface = int(time.time()) - 5
|
54 |
+
|
55 |
+
cmd = f"echo -n {start_huggingface} > /home/user/app/stable-diffusion-webui/static/colabTimer.txt"
|
56 |
+
subprocess.run(cmd, shell=True)
|
57 |
+
|
58 |
+
# Contoh pemanggilan fungsi run_echo_command:
|
59 |
+
run_echo_command()
|
60 |
+
os.chdir(user_home / r"stable-diffusion-webui")
|
61 |
#install extensions
|
62 |
print("installing extensions")
|
63 |
#Gitclone(r"https://github.com/vorstcavry/embeddings",user_home / r"stable-diffusion-webui" / r"embeddings" / r"negative")
|
|
|
97 |
#Gitclone(r"https://github.com/IDEA-Research/DWPose",user_home / r"stable-diffusion-webui" / r"extensions" / r"DWPose")
|
98 |
#Gitclone(r"https://github.com/Bing-su/adetailer",user_home / r"stable-diffusion-webui" / r"extensions" / r"adetailer")
|
99 |
Gitclone(r"https://github.com/NoCrypt/sd_hf_out",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd_hf_out")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
|
|
|
|
|
|
|
|
|
|
101 |
#Gitclone(r"https://github.com/Iyashinouta/sd-model-downloader",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-model-downloader")
|
102 |
#Gitclone(r"https://github.com/AIrjen/OneButtonPrompt",user_home / r"stable-diffusion-webui" / r"extensions" / r"OneButtonPrompt")
|
103 |
#Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards",user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-wildcards")
|