ikmalsaid commited on
Commit
e1a7cd9
1 Parent(s): 3f64b95

added/updated app files

Browse files
README.md CHANGED
@@ -5,7 +5,7 @@ colorFrom: pink
5
  colorTo: pink
6
  sdk: gradio
7
  sdk_version: 4.20.1
8
- app_file: app.py
9
  pinned: false
10
  license: agpl-3.0
11
  ---
 
5
  colorTo: pink
6
  sdk: gradio
7
  sdk_version: 4.20.1
8
+ app_file: app_inpaint.py
9
  pinned: false
10
  license: agpl-3.0
11
  ---
app.py DELETED
@@ -1,45 +0,0 @@
1
- import gradio as ui; from modules.engine_inpaint import *
2
- feature = 'Image Inpainting'
3
- '''
4
- _____________________________________________________________________
5
-
6
- Copyright © 2023-2024 Ikmal Said. All rights reserved.
7
-
8
- This program is the property of Ikmal Said. You may not reproduce
9
- distribute, or modify this code without the express permission of
10
- the author, Ikmal Said.
11
- _____________________________________________________________________
12
-
13
- '''
14
- with ui.Blocks(css=css, title=title(feature), theme=theme, analytics_enabled=False) as stella:
15
- with ui.Tabs() as tabs_inpaint:
16
- with ui.TabItem(title(feature), id=0):
17
- with ui.Group():
18
- input_inpaint = ui.ImageEditor(
19
- show_label=False, transforms=[],
20
- brush=ui.Brush(default_size=24, colors=['#ffffff'], color_mode=['fixed']),
21
- eraser=ui.Eraser(default_size=24), sources=['upload', 'webcam'])
22
-
23
- prompt_inpaint = ui.Textbox(label="What to include:", show_copy_button=True, placeholder=spholder1)
24
-
25
- with ui.Row():
26
- submit_inpaint = ui.Button("Submit", variant="primary")
27
-
28
- prompt_example = ui.Examples(label="AI Enhance keywords:", examples=['highly detailed face', 'detailed girl face', 'detailed man face', 'detailed hand', 'detailed leg', 'beautiful eyes'], inputs=[prompt_inpaint])
29
- with ui.Accordion('Advanced', open=False):
30
- negative_inpaint = ui.Textbox(label="What not to include:", show_copy_button=True, placeholder=spholder2)
31
- number_inpaint = ui.Dropdown(label=snumber, choices=[1,2,3,4], value=4, filterable=False)
32
-
33
- with ui.TabItem('Result', id=1):
34
- with ui.Group():
35
- output_inpaint = ui.Gallery(preview=True, show_label=False, object_fit="contain", height="43.4vh", show_share_button=False)
36
-
37
- with ui.Row():
38
- clear_inpaint = ui.ClearButton(value="Reset", components=[input_inpaint, output_inpaint, prompt_inpaint, negative_inpaint])
39
-
40
- process_inpaint = submit_inpaint.click(fn=inpaint2, inputs=[input_inpaint, prompt_inpaint, negative_inpaint, number_inpaint], outputs=[tabs_inpaint, input_inpaint, output_inpaint])
41
- prompt_inpaint.submit(fn=inpaint2, inputs=[input_inpaint, prompt_inpaint, negative_inpaint, number_inpaint], outputs=[tabs_inpaint, input_inpaint, output_inpaint])
42
- clear_inpaint.click(fn=reset, inputs=None, outputs=tabs_inpaint)
43
-
44
- if __name__ == "__main__":
45
- stella.queue(default_concurrency_limit=100, api_open=True).launch(inbrowser=True, favicon_path="favicon.ico")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app_inpaint.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from modules.engine_inpaint import *
2
+ feature = 'Image Inpainting'
3
+ '''
4
+ _____________________________________________________________________
5
+
6
+ Copyright © 2023-2024 Ikmal Said. All rights reserved.
7
+
8
+ This program is the property of Ikmal Said. You may not reproduce
9
+ distribute, or modify this code without the express permission of
10
+ the author, Ikmal Said.
11
+ _____________________________________________________________________
12
+
13
+ '''
14
+ with ui.Blocks(css=adj+css, title=title(feature), theme=theme, analytics_enabled=False, head=jsx) as stella:
15
+ with ui.Group():
16
+ input_inpaint = ui.ImageEditor(
17
+ label=title(feature), transforms=[],
18
+ brush=ui.Brush(default_size=24, colors=['#ffffff'], color_mode=['fixed']),
19
+ eraser=ui.Eraser(default_size=24), sources=['upload', 'webcam'])
20
+
21
+ output_inpaint = ui.Gallery(preview=True, show_label=False, object_fit="contain", height="50vh", show_share_button=False, visible=False)
22
+ prompt_inpaint = ui.Textbox(label="What to change:", placeholder=spholder1)
23
+ prompt_example = ui.Examples(label="Enhance keywords:", examples=['highly detailed face', 'detailed girl face', 'detailed man face', 'detailed hand'], inputs=[prompt_inpaint])
24
+ smart_inpaint = ui.Dropdown(label=ssmart, choices=['Disabled', 'Fusion'], value='Disabled', filterable=False)
25
+
26
+ with ui.Row():
27
+ clear_inpaint = ui.ClearButton(value="Reset", components=[input_inpaint, output_inpaint, prompt_inpaint])
28
+ submit_inpaint = ui.Button("Submit", variant="primary")
29
+ retry_inpaint = ui.Button("Try Again", variant="primary", visible=False)
30
+
31
+ process_inpaint = submit_inpaint.click(fn=submit, inputs=[input_inpaint, prompt_inpaint, smart_inpaint], outputs=[input_inpaint, output_inpaint, submit_inpaint, retry_inpaint, output_inpaint])
32
+ prompt_inpaint.submit(fn=submit, inputs=[input_inpaint, prompt_inpaint, smart_inpaint], outputs=[input_inpaint, output_inpaint, submit_inpaint, retry_inpaint, output_inpaint])
33
+ clear_inpaint.click(fn=reset, inputs=None, outputs=[input_inpaint, output_inpaint, submit_inpaint, retry_inpaint])
34
+ retry_inpaint.click(fn=reset, inputs=None, outputs=[input_inpaint, output_inpaint, submit_inpaint, retry_inpaint])
35
+
36
+ if __name__ == "__main__":
37
+ print(css+adj)
38
+ stella.queue(default_concurrency_limit=100).launch(inbrowser=True, favicon_path="favicon.ico")
39
+
modules/engine_inpaint.py CHANGED
@@ -1,32 +1,24 @@
1
- import gradio as ui; import requests; from requests.exceptions import Timeout, ConnectionError
2
  from io import BytesIO; from PIL import Image; import concurrent.futures, time
3
 
4
- ###################################################################################################################
5
- # Import from modules
6
- ###################################################################################################################
7
-
8
  from modules.service_endpoints import *
9
  from modules.service_configs import *
10
 
11
- ###################################################################################################################
12
- # Image inpaint process
13
- ###################################################################################################################
14
-
15
- def inpaint(input_image, input_mask, prompt, negative):
16
  image_pil = Image.fromarray(input_image)
17
  mask_pil = Image.fromarray(input_mask)
18
 
19
  image_bytes = BytesIO()
20
  mask_bytes = BytesIO()
21
- image_pil.save(image_bytes, format='PNG')
22
- mask_pil.save(mask_bytes, format='PNG')
23
 
24
  print(f"{receive()} -> {prompt}")
25
 
26
  payload = {
27
  'model_version': (None, '1'),
28
  'prompt': (None, prompt),
29
- 'neg_prompt': (None, f"({negative}), hands, face, eyes, legs"),
30
  'inpaint_strength': (None, '0.75'),
31
  'cfg': (None, '9.5'),
32
  'priority': (None, '1'),
@@ -38,7 +30,7 @@ def inpaint(input_image, input_mask, prompt, negative):
38
  }
39
 
40
  try:
41
- response = requests.post(mode['inpaint'], headers=head, data=payload, files=data, timeout=(None, None))
42
 
43
  if len(response.content) < 0 * 1024:
44
  print(reject())
@@ -56,24 +48,21 @@ def inpaint(input_image, input_mask, prompt, negative):
56
  ui.Warning(message=single_error)
57
  return None
58
 
59
- ###################################################################################################################
60
- # 4 image for each generation
61
- ###################################################################################################################
62
-
63
- def quads_inpaint(a, b, c, d, progress=ui.Progress()):
64
- quantities = int(d)
65
  result_list = [None] * quantities
66
  percent = 0
67
-
 
68
  with concurrent.futures.ThreadPoolExecutor() as executor:
69
  futures = []
70
 
71
  for i in range(quantities):
72
- future = executor.submit(lambda x: inpaint(a["background"], a["layers"][0], b, c), i)
73
  futures.append(future)
74
- multiplier = 0.99 / quantities
75
  percent += multiplier
76
- progress(percent, desc=f"Processing image {i + 1} of {quantities}")
77
  time.sleep(0.25)
78
 
79
  for i, future in enumerate(futures):
@@ -81,17 +70,12 @@ def quads_inpaint(a, b, c, d, progress=ui.Progress()):
81
  result_list[i] = result
82
 
83
  successful_results = [result for result in result_list if result is not None]
84
-
85
- if len(successful_results) < quantities:
86
- if quantities == 1:
87
- ui.Warning(message=single_error)
88
- else:
89
- ui.Warning(message=quads_error)
90
-
91
  return successful_results
92
 
93
- def inpaint2(a, b, c, d):
94
- return ui.Tabs(selected=1), a, quads_inpaint(a, b, c, d)
 
95
 
96
  def reset():
97
- return ui.Tabs(selected=0)
 
 
1
+ import requests; from requests.exceptions import Timeout, ConnectionError
2
  from io import BytesIO; from PIL import Image; import concurrent.futures, time
3
 
 
 
 
 
4
  from modules.service_endpoints import *
5
  from modules.service_configs import *
6
 
7
+ def inpaint(input_image, input_mask, prompt):
 
 
 
 
8
  image_pil = Image.fromarray(input_image)
9
  mask_pil = Image.fromarray(input_mask)
10
 
11
  image_bytes = BytesIO()
12
  mask_bytes = BytesIO()
13
+ image_pil.save(image_bytes, format='PNG', optimize=True)
14
+ mask_pil.save(mask_bytes, format='PNG', optimize=True)
15
 
16
  print(f"{receive()} -> {prompt}")
17
 
18
  payload = {
19
  'model_version': (None, '1'),
20
  'prompt': (None, prompt),
21
+ 'neg_prompt': (None, "hands, face, eyes, legs"),
22
  'inpaint_strength': (None, '0.75'),
23
  'cfg': (None, '9.5'),
24
  'priority': (None, '1'),
 
30
  }
31
 
32
  try:
33
+ response = requests.post(mode['inpaint'], headers=head, data=payload, files=data, timeout=(120, 120))
34
 
35
  if len(response.content) < 0 * 1024:
36
  print(reject())
 
48
  ui.Warning(message=single_error)
49
  return None
50
 
51
+ def quads_inpaint(a, b, c, progress=ui.Progress()):
52
+ quantities = 2
 
 
 
 
53
  result_list = [None] * quantities
54
  percent = 0
55
+ if c == 'Fusion': b = translate(b)
56
+
57
  with concurrent.futures.ThreadPoolExecutor() as executor:
58
  futures = []
59
 
60
  for i in range(quantities):
61
+ future = executor.submit(lambda x: inpaint(a["background"], a["layers"][0], b), i)
62
  futures.append(future)
63
+ multiplier = 0.95 / quantities
64
  percent += multiplier
65
+ progress(percent, desc=f"Generating results")
66
  time.sleep(0.25)
67
 
68
  for i, future in enumerate(futures):
 
70
  result_list[i] = result
71
 
72
  successful_results = [result for result in result_list if result is not None]
 
 
 
 
 
 
 
73
  return successful_results
74
 
75
+ def submit(a, b, c):
76
+ # input, output, submit, try again, inpaint
77
+ return ui.ImageEditor(visible=False), ui.Gallery(visible=True), ui.Button(visible=False), ui.Button(visible=True), quads_inpaint(a, b, c)
78
 
79
  def reset():
80
+ # input, output, submit, try again
81
+ return ui.ImageEditor(visible=True), ui.Gallery(visible=False), ui.Button(visible=True), ui.Button(visible=False)
modules/service_configs.py CHANGED
@@ -1,53 +1,23 @@
1
- import gradio as ui; from datetime import datetime; import logging
 
2
 
3
  # enable debug
4
  logging.basicConfig(level=logging.DEBUG)
5
 
6
  # global theme
7
  theme = ui.themes.Default(
8
- font=[ui.themes.GoogleFont('Roboto Condensed'), 'Arial'],
9
- text_size=ui.themes.Size(lg="16px", md="16px", sm="16px", xl="16px", xs="16px", xxl="16px", xxs="16px"),
10
  primary_hue='rose', secondary_hue='rose', neutral_hue='zinc', radius_size=ui.themes.sizes.radius_none)
11
 
12
- css = '''
13
- footer {
14
- display: none !important;
15
- }
16
-
17
- div.svelte-vt1mxs>*, div.svelte-vt1mxs>.form > * {
18
- border: none;
19
- }
20
-
21
- .app.svelte-182fdeq.svelte-182fdeq {
22
- padding: 0px !important;
23
- }
24
-
25
- .grid-wrap.svelte-hpz95u.svelte-hpz95u {
26
- overflow-y: auto !important;
27
- }
28
-
29
- .selected.svelte-1uw5tnk {
30
- background: #262629 !important;
31
- }
32
-
33
- .closed.svelte-g7pfx4>button.svelte-g7pfx4 {
34
- display: none !important;
35
- }
36
-
37
- gradio-app {
38
- background: none !important;
39
- }
40
-
41
- input.svelte-1f354aw.svelte-1f354aw, textarea.svelte-1f354aw.svelte-1f354aw {
42
- text-align: justify !important;
43
- }
44
- '''
45
-
46
  # global locale - english
47
  success = 'That worked successfully!'
48
  single_error = 'That did not work!'
49
  quads_error = 'Some images cannot be processed!'
50
  empty_error = 'Prompt field cannot be empty!'
 
 
 
51
  received = 'Request Received'
52
  timed = 'Request Timeout'
53
  rejected = 'Request Error/Rejected'
@@ -60,12 +30,14 @@ spholder2 = 'Things to get rid of!'
60
  spholder3 = 'Put wonders into the generated prompt!'
61
  sprompt = 'Generate images of:'
62
  sprompt1 = 'Based on image, create:'
 
63
  smodel = 'Using the AI model:'
64
  smode = 'Using the mode:'
65
  sratio = 'In the size of:'
66
  sstyle = 'Inspired by the style of:'
67
  squality = 'At a quality level of:'
68
  snumber = 'With a quantity of:'
 
69
 
70
  # global function
71
  def timestamp(): return f"[{datetime.now().strftime('%d/%m/%y at %H:%M:%S')}]"
@@ -75,4 +47,235 @@ def reject(): return f"{timestamp()} \U0000274C {rejected}"
75
  def done(): return f"{timestamp()} \U0001F618 {complete}"
76
  def header(feature): ui.HTML(f'<center><h4 style="font-size: 1em; margin: 5px 0px 5px">{feature}</h4></center>')
77
  def footer(): ui.HTML(f'<center><h4 style="font-size: 1em; margin: 5px 0px 0px">{liability}<br></h4>{rights}</center>')
78
- def title(feature): return f"{feature}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as ui; from datetime import datetime; import logging, requests, json, random
2
+ from modules.service_endpoints import *; import numpy as np
3
 
4
  # enable debug
5
  logging.basicConfig(level=logging.DEBUG)
6
 
7
  # global theme
8
  theme = ui.themes.Default(
9
+ font=[ui.themes.GoogleFont('IBM Plex Sans Condensed')], font_mono=[ui.themes.GoogleFont('IBM Plex Sans Condensed')],
10
+ text_size=ui.themes.Size(lg="18px", md="18px", sm="18px", xl="18px", xs="18px", xxl="18px", xxs="18px"),
11
  primary_hue='rose', secondary_hue='rose', neutral_hue='zinc', radius_size=ui.themes.sizes.radius_none)
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  # global locale - english
14
  success = 'That worked successfully!'
15
  single_error = 'That did not work!'
16
  quads_error = 'Some images cannot be processed!'
17
  empty_error = 'Prompt field cannot be empty!'
18
+ pf_error = 'Prompt fusion error. Proceeding...'
19
+ pe_error = 'Prompt expansion error. Proceeding...'
20
+ pe_cmd = '(The prompt must intricately describe every part of the image in concrete, objective detail. THINK about what the end goal of the description is, and extrapolate that to what would make satisfying images.)'
21
  received = 'Request Received'
22
  timed = 'Request Timeout'
23
  rejected = 'Request Error/Rejected'
 
30
  spholder3 = 'Put wonders into the generated prompt!'
31
  sprompt = 'Generate images of:'
32
  sprompt1 = 'Based on image, create:'
33
+ sprompt2 = 'Based on image, it shows:'
34
  smodel = 'Using the AI model:'
35
  smode = 'Using the mode:'
36
  sratio = 'In the size of:'
37
  sstyle = 'Inspired by the style of:'
38
  squality = 'At a quality level of:'
39
  snumber = 'With a quantity of:'
40
+ ssmart = 'Using SmartPrompt™ mode:'
41
 
42
  # global function
43
  def timestamp(): return f"[{datetime.now().strftime('%d/%m/%y at %H:%M:%S')}]"
 
47
  def done(): return f"{timestamp()} \U0001F618 {complete}"
48
  def header(feature): ui.HTML(f'<center><h4 style="font-size: 1em; margin: 5px 0px 5px">{feature}</h4></center>')
49
  def footer(): ui.HTML(f'<center><h4 style="font-size: 1em; margin: 5px 0px 0px">{liability}<br></h4>{rights}</center>')
50
+ def title(feature): return f"{feature}"
51
+
52
+ # seed generator
53
+ max_seed = np.iinfo(np.int32).max
54
+
55
+ def seeds(a, i: ui.SelectData):
56
+ print(f"Seed mode: {a}")
57
+ if i.value == 'Fixed': return ui.Slider(value=random.randint(0, max_seed), visible=True)
58
+ else: return ui.Slider(visible=False)
59
+
60
+ # prompt fusion to en
61
+ def translate(fusion, progress=ui.Progress()):
62
+ progress(0.05, desc="Initiating fusion")
63
+ try: print(f"{receive()} -> {fusion}"); return requests.get(f"{mode['fusion']}{fusion}", timeout=15).json()[0][0]
64
+ except Exception as e: print(pf_error, e); return fusion
65
+
66
+ # prompt expander
67
+ def expand(expand, progress=ui.Progress()):
68
+ progress(0.10, desc="Initiating expansion")
69
+ # return str(input)
70
+ head = {'Content-Type': 'application/json'}
71
+ body = json.dumps({"sentence": f"{expand} {pe_cmd}", "target_word_count": 30})
72
+ # body = json.dumps({"topic": input, "word_count": 30, "writing_mode": "Simple", "story_genre": "Descriptive"}) # ['story']
73
+ try: print(f"{receive()} -> {expand}"); return requests.post(url=mode['expander'], headers=head, data=body, timeout=15).json()['expanded_sentence']
74
+ except Exception as e: print(pe_error, e); return expand
75
+
76
+ # global head script
77
+ jsx = '''
78
+ <script>
79
+ window.onbeforeunload = function (event) {
80
+ event.returnValue = "Are you sure you want to leave?";
81
+ };
82
+ </script>
83
+ '''
84
+
85
+ # specific css modifiers
86
+ adj = '''
87
+ /* remove layers button */
88
+ .layer-wrap.svelte-g7pfx4.svelte-g7pfx4 {
89
+ display: none !important;
90
+ }
91
+ '''
92
+
93
+ adj2 = '''
94
+ .grid-wrap.svelte-hpz95u.svelte-hpz95u {
95
+ height: 49.8vh;
96
+ }
97
+ '''
98
+
99
+ # global css modifiers
100
+ css = '''
101
+ /* remove scrollbars */
102
+ ::-webkit-scrollbar {
103
+ display: none;
104
+ }
105
+
106
+ ::-webkit-scrollbar-button {
107
+ display: none;
108
+ }
109
+
110
+ body {
111
+ -ms-overflow-style: none;
112
+ }
113
+
114
+ /* remove footer */
115
+ footer {
116
+ display: none !important;
117
+ }
118
+
119
+ /* remove all padding */
120
+ .app.svelte-182fdeq.svelte-182fdeq {
121
+ padding: 0px;
122
+ }
123
+
124
+ /* remove scroll bar in gallery */
125
+ .grid-wrap.svelte-hpz95u.svelte-hpz95u {
126
+ overflow-y: auto;
127
+ }
128
+
129
+ /* remove background */
130
+ gradio-app {
131
+ background: none !important;
132
+ }
133
+
134
+ /* remove borders for tabs*/
135
+ div.svelte-iyf88w {
136
+ border: 0px;
137
+ }
138
+
139
+ /* remove padding for tabs */
140
+ div.svelte-19hvt5v {
141
+ padding: 0px;
142
+ border: 0px;
143
+ }
144
+
145
+ /* remove borders for tab button bottom*/
146
+ .tab-nav.svelte-1uw5tnk {
147
+ border: 0px;
148
+ }
149
+
150
+ /* remove borders for tab button*/
151
+ button.svelte-1uw5tnk {
152
+ border: 0px;
153
+ }
154
+
155
+ /* modify container padding and bg */
156
+ .hide-container.svelte-90oupt {
157
+ padding: var(--block-padding);
158
+ background: var(--block-background-fill);
159
+ }
160
+
161
+ /* set brush to red */
162
+ span.svelte-btgkrd {
163
+ background: rgb(255 0 0 / 60%);
164
+ }
165
+
166
+ /* remove example symbol */
167
+ svg.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno {
168
+ display: none;
169
+ }
170
+
171
+ /* replace selected tab color */
172
+ .selected.svelte-1uw5tnk {
173
+ background: #27272a;
174
+ }
175
+
176
+ /* justify textbox */
177
+ input.svelte-1f354aw.svelte-1f354aw,
178
+ textarea.svelte-1f354aw.svelte-1f354aw {
179
+ text-align: justify;
180
+ }
181
+
182
+ /* modify feature text */
183
+ label.float.svelte-1b6s6s {
184
+ padding-left: 10px;
185
+ padding-top: 6px;
186
+ }
187
+
188
+ /* change feature background */
189
+ label.svelte-1b6s6s {
190
+ background: #27272a;
191
+ }
192
+
193
+ /* remove feature icon */
194
+ span.svelte-1b6s6s {
195
+ display: none;
196
+ }
197
+
198
+ /* remove options line */
199
+ div.svelte-sfqy0y {
200
+ background: none;
201
+ }
202
+
203
+ /* modify layer button */
204
+ .layer-wrap.svelte-g7pfx4.svelte-g7pfx4 {
205
+ background: #27272a;
206
+ }
207
+
208
+ /* modify slider color */
209
+ .dark, .light {
210
+ --slider-color: var(--color-accent);
211
+ }
212
+
213
+ /* chanhe num input padding and height */
214
+ input[type="number"].svelte-pjtc3.svelte-pjtc3 {
215
+ padding: var(--checkbox-label-padding);
216
+ height: 45px;
217
+ }
218
+
219
+ /* disable anti-aliasing on gallery thumb */
220
+ .thumbnail-lg.svelte-hpz95u>img {
221
+ image-rendering: auto;
222
+ }
223
+
224
+ /* disable anti-aliasing on gallery view */
225
+ .image-button.svelte-hpz95u img {
226
+ image-rendering: auto;
227
+ }
228
+
229
+ /* make gallery buttons bigger */
230
+ .icon-buttons.svelte-hpz95u.svelte-hpz95u {
231
+ scale: 2;
232
+ padding-top: 8px;
233
+ padding-right: 15px;
234
+ }
235
+
236
+ /* make img clear btn bigger */
237
+ div.svelte-s6ybro {
238
+ scale: 2;
239
+ padding-right: 5px;
240
+ padding-top: 5px;
241
+ }
242
+
243
+ /* make img dload btn bigger */
244
+ .icon-buttons.svelte-1l6wqyv {
245
+ top: 8px;
246
+ right: 8px;
247
+ scale: 2;
248
+ padding-right: 5px;
249
+ padding-top: 5px;
250
+ }
251
+
252
+ /* remove bg completely */
253
+ body {
254
+ background: none !important;
255
+ }
256
+
257
+ /* wide mode */
258
+ .app.svelte-182fdeq.svelte-182fdeq {
259
+ max-width: 100% !important;
260
+ }
261
+
262
+ /* make prompt consistant */
263
+ label.svelte-1f354aw.svelte-1f354aw {
264
+ padding: 12px;
265
+ }
266
+
267
+ /* remove accord label */
268
+ .label-wrap.open.svelte-s1r2yt {
269
+ display: none;
270
+ }
271
+
272
+ /* make empty gallery taller */
273
+ .unpadded_box.svelte-1oiin9d {
274
+ min-height: 50vh;
275
+ }
276
+
277
+ /* make image contain */
278
+ .image-frame.svelte-rrgd5g img {
279
+ object-fit: contain;
280
+ }
281
+ '''
modules/service_endpoints.py CHANGED
@@ -1,7 +1,8 @@
1
  import os
2
 
3
  mode = {
4
- 'inpaint' : os.getenv('inpaint')
 
5
  }
6
 
7
  head = {
 
1
  import os
2
 
3
  mode = {
4
+ 'inpaint' : os.getenv('inpaint'),
5
+ 'fusion' : os.getenv('fusion')
6
  }
7
 
8
  head = {