prithivMLmods commited on
Commit
0514b66
·
verified ·
1 Parent(s): 520de31

update app

Browse files
Files changed (1) hide show
  1. app.py +73 -2
app.py CHANGED
@@ -9,6 +9,77 @@ from qwenimage.pipeline_qwenimage_edit_plus import QwenImageEditPlusPipeline
9
  from qwenimage.transformer_qwenimage import QwenImageTransformer2DModel
10
  from qwenimage.qwen_fa3_processor import QwenDoubleStreamAttnProcessorFA3
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  MAX_SEED = np.iinfo(np.int32).max
13
 
14
  dtype = torch.bfloat16
@@ -687,7 +758,7 @@ css = '''
687
  #lighting-3d-control { min-height: 450px; }
688
  .slider-row { display: flex; gap: 10px; align-items: center; }
689
  '''
690
- with gr.Blocks(css=css, theme="gradio/monochrome") as demo:
691
  gr.Markdown("""
692
  # 🎬 Qwen Image Edit 2511 — 3D Lighting Control
693
 
@@ -822,4 +893,4 @@ with gr.Blocks(css=css, theme="gradio/monochrome") as demo:
822
  if __name__ == "__main__":
823
  head = '<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>'
824
  css = '.fillable{max-width: 1200px !important}'
825
- demo.launch(head=head, css=css)
 
9
  from qwenimage.transformer_qwenimage import QwenImageTransformer2DModel
10
  from qwenimage.qwen_fa3_processor import QwenDoubleStreamAttnProcessorFA3
11
 
12
+ from gradio.themes import Soft
13
+ from gradio.themes.utils import colors, fonts, sizes
14
+
15
+ colors.orange_red = colors.Color(
16
+ name="orange_red",
17
+ c50="#FFF0E5",
18
+ c100="#FFE0CC",
19
+ c200="#FFC299",
20
+ c300="#FFA366",
21
+ c400="#FF8533",
22
+ c500="#FF4500",
23
+ c600="#E63E00",
24
+ c700="#CC3700",
25
+ c800="#B33000",
26
+ c900="#992900",
27
+ c950="#802200",
28
+ )
29
+
30
+ class OrangeRedTheme(Soft):
31
+ def __init__(
32
+ self,
33
+ *,
34
+ primary_hue: colors.Color | str = colors.gray,
35
+ secondary_hue: colors.Color | str = colors.orange_red,
36
+ neutral_hue: colors.Color | str = colors.slate,
37
+ text_size: sizes.Size | str = sizes.text_lg,
38
+ font: fonts.Font | str | Iterable[fonts.Font | str] = (
39
+ fonts.GoogleFont("Outfit"), "Arial", "sans-serif",
40
+ ),
41
+ font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
42
+ fonts.GoogleFont("IBM Plex Mono"), "ui-monospace", "monospace",
43
+ ),
44
+ ):
45
+ super().__init__(
46
+ primary_hue=primary_hue,
47
+ secondary_hue=secondary_hue,
48
+ neutral_hue=neutral_hue,
49
+ text_size=text_size,
50
+ font=font,
51
+ font_mono=font_mono,
52
+ )
53
+ super().set(
54
+ background_fill_primary="*primary_50",
55
+ background_fill_primary_dark="*primary_900",
56
+ body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
57
+ body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
58
+ button_primary_text_color="white",
59
+ button_primary_text_color_hover="white",
60
+ button_primary_background_fill="linear-gradient(90deg, *secondary_500, *secondary_600)",
61
+ button_primary_background_fill_hover="linear-gradient(90deg, *secondary_600, *secondary_700)",
62
+ button_primary_background_fill_dark="linear-gradient(90deg, *secondary_600, *secondary_700)",
63
+ button_primary_background_fill_hover_dark="linear-gradient(90deg, *secondary_500, *secondary_600)",
64
+ button_secondary_text_color="black",
65
+ button_secondary_text_color_hover="white",
66
+ button_secondary_background_fill="linear-gradient(90deg, *primary_300, *primary_300)",
67
+ button_secondary_background_fill_hover="linear-gradient(90deg, *primary_400, *primary_400)",
68
+ button_secondary_background_fill_dark="linear-gradient(90deg, *primary_500, *primary_600)",
69
+ button_secondary_background_fill_hover_dark="linear-gradient(90deg, *primary_500, *primary_500)",
70
+ slider_color="*secondary_500",
71
+ slider_color_dark="*secondary_600",
72
+ block_title_text_weight="600",
73
+ block_border_width="3px",
74
+ block_shadow="*shadow_drop_lg",
75
+ button_primary_shadow="*shadow_drop_lg",
76
+ button_large_padding="11px",
77
+ color_accent_soft="*primary_100",
78
+ block_label_background_fill="*primary_200",
79
+ )
80
+
81
+ orange_red_theme = OrangeRedTheme()
82
+
83
  MAX_SEED = np.iinfo(np.int32).max
84
 
85
  dtype = torch.bfloat16
 
758
  #lighting-3d-control { min-height: 450px; }
759
  .slider-row { display: flex; gap: 10px; align-items: center; }
760
  '''
761
+ with gr.Blocks(css=css) as demo:
762
  gr.Markdown("""
763
  # 🎬 Qwen Image Edit 2511 — 3D Lighting Control
764
 
 
893
  if __name__ == "__main__":
894
  head = '<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>'
895
  css = '.fillable{max-width: 1200px !important}'
896
+ demo.launch(head=head, css=css, theme=orange_red_theme, mcp_server=True, ssr_mode=False, show_error=True)