suhaib0edux commited on
Commit
151f48a
·
1 Parent(s): 6c70205

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -19
app.py CHANGED
@@ -1,19 +1,16 @@
1
- import gradio as gr
2
-
3
- def run_command(command):
4
- import subprocess
5
- process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
6
- output, error = process.communicate()
7
- return output.decode("utf-8")
8
-
9
- iface = gr.Interface(
10
- fn=run_command,
11
- inputs="text",
12
- outputs="text",
13
- title="Linux Command Runner",
14
- description="Enter a Linux command to run:",
15
- article="https://www.example.com",
16
- examples=[["ls -l"], ["pwd"], ["uname -a"]]
17
- )
18
-
19
- iface.launch(share=True)
 
1
+ import os
2
+ os.chdir(f"/home/user/app")
3
+ os.system(f"git clone -b v2.6 https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui")
4
+ os.chdir(f"/home/user/app/stable-diffusion-webui")
5
+ os.system(f"git lfs install")
6
+ os.system(f"git reset --hard")
7
+ os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch_v2.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
8
+ os.system(f"sed -i -e '253,258d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
9
+ os.system(f"sed -i -e '186,228d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
10
+ os.system(f"sed -i -e '171,178d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
11
+ os.system(f"sed -i -e '108,113d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
12
+ os.system(f"sed -i -e '225,227d' /home/user/app/stable-diffusion-webui/modules/ui_loadsave.py")
13
+ os.system(f"sed -i -e '214,217d' /home/user/app/stable-diffusion-webui/modules/ui_loadsave.py")
14
+ os.system(f"rm -rfv /home/user/app/stable-diffusion-webui/scripts/")
15
+ os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/counterfeit-xl/resolve/main/counterfeitxl_v10.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o counterfeitxl_v10.safetensors")
16
+ os.system(f"python launch.py --cors-allow-origins=* --xformers --theme dark --gradio-queue --ui-settings-file /home/user/app/shared-config_v2.json --ui-config-file /home/user/app/shared-ui-config_v2.json")