Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,78 @@ from huggingface_hub import hf_hub_download
|
|
| 13 |
from aura_sr import AuraSR
|
| 14 |
from gradio_imageslider import ImageSlider
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 17 |
|
| 18 |
# --- # Device and CUDA Setup Check ---
|
|
@@ -100,7 +172,7 @@ css="""
|
|
| 100 |
#main-title h1 {font-size: 2.1em !important;}
|
| 101 |
"""
|
| 102 |
|
| 103 |
-
with gr.Blocks(css=css, theme=
|
| 104 |
|
| 105 |
with gr.Column(elem_id="col-container"):
|
| 106 |
gr.Markdown("# **Photo-Mate-i2i**", elem_id="main-title")
|
|
|
|
| 13 |
from aura_sr import AuraSR
|
| 14 |
from gradio_imageslider import ImageSlider
|
| 15 |
|
| 16 |
+
from gradio.themes import Soft
|
| 17 |
+
from gradio.themes.utils import colors, fonts, sizes
|
| 18 |
+
|
| 19 |
+
colors.orange_red = colors.Color(
|
| 20 |
+
name="orange_red",
|
| 21 |
+
c50="#FFF0E5",
|
| 22 |
+
c100="#FFE0CC",
|
| 23 |
+
c200="#FFC299",
|
| 24 |
+
c300="#FFA366",
|
| 25 |
+
c400="#FF8533",
|
| 26 |
+
c500="#FF4500",
|
| 27 |
+
c600="#E63E00",
|
| 28 |
+
c700="#CC3700",
|
| 29 |
+
c800="#B33000",
|
| 30 |
+
c900="#992900",
|
| 31 |
+
c950="#802200",
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
class OrangeRedTheme(Soft):
|
| 35 |
+
def __init__(
|
| 36 |
+
self,
|
| 37 |
+
*,
|
| 38 |
+
primary_hue: colors.Color | str = colors.gray,
|
| 39 |
+
secondary_hue: colors.Color | str = colors.orange_red, # Use the new color
|
| 40 |
+
neutral_hue: colors.Color | str = colors.slate,
|
| 41 |
+
text_size: sizes.Size | str = sizes.text_lg,
|
| 42 |
+
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
| 43 |
+
fonts.GoogleFont("Outfit"), "Arial", "sans-serif",
|
| 44 |
+
),
|
| 45 |
+
font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
|
| 46 |
+
fonts.GoogleFont("IBM Plex Mono"), "ui-monospace", "monospace",
|
| 47 |
+
),
|
| 48 |
+
):
|
| 49 |
+
super().__init__(
|
| 50 |
+
primary_hue=primary_hue,
|
| 51 |
+
secondary_hue=secondary_hue,
|
| 52 |
+
neutral_hue=neutral_hue,
|
| 53 |
+
text_size=text_size,
|
| 54 |
+
font=font,
|
| 55 |
+
font_mono=font_mono,
|
| 56 |
+
)
|
| 57 |
+
super().set(
|
| 58 |
+
background_fill_primary="*primary_50",
|
| 59 |
+
background_fill_primary_dark="*primary_900",
|
| 60 |
+
body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
|
| 61 |
+
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 62 |
+
button_primary_text_color="white",
|
| 63 |
+
button_primary_text_color_hover="white",
|
| 64 |
+
button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 65 |
+
button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 66 |
+
button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 67 |
+
button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 68 |
+
button_secondary_text_color="black",
|
| 69 |
+
button_secondary_text_color_hover="white",
|
| 70 |
+
button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
|
| 71 |
+
button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
|
| 72 |
+
button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
|
| 73 |
+
button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
|
| 74 |
+
slider_color="*secondary_500",
|
| 75 |
+
slider_color_dark="*secondary_600",
|
| 76 |
+
block_title_text_weight="600",
|
| 77 |
+
block_border_width="3px",
|
| 78 |
+
block_shadow="*shadow_drop_lg",
|
| 79 |
+
button_primary_shadow="*shadow_drop_lg",
|
| 80 |
+
button_large_padding="11px",
|
| 81 |
+
color_accent_soft="*primary_100",
|
| 82 |
+
block_label_background_fill="*primary_200",
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
orange_red_theme = OrangeRedTheme()
|
| 86 |
+
|
| 87 |
+
|
| 88 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 89 |
|
| 90 |
# --- # Device and CUDA Setup Check ---
|
|
|
|
| 172 |
#main-title h1 {font-size: 2.1em !important;}
|
| 173 |
"""
|
| 174 |
|
| 175 |
+
with gr.Blocks(css=css, theme=orange_red_theme) as demo:
|
| 176 |
|
| 177 |
with gr.Column(elem_id="col-container"):
|
| 178 |
gr.Markdown("# **Photo-Mate-i2i**", elem_id="main-title")
|