prithivMLmods commited on
Commit
eb521b9
·
verified ·
1 Parent(s): 6ce50a5

update app

Browse files
Files changed (1) hide show
  1. app.py +44 -4
app.py CHANGED
@@ -24,12 +24,27 @@ colors.steel_blue = colors.Color(
24
  c950="#1E3450",
25
  )
26
 
27
- class SteelBlueTheme(Soft):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  def __init__(
29
  self,
30
  *,
31
  primary_hue: colors.Color | str = colors.gray,
32
- secondary_hue: colors.Color | str = colors.steel_blue,
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] = (
@@ -56,14 +71,39 @@ class SteelBlueTheme(Soft):
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
  slider_color="*secondary_500",
60
  slider_color_dark="*secondary_600",
61
  block_title_text_weight="600",
62
  block_border_width="3px",
63
  block_shadow="*shadow_drop_lg",
 
 
 
 
64
  )
65
 
66
- steel_blue_theme = SteelBlueTheme()
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  from diffusers import FlowMatchEulerDiscreteScheduler
69
  from qwenimage.pipeline_qwenimage_edit_plus import QwenImageEditPlusPipeline
@@ -162,7 +202,7 @@ css="""
162
  #main-title h1 {font-size: 2.1em !important;}
163
  """
164
 
165
- with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
166
  with gr.Column(elem_id="col-container"):
167
  gr.Markdown("# **Qwen-Image-Edit-2509-LoRAs-Fast**", elem_id="main-title")
168
  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.")
 
24
  c950="#1E3450",
25
  )
26
 
27
+ colors.orange_red = colors.Color(
28
+ name="orange_red",
29
+ c50="#FFF0E5",
30
+ c100="#FFE0CC",
31
+ c200="#FFC299",
32
+ c300="#FFA366",
33
+ c400="#FF8533",
34
+ c500="#FF4500",
35
+ c600="#E63E00",
36
+ c700="#CC3700",
37
+ c800="#B33000",
38
+ c900="#992900",
39
+ c950="#802200",
40
+ )
41
+
42
+ class OrangeRedTheme(Soft):
43
  def __init__(
44
  self,
45
  *,
46
  primary_hue: colors.Color | str = colors.gray,
47
+ secondary_hue: colors.Color | str = colors.orange_red, # Use the new color
48
  neutral_hue: colors.Color | str = colors.slate,
49
  text_size: sizes.Size | str = sizes.text_lg,
50
  font: fonts.Font | str | Iterable[fonts.Font | str] = (
 
71
  button_primary_text_color_hover="white",
72
  button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
73
  button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
74
+ button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
75
+ button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
76
+ button_secondary_text_color="black",
77
+ button_secondary_text_color_hover="white",
78
+ button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
79
+ button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
80
+ button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
81
+ button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
82
  slider_color="*secondary_500",
83
  slider_color_dark="*secondary_600",
84
  block_title_text_weight="600",
85
  block_border_width="3px",
86
  block_shadow="*shadow_drop_lg",
87
+ button_primary_shadow="*shadow_drop_lg",
88
+ button_large_padding="11px",
89
+ color_accent_soft="*primary_100",
90
+ block_label_background_fill="*primary_200",
91
  )
92
 
93
+ orange_red_theme = OrangeRedTheme()
94
+
95
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
96
+
97
+ print("CUDA_VISIBLE_DEVICES=", os.environ.get("CUDA_VISIBLE_DEVICES"))
98
+ print("torch.__version__ =", torch.__version__)
99
+ print("torch.version.cuda =", torch.version.cuda)
100
+ print("cuda available:", torch.cuda.is_available())
101
+ print("cuda device count:", torch.cuda.device_count())
102
+ if torch.cuda.is_available():
103
+ print("current device:", torch.cuda.current_device())
104
+ print("device name:", torch.cuda.get_device_name(torch.cuda.current_device()))
105
+
106
+ print("Using device:", device)
107
 
108
  from diffusers import FlowMatchEulerDiscreteScheduler
109
  from qwenimage.pipeline_qwenimage_edit_plus import QwenImageEditPlusPipeline
 
202
  #main-title h1 {font-size: 2.1em !important;}
203
  """
204
 
205
+ with gr.Blocks(css=css, theme=orange_red_theme) as demo:
206
  with gr.Column(elem_id="col-container"):
207
  gr.Markdown("# **Qwen-Image-Edit-2509-LoRAs-Fast**", elem_id="main-title")
208
  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.")