arthur-nvk commited on
Commit
a10bb0f
·
1 Parent(s): b09af95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -29,6 +29,8 @@ os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch.py' /home/user/app/s
29
  # ---------------------------------------------------------------------------------------------------------------------------------------------------
30
 
31
  if "IS_SHARED_UI" in os.environ:
 
 
32
  os.system(f"rm -rfv /home/user/app/stable-diffusion-webui/scripts/")
33
 
34
  os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-config.json -O /home/user/app/shared-config.json")
@@ -41,6 +43,8 @@ if "IS_SHARED_UI" in os.environ:
41
 
42
  os.system(f"python launch.py --force-enable-xformers --disable-console-progressbars --enable-console-prompts --ui-config-file /home/user/app/shared-ui-config.json --ui-settings-file /home/user/app/shared-config.json --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding")
43
  else:
 
 
44
  # Please duplicate this space and delete # character in front of the custom script you want to use or add here more custom scripts with same structure os.system(f"wget -q https://CUSTOM_SCRIPT_URL -O /home/user/app/stable-diffusion-webui/scripts/CUSTOM_SCRIPT_NAME.py")
45
  os.system(f"wget -q https://gist.github.com/camenduru/9ec5f8141db9902e375967e93250860f/raw/d0bcf01786f20107c329c03f8968584ee67be12a/run_n_times.py -O /home/user/app/stable-diffusion-webui/scripts/run_n_times.py")
46
 
@@ -70,16 +74,15 @@ else:
70
  ##os.system(f"wget -q https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v2-1_768-ema-pruned.ckpt")
71
  ##os.system(f"wget -q https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference-v.yaml -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v2-1_768-ema-pruned.yaml")
72
 
73
- os.system(f"echo {os.getenv('MODEL_LINK')} {os.getenv('MODEL_NAME')}")
74
- #os.system(f"wget -q {os.getenv('MODEL_LINK')} -O /home/user/app/stable-diffusion-webui/model.ckpt")
75
  os.system(f"wget -q https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference.yaml -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/{os.getenv('MODEL_NAME')}.yaml")
76
  os.system(f"wget -q {os.getenv('MODEL_LINK')} -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/{os.getenv('MODEL_NAME')}.ckpt")
77
- #os.system(f"cp /home/user/app/stable-diffusion-webui/models/Stable-diffusion/{os.getenv('MODEL_NAME')} /home/user/app/stable-diffusion-webui/model.ckpt")
78
 
79
- os.system(f"echo /home/user/app/stable-diffusion-webui")
80
  os.system(f"ls /home/user/app/stable-diffusion-webui")
81
- os.system(f"echo /home/user/app/stable-diffusion-webui/models/Stable-diffusion")
82
  os.system(f"ls /home/user/app/stable-diffusion-webui/models/Stable-diffusion")
83
 
 
84
  os.system(f"python launch.py --force-enable-xformers --ui-config-file /home/user/app/ui-config.json --ui-settings-file /home/user/app/config.json --disable-console-progressbars --enable-console-prompts --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --api --skip-torch-cuda-test")
85
 
 
29
  # ---------------------------------------------------------------------------------------------------------------------------------------------------
30
 
31
  if "IS_SHARED_UI" in os.environ:
32
+ os.system(f"echo Running in IS_SHARED_UI=true mode.")
33
+
34
  os.system(f"rm -rfv /home/user/app/stable-diffusion-webui/scripts/")
35
 
36
  os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-config.json -O /home/user/app/shared-config.json")
 
43
 
44
  os.system(f"python launch.py --force-enable-xformers --disable-console-progressbars --enable-console-prompts --ui-config-file /home/user/app/shared-ui-config.json --ui-settings-file /home/user/app/shared-config.json --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding")
45
  else:
46
+ os.system(f"echo Running in IS_SHARED_UI=false mode.")
47
+
48
  # Please duplicate this space and delete # character in front of the custom script you want to use or add here more custom scripts with same structure os.system(f"wget -q https://CUSTOM_SCRIPT_URL -O /home/user/app/stable-diffusion-webui/scripts/CUSTOM_SCRIPT_NAME.py")
49
  os.system(f"wget -q https://gist.github.com/camenduru/9ec5f8141db9902e375967e93250860f/raw/d0bcf01786f20107c329c03f8968584ee67be12a/run_n_times.py -O /home/user/app/stable-diffusion-webui/scripts/run_n_times.py")
50
 
 
74
  ##os.system(f"wget -q https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v2-1_768-ema-pruned.ckpt")
75
  ##os.system(f"wget -q https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference-v.yaml -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v2-1_768-ema-pruned.yaml")
76
 
77
+ os.system(f"echo Model link: {os.getenv('MODEL_LINK')}, name: {os.getenv('MODEL_NAME')}")
 
78
  os.system(f"wget -q https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference.yaml -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/{os.getenv('MODEL_NAME')}.yaml")
79
  os.system(f"wget -q {os.getenv('MODEL_LINK')} -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/{os.getenv('MODEL_NAME')}.ckpt")
 
80
 
81
+ os.system(f"echo Printing files in /home/user/app/stable-diffusion-webui")
82
  os.system(f"ls /home/user/app/stable-diffusion-webui")
83
+ os.system(f"echo Printing files in /home/user/app/stable-diffusion-webui/models/Stable-diffusion")
84
  os.system(f"ls /home/user/app/stable-diffusion-webui/models/Stable-diffusion")
85
 
86
+ os.system(f"echo Launching launch.py...")
87
  os.system(f"python launch.py --force-enable-xformers --ui-config-file /home/user/app/ui-config.json --ui-settings-file /home/user/app/config.json --disable-console-progressbars --enable-console-prompts --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --api --skip-torch-cuda-test")
88