Spaces:
Running
on
Zero
Running
on
Zero
update app
Browse files
app.py
CHANGED
|
@@ -9,27 +9,27 @@ from typing import Iterable
|
|
| 9 |
from gradio.themes import Soft
|
| 10 |
from gradio.themes.utils import colors, fonts, sizes
|
| 11 |
|
| 12 |
-
colors.
|
| 13 |
-
name="
|
| 14 |
-
c50="#
|
| 15 |
-
c100="#
|
| 16 |
-
c200="#
|
| 17 |
-
c300="#
|
| 18 |
-
c400="#
|
| 19 |
-
c500="#
|
| 20 |
-
c600="#
|
| 21 |
-
c700="#
|
| 22 |
-
c800="#
|
| 23 |
-
c900="#
|
| 24 |
-
c950="#
|
| 25 |
)
|
| 26 |
|
| 27 |
-
class
|
| 28 |
def __init__(
|
| 29 |
self,
|
| 30 |
*,
|
| 31 |
-
primary_hue: colors.Color | str = colors.
|
| 32 |
-
secondary_hue: colors.Color | str = colors.
|
| 33 |
neutral_hue: colors.Color | str = colors.slate,
|
| 34 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 35 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
@@ -47,25 +47,25 @@ class PlumTheme(Soft):
|
|
| 47 |
font=font,
|
| 48 |
font_mono=font_mono,
|
| 49 |
)
|
| 50 |
-
|
| 51 |
background_fill_primary="*primary_50",
|
| 52 |
background_fill_primary_dark="*primary_900",
|
| 53 |
-
body_background_fill="linear-gradient(135deg, *
|
| 54 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 55 |
button_primary_text_color="white",
|
| 56 |
button_primary_text_color_hover="white",
|
| 57 |
-
button_primary_background_fill="linear-gradient(90deg, *
|
| 58 |
-
button_primary_background_fill_hover="linear-gradient(90deg, *
|
| 59 |
-
button_primary_background_fill_dark="linear-gradient(90deg, *
|
| 60 |
-
button_primary_background_fill_hover_dark="linear-gradient(90deg, *
|
| 61 |
button_secondary_text_color="black",
|
| 62 |
button_secondary_text_color_hover="white",
|
| 63 |
-
button_secondary_background_fill="linear-gradient(90deg, *
|
| 64 |
button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
|
| 65 |
button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
|
| 66 |
button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
|
| 67 |
-
slider_color="*
|
| 68 |
-
slider_color_dark="*
|
| 69 |
block_title_text_weight="600",
|
| 70 |
block_border_width="3px",
|
| 71 |
block_shadow="*shadow_drop_lg",
|
|
@@ -75,7 +75,7 @@ class PlumTheme(Soft):
|
|
| 75 |
block_label_background_fill="*primary_200",
|
| 76 |
)
|
| 77 |
|
| 78 |
-
|
| 79 |
|
| 80 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 81 |
dtype = torch.bfloat16
|
|
@@ -230,7 +230,7 @@ css="""
|
|
| 230 |
#main-title h1 {font-size: 2.1em !important;}
|
| 231 |
"""
|
| 232 |
|
| 233 |
-
with gr.Blocks(css=css, theme=
|
| 234 |
with gr.Column(elem_id="col-container"):
|
| 235 |
gr.Markdown("# **Qwen-Image-Edit-2509-LoRAs-Fast-Fusion**", elem_id="main-title")
|
| 236 |
gr.Markdown("Perform diverse image edits using specialized [LoRA](https://huggingface.co/models?other=base_model:adapter:Qwen/Qwen-Image-Edit-2509) adapters for the [Qwen-Image-Edit](https://huggingface.co/Qwen/Qwen-Image-Edit-2509) model.")
|
|
|
|
| 9 |
from gradio.themes import Soft
|
| 10 |
from gradio.themes.utils import colors, fonts, sizes
|
| 11 |
|
| 12 |
+
colors.orange_red = colors.Color(
|
| 13 |
+
name="orange_red",
|
| 14 |
+
c50="#FFF0E5",
|
| 15 |
+
c100="#FFE0CC",
|
| 16 |
+
c200="#FFC299",
|
| 17 |
+
c300="#FFA366",
|
| 18 |
+
c400="#FF8533",
|
| 19 |
+
c500="#FF4500",
|
| 20 |
+
c600="#E63E00",
|
| 21 |
+
c700="#CC3700",
|
| 22 |
+
c800="#B33000",
|
| 23 |
+
c900="#992900",
|
| 24 |
+
c950="#802200",
|
| 25 |
)
|
| 26 |
|
| 27 |
+
class OrangeRedTheme(Soft):
|
| 28 |
def __init__(
|
| 29 |
self,
|
| 30 |
*,
|
| 31 |
+
primary_hue: colors.Color | str = colors.gray,
|
| 32 |
+
secondary_hue: colors.Color | str = colors.orange_red,
|
| 33 |
neutral_hue: colors.Color | str = colors.slate,
|
| 34 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 35 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
|
|
| 47 |
font=font,
|
| 48 |
font_mono=font_mono,
|
| 49 |
)
|
| 50 |
+
super().set(
|
| 51 |
background_fill_primary="*primary_50",
|
| 52 |
background_fill_primary_dark="*primary_900",
|
| 53 |
+
body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
|
| 54 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 55 |
button_primary_text_color="white",
|
| 56 |
button_primary_text_color_hover="white",
|
| 57 |
+
button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 58 |
+
button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 59 |
+
button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
|
| 60 |
+
button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
|
| 61 |
button_secondary_text_color="black",
|
| 62 |
button_secondary_text_color_hover="white",
|
| 63 |
+
button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
|
| 64 |
button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
|
| 65 |
button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
|
| 66 |
button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
|
| 67 |
+
slider_color="*secondary_500",
|
| 68 |
+
slider_color_dark="*secondary_600",
|
| 69 |
block_title_text_weight="600",
|
| 70 |
block_border_width="3px",
|
| 71 |
block_shadow="*shadow_drop_lg",
|
|
|
|
| 75 |
block_label_background_fill="*primary_200",
|
| 76 |
)
|
| 77 |
|
| 78 |
+
orange_red_theme = OrangeRedTheme()
|
| 79 |
|
| 80 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 81 |
dtype = torch.bfloat16
|
|
|
|
| 230 |
#main-title h1 {font-size: 2.1em !important;}
|
| 231 |
"""
|
| 232 |
|
| 233 |
+
with gr.Blocks(css=css, theme=orange_red_theme) as demo:
|
| 234 |
with gr.Column(elem_id="col-container"):
|
| 235 |
gr.Markdown("# **Qwen-Image-Edit-2509-LoRAs-Fast-Fusion**", elem_id="main-title")
|
| 236 |
gr.Markdown("Perform diverse image edits using specialized [LoRA](https://huggingface.co/models?other=base_model:adapter:Qwen/Qwen-Image-Edit-2509) adapters for the [Qwen-Image-Edit](https://huggingface.co/Qwen/Qwen-Image-Edit-2509) model.")
|