Spaces:
Running
on
T4
Running
on
T4
updating github patches to darkstorm2150
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ os.chdir("/home/user/app/stable-diffusion-webui")
|
|
24 |
|
25 |
# Patch environment
|
26 |
os.system(f'echo "Downloading environment patch script..."')
|
27 |
-
os.system(f"wget https://
|
28 |
os.system(f"sed -i -e '/import image_from_url_text/r /home/user/app/env_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
29 |
|
30 |
# UI customization
|
@@ -62,7 +62,7 @@ os.system(f"sed -i -e 's/outputs=\\[token_counter\\]/outputs=[token_counter], qu
|
|
62 |
|
63 |
# ----------------------------Patch UI Header for Hugging Face Spaces----------------------------
|
64 |
os.system(f'echo "Downloading header_patch.py to customize UI header banners..."')
|
65 |
-
os.system(f"wget https://
|
66 |
|
67 |
os.system(f'echo "Injecting header_patch.py content into modules/ui.py under the demo section..."')
|
68 |
os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
@@ -76,20 +76,20 @@ if "IS_SHARED_UI" in os.environ:
|
|
76 |
|
77 |
# Download shared UI configuration files
|
78 |
os.system(f"echo 'Downloading shared-config.json for UI settings...'")
|
79 |
-
os.system(f"wget https://
|
80 |
|
81 |
os.system(f"echo 'Downloading shared-ui-config.json for layout preferences...'")
|
82 |
-
os.system(f"wget https://
|
83 |
|
84 |
# Launch WebUI with shared settings
|
85 |
os.system(f'echo "Starting WebUI with shared configurations..."')
|
86 |
-
os.system(f"python launch.py --
|
87 |
else:
|
88 |
os.system(f'echo "IS_SHARED_UI IS DISABLED: Setting up custom environment..."')
|
89 |
|
90 |
# Download custom scripts
|
91 |
os.system(f'echo "Installing run_n_times.py script for batch processing..."')
|
92 |
-
os.system(f"wget https://
|
93 |
|
94 |
# Install extensions (commented lines can be activated by removing #)
|
95 |
os.system(f'echo "Installing image browser extension for managing outputs..."')
|
|
|
24 |
|
25 |
# Patch environment
|
26 |
os.system(f'echo "Downloading environment patch script..."')
|
27 |
+
os.system(f"wget https://raw.githubusercontent.com/darkstorm2150/webui/refs/heads/main/env_patch.py -O /home/user/app/env_patch.py")
|
28 |
os.system(f"sed -i -e '/import image_from_url_text/r /home/user/app/env_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
29 |
|
30 |
# UI customization
|
|
|
62 |
|
63 |
# ----------------------------Patch UI Header for Hugging Face Spaces----------------------------
|
64 |
os.system(f'echo "Downloading header_patch.py to customize UI header banners..."')
|
65 |
+
os.system(f"wget https://raw.githubusercontent.com/darkstorm2150/webui/refs/heads/main/header_patch.py -O /home/user/app/header_patch.py")
|
66 |
|
67 |
os.system(f'echo "Injecting header_patch.py content into modules/ui.py under the demo section..."')
|
68 |
os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
|
|
76 |
|
77 |
# Download shared UI configuration files
|
78 |
os.system(f"echo 'Downloading shared-config.json for UI settings...'")
|
79 |
+
os.system(f"wget https://raw.githubusercontent.com/darkstorm2150/webui/refs/heads/main/shared-config.json -O /home/user/app/shared-config.json")
|
80 |
|
81 |
os.system(f"echo 'Downloading shared-ui-config.json for layout preferences...'")
|
82 |
+
os.system(f"wget https://raw.githubusercontent.com/darkstorm2150/webui/refs/heads/main/shared-ui-config.json -O /home/user/app/shared-ui-config.json")
|
83 |
|
84 |
# Launch WebUI with shared settings
|
85 |
os.system(f'echo "Starting WebUI with shared configurations..."')
|
86 |
+
os.system(f"python launch.py --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")
|
87 |
else:
|
88 |
os.system(f'echo "IS_SHARED_UI IS DISABLED: Setting up custom environment..."')
|
89 |
|
90 |
# Download custom scripts
|
91 |
os.system(f'echo "Installing run_n_times.py script for batch processing..."')
|
92 |
+
os.system(f"wget https://raw.githubusercontent.com/darkstorm2150/webui/refs/heads/main/run_n_times.py -O /home/user/app/stable-diffusion-webui/scripts/run_n_times.py")
|
93 |
|
94 |
# Install extensions (commented lines can be activated by removing #)
|
95 |
os.system(f'echo "Installing image browser extension for managing outputs..."')
|