prithivMLmods commited on
Commit
fb635dc
·
verified ·
1 Parent(s): f874714

update app

Browse files
Files changed (1) hide show
  1. app.py +31 -31
app.py CHANGED
@@ -29,27 +29,27 @@ print("Using device:", device)
29
  from gradio.themes import Soft
30
  from gradio.themes.utils import colors, fonts, sizes
31
 
32
- colors.steel_blue = colors.Color(
33
- name="steel_blue",
34
- c50="#EBF3F8",
35
- c100="#D3E5F0",
36
- c200="#A8CCE1",
37
- c300="#7DB3D2",
38
- c400="#529AC3",
39
- c500="#4682B4",
40
- c600="#3E72A0",
41
- c700="#36638C",
42
- c800="#2E5378",
43
- c900="#264364",
44
- c950="#1E3450",
45
  )
46
 
47
- class SteelBlueTheme(Soft):
48
  def __init__(
49
  self,
50
  *,
51
  primary_hue: colors.Color | str = colors.gray,
52
- secondary_hue: colors.Color | str = colors.steel_blue,
53
  neutral_hue: colors.Color | str = colors.slate,
54
  text_size: sizes.Size | str = sizes.text_lg,
55
  font: fonts.Font | str | Iterable[fonts.Font | str] = (
@@ -76,8 +76,8 @@ class SteelBlueTheme(Soft):
76
  button_primary_text_color_hover="white",
77
  button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
78
  button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
79
- button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_800)",
80
- button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_500)",
81
  button_secondary_text_color="black",
82
  button_secondary_text_color_hover="white",
83
  button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
@@ -95,7 +95,7 @@ class SteelBlueTheme(Soft):
95
  block_label_background_fill="*primary_200",
96
  )
97
 
98
- steel_blue_theme = SteelBlueTheme()
99
 
100
  # --- Main Model Initialization ---
101
  MAX_SEED = np.iinfo(np.int32).max
@@ -170,7 +170,7 @@ css="""
170
  margin: 0 auto;
171
  max-width: 960px;
172
  }
173
- #main-title h1 {font-size: 2.1em !important;}
174
  """
175
 
176
  with gr.Blocks() as demo:
@@ -181,16 +181,16 @@ with gr.Blocks() as demo:
181
 
182
  with gr.Row():
183
  with gr.Column():
184
- input_image = gr.Image(label="Upload Image", type="pil", height="300")
185
- with gr.Row():
186
- prompt = gr.Text(
187
- label="Edit Prompt",
188
- show_label=False,
189
- max_lines=1,
190
- placeholder="Enter your prompt for editing (e.g., 'Remove glasses')",
191
- container=False,
192
- )
193
- run_button = gr.Button("Run", variant="primary", scale=0)
194
  with gr.Accordion("Advanced Settings", open=False):
195
 
196
  seed = gr.Slider(
@@ -220,7 +220,7 @@ with gr.Blocks() as demo:
220
  )
221
 
222
  with gr.Column():
223
- output_image = gr.Image(label="Output Image", interactive=False)
224
  reuse_button = gr.Button("Reuse this image", visible=False)
225
 
226
  with gr.Row():
@@ -266,4 +266,4 @@ with gr.Blocks() as demo:
266
  outputs=[input_image]
267
  )
268
 
269
- demo.launch(css=css, theme=steel_blue_theme, mcp_server=True, ssr_mode=False, show_error=True)
 
29
  from gradio.themes import Soft
30
  from gradio.themes.utils import colors, fonts, sizes
31
 
32
+ colors.orange_red = colors.Color(
33
+ name="orange_red",
34
+ c50="#FFF0E5",
35
+ c100="#FFE0CC",
36
+ c200="#FFC299",
37
+ c300="#FFA366",
38
+ c400="#FF8533",
39
+ c500="#FF4500",
40
+ c600="#E63E00",
41
+ c700="#CC3700",
42
+ c800="#B33000",
43
+ c900="#992900",
44
+ c950="#802200",
45
  )
46
 
47
+ class OrangeRedTheme(Soft):
48
  def __init__(
49
  self,
50
  *,
51
  primary_hue: colors.Color | str = colors.gray,
52
+ secondary_hue: colors.Color | str = colors.orange_red,
53
  neutral_hue: colors.Color | str = colors.slate,
54
  text_size: sizes.Size | str = sizes.text_lg,
55
  font: fonts.Font | str | Iterable[fonts.Font | str] = (
 
76
  button_primary_text_color_hover="white",
77
  button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
78
  button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
79
+ button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
80
+ button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
81
  button_secondary_text_color="black",
82
  button_secondary_text_color_hover="white",
83
  button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
 
95
  block_label_background_fill="*primary_200",
96
  )
97
 
98
+ orange_red_theme = OrangeRedTheme()
99
 
100
  # --- Main Model Initialization ---
101
  MAX_SEED = np.iinfo(np.int32).max
 
170
  margin: 0 auto;
171
  max-width: 960px;
172
  }
173
+ #main-title h1 {font-size: 2.2em !important;}
174
  """
175
 
176
  with gr.Blocks() as demo:
 
181
 
182
  with gr.Row():
183
  with gr.Column():
184
+ input_image = gr.Image(label="Upload Image", type="pil", height=290)
185
+
186
+ prompt = gr.Text(
187
+ label="Edit Prompt",
188
+ show_label=True,
189
+ placeholder="e.g., transform into anime..",
190
+ )
191
+
192
+ run_button = gr.Button("Edit Image", variant="primary")
193
+
194
  with gr.Accordion("Advanced Settings", open=False):
195
 
196
  seed = gr.Slider(
 
220
  )
221
 
222
  with gr.Column():
223
+ output_image = gr.Image(label="Output Image", interactive=False, format="png", height=323)
224
  reuse_button = gr.Button("Reuse this image", visible=False)
225
 
226
  with gr.Row():
 
266
  outputs=[input_image]
267
  )
268
 
269
+ demo.launch(css=css, theme=orange_red_theme, mcp_server=True, ssr_mode=False, show_error=True)