chohj06ms commited on
Commit
438ebdf
·
verified ·
1 Parent(s): 0e2d330

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +228 -213
main.py CHANGED
@@ -1,213 +1,228 @@
1
- import gradio as gr
2
- import fns
3
- import generate
4
-
5
-
6
- with gr.Blocks(theme=gr.themes.Soft()) as demo:
7
- with gr.Row():
8
- gr.Markdown(
9
- """
10
- # Custom Objekt
11
- ## Input image and Select Options
12
- """)
13
-
14
- with gr.Tab("Front"):
15
- with gr.Row():
16
- with gr.Column(): #1
17
- img_type = gr.Radio(["Image", "Gif"], value="Image", scale=1, label="type")
18
- img_static = gr.Image(label="Image", interactive=True, sources=['upload', 'clipboard'], type="pil", visible=True, scale=10)
19
- img_dynamic_file = gr.File(file_types=[".gif"], visible=False, scale=1, interactive=True, label="Gif File", type="filepath")
20
- img_dynamic_show = gr.Image(label="Gif", interactive=False, sources=['upload', 'clipboard'], type="pil", visible=False, scale=10)
21
-
22
-
23
- img_type.change(fn=fns.change_img_type, inputs=[img_type], outputs=[img_static, img_dynamic_file, img_dynamic_show])
24
- img_static.upload(fn=fns.img2cache_resize, inputs=img_static, outputs=img_static)
25
- img_dynamic_file.upload(fn=fns.gif2cache, inputs=img_dynamic_file, outputs=img_dynamic_show)
26
- img_dynamic_file.clear(fn=fns.gif_clear, outputs=img_dynamic_show)
27
-
28
-
29
- with gr.Column(): #2
30
- with gr.Group(): #objekt color
31
- obj_color = gr.Radio(["Atom01", "Binary01", "Cream01", "Divine01", "Special", "Other color", "AI Color"], label="Objekt Color", value="Cream01")
32
-
33
- with gr.Row():
34
- ai_num = gr.Slider(1, 1000, 500, label="AI Serial", visible=False, step=1)
35
- change_ai = gr.Button(value="Change AI", visible=False)
36
- obj_color_picker = gr.ColorPicker(label="Other Objekt Color", visible=False, interactive=True, value="#ffffff")
37
-
38
-
39
- obj_color.change(fn=fns.obj_color_update, inputs=obj_color, outputs=[obj_color_picker, ai_num, change_ai])
40
-
41
-
42
- with gr.Group():
43
- txt_color = gr.Radio(["White", "Black", "Other"], label="Text Color", value="Black")
44
- txt_color_picker = gr.ColorPicker(label="Other Text Color", value="#ffffff", visible=False, interactive=True)
45
- txt_color.change(fns.txt_color_update, txt_color, txt_color_picker)
46
- with gr.Group():
47
- group_name_radio = gr.Radio(["tripleS", "ARTMS", "Other"], label="Group Name")
48
- group_name_txt = gr.Textbox(label="Other Group name", placeholder="CLASSY", visible=False, interactive=True)
49
-
50
- with gr.Group():
51
- member_name_dropdown = gr.Dropdown(
52
- ["SeoYeon", "HyeRin", "JiWoo", "ChaeYeon", "YooYeon", "SooMin", "NaKyoung", "YuBin", "Kaede",
53
- "DaHyun", "Kotone", "YeonJi", "Nien", "SoHyun", "Xinyu", "Mayu", "Lynn", "JooBin", "HaYeon",
54
- "ShiOn", "ChaeWon", "Sullin", "SeoAh", "JiYeon"], label="Member Name", allow_custom_value=True)
55
-
56
- group_name_radio.change(fns.group_member_name_update, group_name_radio, [group_name_txt, member_name_dropdown])
57
-
58
-
59
- with gr.Accordion("Add Objekt Number", open=False):
60
- with gr.Row():
61
- obj_num = gr.Textbox(label="Objekt Number", placeholder="100", interactive=True, visible=True, scale=1)
62
- obj_alphabet = gr.Radio(["Z", "A", "Other"], label="Z or A", interactive=True, visible=True, scale=1)
63
- obj_alphabet_txt = gr.Textbox(label="Alphabet", placeholder="S", interactive=True, visible=False, scale=1)
64
-
65
- obj_alphabet.change(fns.alphabet_txt_update, obj_alphabet, obj_alphabet_txt)
66
-
67
-
68
- with gr.Row():
69
- obj_serial = gr.Textbox(label="Objekt Serial", placeholder="00001", interactive=True, visible=True, scale=1)
70
- obj_serial_random = gr.Button(value="Random Serial", interactive=True, visible=True, scale=1)
71
-
72
-
73
- obj_serial_random.click(fn=fns.serial_random, outputs=obj_serial)
74
-
75
-
76
- with gr.Group():
77
- rounded = gr.Checkbox(label="Rounded", value=True, interactive=True)
78
- with gr.Group():
79
- generate_btn = gr.Button(value="Generate")
80
-
81
- with gr.Column():
82
- edited_img = gr.Image(label="Edited Image", scale=10)
83
-
84
-
85
- with gr.Tab("Back") as back_tab:
86
- with gr.Row():
87
- preview = gr.Image(label="Image", interactive=False)
88
- with gr.Column():
89
- with gr.Group():
90
- obj_outline_color = gr.Radio(["White", "Black", "Other"], label="Frame color", value="White")
91
- obj_outline_color_picker = gr.ColorPicker(label="Other Outline Color", value="#ffffff", visible=False, interactive=True)
92
-
93
- obj_outline_color.change(fns.frame_color_update, obj_outline_color, obj_outline_color_picker)
94
-
95
- with gr.Group():
96
- logo_radio = gr.Radio(["tripleS", "ARTMS", "None"], label="Add Logo", interactive=True, value="None")
97
-
98
-
99
- with gr.Group():
100
- class_radio = gr.Radio(["Zero", "First", "Double", "Special", "Other"], label="CLASS", visible=True)
101
- class_txt = gr.Textbox(label="Other class", placeholder="Third", visible=False)
102
-
103
- class_radio.change(fns.txt_class_visibility, class_radio, class_txt)
104
-
105
- with gr.Group():
106
- season_radio = gr.Radio(["Atom01", "Binary01", "Cream01", "Divine01", "Other"], label="SEASON", type="value")
107
-
108
- with gr.Row():
109
- season_txt = gr.Textbox(label="Other SEASON", interactive=True, visible=False)
110
- season_txt_outline = gr.Textbox(label="Other SEASON Outline", interactive=True, visible=False)
111
-
112
- season_radio.change(fns.txt_season_visibility, season_radio, [season_txt, season_txt_outline])
113
-
114
- with gr.Group():
115
- sign = gr.Dropdown(
116
- ["SeoYeon", "HyeRin", "JiWoo", "ChaeYeon", "YooYeon", "SooMin", "NaKyoung", "YuBin", "Kaede",
117
- "DaHyun", "Kotone", "YeonJi", "Nien", "SoHyun", "Xinyu", "Mayu", "Lynn", "JooBin", "HaYeon",
118
- "ShiOn", "ChaeWon", "Sullin", "SeoAh", "JiYeon", "HeeJin", "KimLip", "JinSoul", "Choerry", "HaSeul"], label="Sign", type='index')
119
- with gr.Group():
120
- qr_url_dropdown = gr.Dropdown(["tripleS website", "tripleS youtube", "tripleS 𝕏", "tripleS discord"],
121
- label="qr url", info="Can write any url", allow_custom_value=True)
122
- with gr.Row():
123
- qr_Logo_radio = gr.Radio(["tripleS", "None"], label="tripleS Logo", value="None",
124
- interactive=True)
125
- with gr.Group():
126
- right_btn = gr.Checkbox(label="Add Rights", value=False, interactive=True)
127
- with gr.Group():
128
- rounded_back = gr.Checkbox(label="Rounded", value=True, interactive=True)
129
- with gr.Group():
130
- generate_btn_back = gr.Button(value="Generate")
131
-
132
- with gr.Column():
133
- outputs2 = gr.Image(label="Edited Image", scale=10)
134
-
135
- with gr.Tab("Export") as ex:
136
- with gr.Row():
137
- ex_img_f = gr.Image(label="Front", type="pil", interactive=False)
138
- ex_file_f = gr.File(render=True, visible=False)
139
- ex_img_b = gr.Image(label="Back", type="pil", interactive=False)
140
- with gr.Column():
141
- with gr.Group():
142
- with gr.Row():
143
- ex_hide_blur = gr.Checkbox(label="Blur")
144
- ex_hide_blur_range = gr.Slider(1, 20, 5, label="Blur Range", step=1, interactive=False, scale=10)
145
-
146
- ex_hide_blur.select(fns.ex_blur, ex_hide_blur, ex_hide_blur_range)
147
-
148
- with gr.Group():
149
- watermark = gr.Textbox(label="Add watermark")
150
-
151
- ex_gen_file_count = gr.Radio(["One File", "Two Files"], label="Export Type", value="One File")
152
- ex_btn = gr.Button(value="Export")
153
- with gr.Row():
154
- ex_img_f_out = gr.Image(label="Front", interactive=False)
155
- ex_img_b_out = gr.Image(label="Back", visible=False, interactive=False)
156
-
157
-
158
-
159
- with gr.Tab("Dev"):
160
- dev_txt = gr.Textbox(label="Developer Key", visible=True, interactive=True)
161
- dev_btn = gr.Button(value="Do and refresh", visible=True, interactive=True)
162
- dev_out = gr.Textbox()
163
- dev_drop = gr.Dropdown(visible=False, interactive=False)
164
- dev_file = gr.File(visible=False, interactive=False)
165
- dev_btn2 = gr.Button(visible=False, interactive=False, value="move")
166
- dev_btn3 = gr.Button(visible=False, interactive=False, value="zip")
167
- dev_btn4 = gr.Button(visible=False, interactive=False, value="download")
168
- dev_btn5 = gr.Button(visible=False, interactive=False, value="remove")
169
-
170
- dev_btn2.click(fn=fns.dev2, outputs=dev_out)
171
- dev_btn3.click(fn=fns.dev3, inputs=dev_drop, outputs=dev_out)
172
- dev_btn4.click(fn=fns.dev4, inputs=dev_drop, outputs=dev_file)
173
- dev_btn5.click(fn=fns.dev5, inputs=dev_drop, outputs=dev_out)
174
- dev_btn.click(fns.dev, dev_txt, [dev_out, dev_drop, dev_file, dev_btn2, dev_btn3, dev_btn4, dev_btn5])
175
- gr.Markdown(
176
- """
177
- ## Made by
178
- # Discord : hj_sss (Can DM)
179
- # Cosmo : ILoveYouyeon
180
- ### this site is free But I hope anyone can support the objekt to my Cosmo
181
- """)
182
-
183
- generate_btn.click(fn=generate.sorting,
184
- inputs=[img_type, img_static, img_dynamic_file, obj_color, obj_color_picker, ai_num, txt_color,
185
- txt_color_picker, member_name_dropdown, group_name_radio, group_name_txt, obj_num,
186
- obj_alphabet, obj_alphabet_txt, obj_serial, rounded], outputs=[edited_img, ex_img_f, ex_file_f])
187
-
188
- ex_gen_file_count.change(fns.ex_gen_count, ex_gen_file_count, ex_img_b_out)
189
- rounded.change(fns.rounded_sync, rounded, rounded_back)
190
- rounded_back.change(fns.rounded_sync, rounded_back, rounded)
191
-
192
- change_ai.click(fns.change_ran, obj_color, ai_num)
193
-
194
- generate_btn_back.click(fn=generate.back,
195
- inputs=[obj_color, obj_color_picker, ai_num, txt_color, txt_color_picker, group_name_radio,
196
- group_name_txt, member_name_dropdown, obj_num, obj_alphabet, obj_alphabet_txt,
197
- obj_serial, obj_outline_color, obj_outline_color_picker, logo_radio, class_radio,
198
- class_txt, season_radio, season_txt, season_txt_outline, sign, qr_url_dropdown,
199
- qr_Logo_radio, right_btn, rounded_back], outputs=[outputs2, ex_img_b])
200
-
201
- back_tab.select(fn=generate.back,
202
- inputs=[obj_color, obj_color_picker, ai_num, txt_color, txt_color_picker, group_name_radio,
203
- group_name_txt, member_name_dropdown, obj_num, obj_alphabet, obj_alphabet_txt, obj_serial,
204
- obj_outline_color, obj_outline_color_picker, logo_radio, class_radio, class_txt,
205
- season_radio, season_txt, season_txt_outline, sign, qr_url_dropdown, qr_Logo_radio,
206
- right_btn, rounded_back], outputs=[preview, ex_img_b])
207
-
208
- ex_btn.click(fn=generate.ex_gen, inputs=[ex_img_f, ex_file_f, ex_img_b, ex_gen_file_count, ex_hide_blur, ex_hide_blur_range, watermark], outputs=[ex_img_f_out, ex_img_b_out])
209
-
210
- if __name__ == "__main__":
211
- print("http://localhost:7860")
212
- demo.launch(server_name="0.0.0.0")
213
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import fns
3
+ import generate
4
+
5
+ js_func = """
6
+ function refresh() {
7
+ const url = new URL(window.location);
8
+
9
+ if (url.searchParams.get('__theme') !== 'dark') {
10
+ url.searchParams.set('__theme', 'dark');
11
+ window.location.href = url.href;
12
+ }
13
+ }
14
+ """
15
+
16
+ with gr.Blocks(theme=gr.themes.Soft(), js=js_func) as demo:
17
+ with gr.Row():
18
+ gr.Markdown(
19
+ """
20
+ # Objektify
21
+ ### custom objekt
22
+ ## Join official objektify Discord!!!
23
+ ### [Click here and Join](https://discord.gg/K44Ka83BYT)
24
+ """)
25
+
26
+ with gr.Tab("Front"):
27
+ with gr.Row():
28
+ with gr.Column(): #1
29
+ img_type = gr.Radio(["Image", "Gif"], value="Image", scale=1, label="type")
30
+ img_static = gr.Image(label="Image", interactive=True, sources=['upload', 'clipboard'], type="pil", visible=True, scale=10)
31
+ img_dynamic_file = gr.File(file_types=[".gif"], visible=False, scale=1, interactive=True, label="Gif File", type="filepath")
32
+ img_dynamic_show = gr.Image(label="Gif", interactive=False, sources=['upload', 'clipboard'], type="pil", visible=False, scale=10)
33
+
34
+
35
+ img_type.change(fn=fns.change_img_type, inputs=[img_type], outputs=[img_static, img_dynamic_file, img_dynamic_show])
36
+ img_static.upload(fn=fns.img2cache_resize, inputs=img_static, outputs=img_static)
37
+ img_dynamic_file.upload(fn=fns.gif2cache, inputs=img_dynamic_file, outputs=img_dynamic_show)
38
+ img_dynamic_file.clear(fn=fns.gif_clear, outputs=img_dynamic_show)
39
+
40
+
41
+ with gr.Column(): #2
42
+ with gr.Group(): #objekt color
43
+ obj_color = gr.Radio(["Atom01", "Binary01", "Cream01", "Divine01", "Special", "Other color", "AI Color"], label="Objekt Color", value="Cream01")
44
+
45
+ with gr.Row():
46
+ ai_num = gr.Slider(1, 1000, 500, label="AI Serial", visible=False, step=1)
47
+ change_ai = gr.Button(value="Change AI", visible=False)
48
+ obj_color_picker = gr.ColorPicker(label="Other Objekt Color", visible=False, interactive=True, value="#ffffff")
49
+
50
+
51
+ obj_color.change(fn=fns.obj_color_update, inputs=obj_color, outputs=[obj_color_picker, ai_num, change_ai])
52
+
53
+
54
+ with gr.Group():
55
+ txt_color = gr.Radio(["White", "Black", "Other"], label="Text Color", value="Black")
56
+ txt_color_picker = gr.ColorPicker(label="Other Text Color", value="#ffffff", visible=False, interactive=True)
57
+ txt_color.change(fns.txt_color_update, txt_color, txt_color_picker)
58
+ with gr.Group():
59
+ group_name_radio = gr.Radio(["tripleS", "ARTMS", "Other"], label="Group Name")
60
+ group_name_txt = gr.Textbox(label="Other Group name", placeholder="CLASSY", visible=False, interactive=True)
61
+
62
+ with gr.Group():
63
+ member_name_dropdown = gr.Dropdown(
64
+ ["SeoYeon", "HyeRin", "JiWoo", "ChaeYeon", "YooYeon", "SooMin", "NaKyoung", "YuBin", "Kaede",
65
+ "DaHyun", "Kotone", "YeonJi", "Nien", "SoHyun", "Xinyu", "Mayu", "Lynn", "JooBin", "HaYeon",
66
+ "ShiOn", "ChaeWon", "Sullin", "SeoAh", "JiYeon"], label="Member Name", allow_custom_value=True)
67
+
68
+ group_name_radio.change(fns.group_member_name_update, group_name_radio, [group_name_txt, member_name_dropdown])
69
+
70
+
71
+ with gr.Accordion("Add Objekt Number", open=False):
72
+ with gr.Row():
73
+ obj_num = gr.Textbox(label="Objekt Number", placeholder="100", interactive=True, visible=True, scale=1)
74
+ obj_alphabet = gr.Radio(["Z", "A", "Other"], label="Z or A", interactive=True, visible=True, scale=1)
75
+ obj_alphabet_txt = gr.Textbox(label="Alphabet", placeholder="S", interactive=True, visible=False, scale=1)
76
+
77
+ obj_alphabet.change(fns.alphabet_txt_update, obj_alphabet, obj_alphabet_txt)
78
+
79
+
80
+ with gr.Row():
81
+ obj_serial = gr.Textbox(label="Objekt Serial", placeholder="00001", interactive=True, visible=True, scale=1)
82
+ obj_serial_random = gr.Button(value="Random Serial", interactive=True, visible=True, scale=1)
83
+
84
+
85
+ obj_serial_random.click(fn=fns.serial_random, outputs=obj_serial)
86
+
87
+
88
+ with gr.Group():
89
+ rounded = gr.Checkbox(label="Rounded", value=True, interactive=True)
90
+ with gr.Group():
91
+ generate_btn = gr.Button(value="Generate")
92
+
93
+ with gr.Column():
94
+ edited_img = gr.Image(label="Edited Image", scale=10)
95
+
96
+
97
+ with gr.Tab("Back") as back_tab:
98
+ with gr.Row():
99
+ preview = gr.Image(label="Image", interactive=False)
100
+ with gr.Column():
101
+ with gr.Group():
102
+ obj_outline_color = gr.Radio(["White", "Black", "Other"], label="Frame color", value="White")
103
+ obj_outline_color_picker = gr.ColorPicker(label="Other Outline Color", value="#ffffff", visible=False, interactive=True)
104
+
105
+ obj_outline_color.change(fns.frame_color_update, obj_outline_color, obj_outline_color_picker)
106
+
107
+ with gr.Group():
108
+ logo_radio = gr.Radio(["tripleS", "ARTMS", "None"], label="Add Logo", interactive=True, value="None")
109
+
110
+
111
+ with gr.Group():
112
+ class_radio = gr.Radio(["Zero", "First", "Double", "Special", "Other"], label="CLASS", visible=True)
113
+ class_txt = gr.Textbox(label="Other class", placeholder="Third", visible=False)
114
+
115
+ class_radio.change(fns.txt_class_visibility, class_radio, class_txt)
116
+
117
+ with gr.Group():
118
+ season_radio = gr.Radio(["Atom01", "Binary01", "Cream01", "Divine01", "Other"], label="SEASON", type="value")
119
+
120
+ with gr.Row():
121
+ season_txt = gr.Textbox(label="Other SEASON", interactive=True, visible=False)
122
+ season_txt_outline = gr.Textbox(label="Other SEASON Outline", interactive=True, visible=False)
123
+
124
+ season_radio.change(fns.txt_season_visibility, season_radio, [season_txt, season_txt_outline])
125
+
126
+ with gr.Group():
127
+ sign = gr.Dropdown(
128
+ ["SeoYeon", "HyeRin", "JiWoo", "ChaeYeon", "YooYeon", "SooMin", "NaKyoung", "YuBin", "Kaede",
129
+ "DaHyun", "Kotone", "YeonJi", "Nien", "SoHyun", "Xinyu", "Mayu", "Lynn", "JooBin", "HaYeon",
130
+ "ShiOn", "ChaeWon", "Sullin", "SeoAh", "JiYeon", "HeeJin", "KimLip", "JinSoul", "Choerry", "HaSeul"], label="Sign", type='index')
131
+ with gr.Group():
132
+ qr_url_dropdown = gr.Dropdown(["tripleS website", "tripleS youtube", "tripleS 𝕏", "tripleS discord"],
133
+ label="qr url", info="Can write any url", allow_custom_value=True)
134
+ with gr.Row():
135
+ qr_Logo_radio = gr.Radio(["tripleS", "None"], label="tripleS Logo", value="None",
136
+ interactive=True)
137
+ with gr.Group():
138
+ right_btn = gr.Checkbox(label="Add Rights", value=False, interactive=True)
139
+ with gr.Group():
140
+ rounded_back = gr.Checkbox(label="Rounded", value=True, interactive=True)
141
+ with gr.Group():
142
+ generate_btn_back = gr.Button(value="Generate")
143
+
144
+ with gr.Column():
145
+ outputs2 = gr.Image(label="Edited Image", scale=10)
146
+
147
+ with gr.Tab("Export") as ex:
148
+ with gr.Row():
149
+ ex_img_f = gr.Image(label="Front", type="pil", interactive=False)
150
+ ex_file_f = gr.File(render=True, visible=False)
151
+ ex_img_b = gr.Image(label="Back", type="pil", interactive=False)
152
+ with gr.Column():
153
+ with gr.Group():
154
+ with gr.Row():
155
+ ex_hide_blur = gr.Checkbox(label="Blur")
156
+ ex_hide_blur_range = gr.Slider(1, 20, 5, label="Blur Range", step=1, interactive=False, scale=10)
157
+
158
+ ex_hide_blur.select(fns.ex_blur, ex_hide_blur, ex_hide_blur_range)
159
+
160
+ with gr.Group():
161
+ watermark = gr.Textbox(label="Add watermark")
162
+
163
+ ex_gen_file_count = gr.Radio(["One File", "Two Files"], label="Export Type", value="One File")
164
+ ex_btn = gr.Button(value="Export")
165
+ with gr.Row():
166
+ ex_img_f_out = gr.Image(label="Front", interactive=False)
167
+ ex_img_b_out = gr.Image(label="Back", visible=False, interactive=False)
168
+
169
+
170
+
171
+ with gr.Tab("Dev"):
172
+ dev_txt = gr.Textbox(label="Developer Key", visible=True, interactive=True)
173
+ dev_btn = gr.Button(value="Do and refresh", visible=True, interactive=True)
174
+ dev_out = gr.Textbox()
175
+ dev_drop = gr.Dropdown(visible=False, interactive=False)
176
+ dev_file = gr.File(visible=False, interactive=False)
177
+ dev_btn2 = gr.Button(visible=False, interactive=False, value="move")
178
+ dev_btn3 = gr.Button(visible=False, interactive=False, value="zip")
179
+ dev_btn4 = gr.Button(visible=False, interactive=False, value="download")
180
+ dev_btn5 = gr.Button(visible=False, interactive=False, value="remove")
181
+
182
+ dev_btn2.click(fn=fns.dev2, outputs=dev_out)
183
+ dev_btn3.click(fn=fns.dev3, inputs=dev_drop, outputs=dev_out)
184
+ dev_btn4.click(fn=fns.dev4, inputs=dev_drop, outputs=dev_file)
185
+ dev_btn5.click(fn=fns.dev5, inputs=dev_drop, outputs=dev_out)
186
+ dev_btn.click(fns.dev, dev_txt, [dev_out, dev_drop, dev_file, dev_btn2, dev_btn3, dev_btn4, dev_btn5])
187
+ gr.Markdown(
188
+ """
189
+ ## Made by
190
+ # Discord : hj_sss
191
+ ## official discord
192
+ ### [Click here and Join](https://discord.gg/K44Ka83BYT)
193
+
194
+ ### Members or group presets can be added and advertised. Check the official discord.
195
+ #### Check the objektify official discord for licensing and other data processing policies.
196
+ """)
197
+
198
+ generate_btn.click(fn=generate.sorting,
199
+ inputs=[img_type, img_static, img_dynamic_file, obj_color, obj_color_picker, ai_num, txt_color,
200
+ txt_color_picker, member_name_dropdown, group_name_radio, group_name_txt, obj_num,
201
+ obj_alphabet, obj_alphabet_txt, obj_serial, rounded], outputs=[edited_img, ex_img_f, ex_file_f])
202
+
203
+ ex_gen_file_count.change(fns.ex_gen_count, ex_gen_file_count, ex_img_b_out)
204
+ rounded.change(fns.rounded_sync, rounded, rounded_back)
205
+ rounded_back.change(fns.rounded_sync, rounded_back, rounded)
206
+
207
+ change_ai.click(fns.change_ran, obj_color, ai_num)
208
+
209
+ generate_btn_back.click(fn=generate.back,
210
+ inputs=[obj_color, obj_color_picker, ai_num, txt_color, txt_color_picker, group_name_radio,
211
+ group_name_txt, member_name_dropdown, obj_num, obj_alphabet, obj_alphabet_txt,
212
+ obj_serial, obj_outline_color, obj_outline_color_picker, logo_radio, class_radio,
213
+ class_txt, season_radio, season_txt, season_txt_outline, sign, qr_url_dropdown,
214
+ qr_Logo_radio, right_btn, rounded_back], outputs=[outputs2, ex_img_b])
215
+
216
+ back_tab.select(fn=generate.back,
217
+ inputs=[obj_color, obj_color_picker, ai_num, txt_color, txt_color_picker, group_name_radio,
218
+ group_name_txt, member_name_dropdown, obj_num, obj_alphabet, obj_alphabet_txt, obj_serial,
219
+ obj_outline_color, obj_outline_color_picker, logo_radio, class_radio, class_txt,
220
+ season_radio, season_txt, season_txt_outline, sign, qr_url_dropdown, qr_Logo_radio,
221
+ right_btn, rounded_back], outputs=[preview, ex_img_b])
222
+
223
+ ex_btn.click(fn=generate.ex_gen, inputs=[ex_img_f, ex_file_f, ex_img_b, ex_gen_file_count, ex_hide_blur, ex_hide_blur_range, watermark], outputs=[ex_img_f_out, ex_img_b_out])
224
+
225
+ if __name__ == "__main__":
226
+ print("http://localhost:7860")
227
+ demo.launch(server_name="0.0.0.0")
228
+