Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
1a844b7
1
Parent(s):
4e2fb5c
fixed layout and added verification to env variable RUN_ON_SPACES
Browse files- requirements.txt +1 -1
- ui/style.css +13 -4
- ui/ui_config.py +2 -0
- ui/ui_events.py +2 -0
requirements.txt
CHANGED
|
@@ -14,8 +14,8 @@ gradio_folderexplorer
|
|
| 14 |
gradio_mediagallery
|
| 15 |
gradio_creditspanel
|
| 16 |
spaces
|
| 17 |
-
git+https://github.com/DEVAIEXP/sup-toolbox.git@main#egg=sup-toolbox
|
| 18 |
optimum-quanto==0.2.7
|
|
|
|
| 19 |
torch==2.8.0
|
| 20 |
torchvision==0.23.0
|
| 21 |
torchaudio==2.8.0
|
|
|
|
| 14 |
gradio_mediagallery
|
| 15 |
gradio_creditspanel
|
| 16 |
spaces
|
|
|
|
| 17 |
optimum-quanto==0.2.7
|
| 18 |
+
git+https://github.com/DEVAIEXP/sup-toolbox.git@main#egg=sup-toolbox
|
| 19 |
torch==2.8.0
|
| 20 |
torchvision==0.23.0
|
| 21 |
torchaudio==2.8.0
|
ui/style.css
CHANGED
|
@@ -8,12 +8,21 @@ body {
|
|
| 8 |
padding: 0;
|
| 9 |
}
|
| 10 |
|
|
|
|
| 11 |
/* Main application container styling */
|
| 12 |
.gradio-container {
|
| 13 |
border-radius: 15px;
|
| 14 |
-
padding: 10px
|
| 15 |
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
|
| 16 |
-
margin:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
/* Text shadow for main headings for better readability */
|
|
@@ -22,10 +31,10 @@ body {
|
|
| 22 |
}
|
| 23 |
|
| 24 |
/* Utility class to make elements fill their container's width */
|
| 25 |
-
.fillable {
|
| 26 |
width: 100% !important;
|
| 27 |
max-width: unset !important;
|
| 28 |
-
}
|
| 29 |
.fillable .sidebar-parent {
|
| 30 |
padding-left: 10px !important;
|
| 31 |
padding-right: 10px !important;
|
|
|
|
| 8 |
padding: 0;
|
| 9 |
}
|
| 10 |
|
| 11 |
+
/* Main application container styling */
|
| 12 |
/* Main application container styling */
|
| 13 |
.gradio-container {
|
| 14 |
border-radius: 15px;
|
| 15 |
+
padding: 10px 20px;
|
| 16 |
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
|
| 17 |
+
margin: 10px;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
/* 2. Media Query for larger screens (desktops) */
|
| 21 |
+
@media (min-width: 1281px) {
|
| 22 |
+
.gradio-container {
|
| 23 |
+
padding: 10px 370px;
|
| 24 |
+
max-width: 2400px;
|
| 25 |
+
}
|
| 26 |
}
|
| 27 |
|
| 28 |
/* Text shadow for main headings for better readability */
|
|
|
|
| 31 |
}
|
| 32 |
|
| 33 |
/* Utility class to make elements fill their container's width */
|
| 34 |
+
/* .fillable {
|
| 35 |
width: 100% !important;
|
| 36 |
max-width: unset !important;
|
| 37 |
+
} */
|
| 38 |
.fillable .sidebar-parent {
|
| 39 |
padding-left: 10px !important;
|
| 40 |
padding-right: 10px !important;
|
ui/ui_config.py
CHANGED
|
@@ -12,6 +12,7 @@
|
|
| 12 |
# See the License for the specific language governing permissions and
|
| 13 |
# limitations under the License.
|
| 14 |
|
|
|
|
| 15 |
from dataclasses import dataclass, field
|
| 16 |
from typing import List, Literal
|
| 17 |
|
|
@@ -23,6 +24,7 @@ from sup_toolbox.config import PAG_LAYERS
|
|
| 23 |
from sup_toolbox.enums import ImageSizeFixMode, SUPIRModel
|
| 24 |
from sup_toolbox.utils.system import find_dist_info_files, get_module_file
|
| 25 |
|
|
|
|
| 26 |
|
| 27 |
LICENSE_PATHS = {
|
| 28 |
"NOTICE": "./NOTICE",
|
|
|
|
| 12 |
# See the License for the specific language governing permissions and
|
| 13 |
# limitations under the License.
|
| 14 |
|
| 15 |
+
import os
|
| 16 |
from dataclasses import dataclass, field
|
| 17 |
from typing import List, Literal
|
| 18 |
|
|
|
|
| 24 |
from sup_toolbox.enums import ImageSizeFixMode, SUPIRModel
|
| 25 |
from sup_toolbox.utils.system import find_dist_info_files, get_module_file
|
| 26 |
|
| 27 |
+
RUN_ON_SPACES = os.getenv("RUN_ON_SPACES")
|
| 28 |
|
| 29 |
LICENSE_PATHS = {
|
| 30 |
"NOTICE": "./NOTICE",
|
ui/ui_events.py
CHANGED
|
@@ -51,6 +51,7 @@ from ui.ui_config import (
|
|
| 51 |
DEFAULT_PROMPTS,
|
| 52 |
RESTORER_CONFIG_MAPPING,
|
| 53 |
RESTORER_SHEET_DEPENDENCY_RULES,
|
|
|
|
| 54 |
SAMPLER_MAPPING,
|
| 55 |
SUPIR_ADVANCED_RULES,
|
| 56 |
UPSCALER_CONFIG_MAPPING,
|
|
@@ -1555,6 +1556,7 @@ class EventHandlers:
|
|
| 1555 |
|
| 1556 |
# 6. Map all pipeline configuration from UI to SUP-Toolbox Pipeline
|
| 1557 |
config = self.state.uidata.config
|
|
|
|
| 1558 |
config.restorer_engine, config.upscaler_engine = (
|
| 1559 |
RestorerEngine.from_str(res_engine),
|
| 1560 |
UpscalerEngine.from_str(ups_engine),
|
|
|
|
| 51 |
DEFAULT_PROMPTS,
|
| 52 |
RESTORER_CONFIG_MAPPING,
|
| 53 |
RESTORER_SHEET_DEPENDENCY_RULES,
|
| 54 |
+
RUN_ON_SPACES,
|
| 55 |
SAMPLER_MAPPING,
|
| 56 |
SUPIR_ADVANCED_RULES,
|
| 57 |
UPSCALER_CONFIG_MAPPING,
|
|
|
|
| 1556 |
|
| 1557 |
# 6. Map all pipeline configuration from UI to SUP-Toolbox Pipeline
|
| 1558 |
config = self.state.uidata.config
|
| 1559 |
+
config.running_on_spaces = True if RUN_ON_SPACES == "True" else False
|
| 1560 |
config.restorer_engine, config.upscaler_engine = (
|
| 1561 |
RestorerEngine.from_str(res_engine),
|
| 1562 |
UpscalerEngine.from_str(ups_engine),
|