ikmalsaid commited on
Commit
a67dc5e
1 Parent(s): 9ee46dc

added/updated app files

Browse files
README.md CHANGED
@@ -5,7 +5,7 @@ colorFrom: gray
5
  colorTo: gray
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: gray
6
  sdk: gradio
7
  sdk_version: 4.20.1
8
+ app_file: app_sketchpad.py
9
  pinned: false
10
  license: agpl-3.0
11
  ---
app_sketchpad.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from modules.engine_sketchpad import *
2
+ feature = 'AI Sketchpad'
3
+
4
+ '''
5
+ _____________________________________________________________________
6
+
7
+ Copyright © 2023-2024 Ikmal Said. All rights reserved.
8
+
9
+ This program is the property of Ikmal Said. You may not reproduce
10
+ distribute, or modify this code without the express permission of
11
+ the author, Ikmal Said.
12
+ _____________________________________________________________________
13
+
14
+ '''
15
+ with ui.Blocks(css=css, title=title(feature), theme=theme, analytics_enabled=False, head=jsx) as stella:
16
+ with ui.Group():
17
+ input_sketch = ui.Paint(type='pil', label=title(feature), transforms=[],
18
+ brush=ui.Brush(default_size=12, default_color='#FFFFFF', colors=['#000000', '#FFFFFF', '#FF0000', '#00FF00', '#0000FF']),
19
+ eraser=ui.Eraser(default_size=12))
20
+
21
+ output_sketch = ui.Gallery(show_label=False, object_fit="contain", height="50vh", show_share_button=False, visible=False)
22
+ with ui.Row():
23
+ prompt_sketch = ui.Textbox(label=sprompt1, placeholder=spholder)
24
+ with ui.Row():
25
+ clear_sketch = ui.ClearButton(value="Reset", components=[input_sketch, output_sketch, prompt_sketch])
26
+ submit_sketch = ui.Button("Submit", variant="primary")
27
+ retry_sketch = ui.Button("Try Again", variant="primary", visible=False)
28
+
29
+ with ui.Accordion('More options', open=False):
30
+ style_sketch = ui.Dropdown(label=sstyle, choices=list(stella_v1.keys()), value='None', filterable=False)
31
+ model_sketch = ui.Dropdown(label=smodel, choices=list(ckpt_remix.keys()), value='Toon V1', filterable=False)
32
+ mode_sketch = ui.Dropdown(label=smode, choices=list(mode_remix), value='Scribble', filterable=False, visible=False)
33
+ quality_sketch = ui.Dropdown(label=squality, choices=quality, value='Enhanced', filterable=False)
34
+ smart_sketch = ui.Dropdown(label=ssmart, choices=['Disabled', 'Fusion'], value='Disabled', filterable=False)
35
+
36
+ process_sketch = submit_sketch.click(fn=submit, inputs=[input_sketch, prompt_sketch, model_sketch, style_sketch, mode_sketch, quality_sketch, smart_sketch], outputs=[input_sketch, output_sketch, submit_sketch, retry_sketch, output_sketch])
37
+ prompt_sketch.submit(fn=submit, inputs=[input_sketch, prompt_sketch, model_sketch, style_sketch, mode_sketch, quality_sketch, smart_sketch], outputs=[input_sketch, output_sketch, submit_sketch, retry_sketch, output_sketch])
38
+ clear_sketch.click(fn=reset, inputs=None, outputs=[input_sketch, output_sketch, submit_sketch, retry_sketch])
39
+ retry_sketch.click(fn=reset, inputs=None, outputs=[input_sketch, output_sketch, submit_sketch, retry_sketch])
40
+ input_sketch.change(fn=update, inputs=[input_sketch], outputs=[prompt_sketch])
41
+
42
+ if __name__ == "__main__":
43
+ stella.queue(default_concurrency_limit=100).launch(inbrowser=True, favicon_path="favicon.ico")
favicon.ico ADDED
modules/engine_describe.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests; from requests.exceptions import Timeout
2
+ from io import BytesIO
3
+
4
+ from modules.service_endpoints import *
5
+ from modules.service_configs import *
6
+
7
+ def describe(input_describe, progress=ui.Progress()):
8
+ image_bytes = BytesIO()
9
+ input_describe.save(image_bytes, format='jpeg')
10
+ print(receive())
11
+
12
+ payload = {'model_version': (None, '1')}; data = [('image',('_describe.jpg', image_bytes.getvalue(), 'image/jpeg'))]
13
+
14
+ try:
15
+ progress(0.95, desc="Describing image...")
16
+ response = requests.post(mode['describe'], headers=head, data=payload, files=data, timeout=30)
17
+ result = response.text.split(',', 1)
18
+ described = result[0]
19
+ print(done())
20
+ return described
21
+
22
+ except Timeout:
23
+ print(timeout())
24
+ ui.Warning(message=single_error)
25
+ return None
26
+
27
+ except Exception as e:
28
+ print(f"An error occurred: {e}")
29
+ ui.Warning(message=single_error)
30
+ return None
31
+
32
+ def describe_png(input_describe, progress=ui.Progress()):
33
+ image_bytes = BytesIO()
34
+ input_describe.save(image_bytes, format='png')
35
+ print(receive())
36
+
37
+ payload = {'model_version': (None, '1')}; data = [('image',('_describe.png', image_bytes.getvalue(), 'image/png'))]
38
+
39
+ try:
40
+ progress(0.95, desc="Describing image...")
41
+ response = requests.post(mode['describe'], headers=head, data=payload, files=data, timeout=30)
42
+ result = response.text.split(',', 1)
43
+ described = result[0]
44
+ print(done())
45
+ return described
46
+
47
+ except Timeout:
48
+ print(timeout())
49
+ ui.Warning(message=single_error)
50
+ return None
51
+
52
+ except Exception as e:
53
+ print(f"An error occurred: {e}")
54
+ ui.Warning(message=single_error)
55
+ return None
modules/engine_sketchpad.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests; from requests.exceptions import Timeout
2
+ from io import BytesIO; from PIL import Image, ImageEnhance; import concurrent.futures, time
3
+
4
+ from modules.service_endpoints import *
5
+ from modules.input_configs import *
6
+ from modules.models_remix import *
7
+ from modules.styles_v1 import *
8
+ from modules.service_configs import *
9
+ from modules.engine_upscale_alt import *
10
+ from modules.engine_describe import *
11
+
12
+ def sketch(input_sketch, prompt, model, style, type, quality):
13
+ image_bytes = BytesIO()
14
+ input_sketch.save(image_bytes, format='png')
15
+ prompt = stella_v1[style].format(prompt=prompt)
16
+
17
+ print(f"{receive()} -> {prompt}")
18
+
19
+ payload = {
20
+ 'model_version': (None, '1'),
21
+ 'prompt': (None, prompt),
22
+ 'style_id': (None, ckpt_remix[str(model)]),
23
+ 'control': (None, mode_remix[str(type)]),
24
+ 'negative_prompt': (None, 'hands, face, eyes, legs'),
25
+ 'strength': '40',
26
+ 'cfg': (None, '9.5'),
27
+ 'priority': (None, '1'),
28
+ }
29
+
30
+ data = {'image': ('input_sketch.png', image_bytes.getvalue(), 'image/png')}
31
+
32
+ try:
33
+ response = requests.post(mode['remix'], headers=head, data=payload, files=data, timeout=(60, 60))
34
+
35
+ print(done())
36
+
37
+ if quality == 'Enhanced':
38
+ print("better1 -> better output")
39
+ better1 = ImageEnhance.Contrast(
40
+ ImageEnhance.Color(
41
+ ImageEnhance.Brightness(
42
+ ImageEnhance.Sharpness(
43
+ Image.open(BytesIO(response.content))
44
+ ).enhance(2.00)
45
+ ).enhance(1.05)
46
+ ).enhance(1.05)
47
+ ).enhance(1.05)
48
+ return better1
49
+
50
+ if quality == 'Enhanced and Upscaled':
51
+ print("better2 -> better upscaled output")
52
+ better2 = ImageEnhance.Contrast(
53
+ ImageEnhance.Color(
54
+ ImageEnhance.Brightness(
55
+ ImageEnhance.Sharpness(
56
+ Image.open(BytesIO(response.content))
57
+ ).enhance(2.00)
58
+ ).enhance(1.05)
59
+ ).enhance(1.05)
60
+ ).enhance(1.05)
61
+ return upscale(better2)
62
+
63
+ else:
64
+ print("original -> raw output")
65
+ original = Image.open(BytesIO(response.content))
66
+ return original
67
+
68
+ except Timeout:
69
+ print(timeout())
70
+ return None
71
+
72
+ except Exception as e:
73
+ print(f"An error occurred: {e}")
74
+ ui.Warning(message=single_error)
75
+ return None
76
+
77
+ def quads_sketch(a, b, c, d, e, f, g, progress=ui.Progress()):
78
+ quantities = 2
79
+ result_list = [None] * quantities
80
+ percent = 0
81
+ if g == 'Fusion': b = translate(b)
82
+
83
+ with concurrent.futures.ThreadPoolExecutor() as executor:
84
+ futures = []
85
+
86
+ for i in range(quantities):
87
+ future = executor.submit(lambda x: sketch(a['composite'], b, c, d, e, f), i)
88
+ futures.append(future)
89
+ multiplier = 0.95 / quantities
90
+ percent += multiplier
91
+ progress(percent, desc=f"Generating results")
92
+ time.sleep(0.25)
93
+
94
+ for i, future in enumerate(futures):
95
+ result = future.result()
96
+ result_list[i] = result
97
+
98
+ successful_results = [result for result in result_list if result is not None]
99
+ return successful_results
100
+
101
+ def submit(a, b, c, d, e, f, g):
102
+ # input, output, submit, try again, sketch
103
+ return ui.ImageEditor(visible=False), ui.Gallery(visible=True), ui.Button(visible=False), ui.Button(visible=True), quads_sketch(a, b, c, d, e, f, g), ui.Button(visible=False)
104
+
105
+ def reset():
106
+ # input, output, submit, try again
107
+ return ui.ImageEditor(visible=True), ui.Gallery(visible=False), ui.Button(visible=True), ui.Button(visible=False), ui.Button(visible=True)
108
+
109
+ def update(a):
110
+ return describe_png(a['composite'])
modules/engine_upscale_alt.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests; from requests.exceptions import Timeout
2
+ from io import BytesIO; from PIL import Image
3
+
4
+ from modules.service_endpoints import *
5
+ from modules.service_configs import *
6
+
7
+ def upscale(upscale_input, progress=ui.Progress()):
8
+ image_bytes = BytesIO()
9
+ upscale_input.save(image_bytes, format='JPEG')
10
+ print(receive())
11
+
12
+ payload = {'model_version': (None, '1')}; data = [('image',('upscale_input.jpg', image_bytes.getvalue(), 'image/jpeg'))]
13
+
14
+ try:
15
+ progress(0.95, desc="Upscaling image...")
16
+ response = requests.post(mode['upscale'], headers=head, data=payload, files=data, timeout=(60, 60))
17
+
18
+ if len(response.content) < 65 * 1024:
19
+ print(reject())
20
+ ui.Warning(message=single_error)
21
+ return None
22
+
23
+ print(done())
24
+ return Image.open(BytesIO(response.content))
25
+
26
+ except Timeout:
27
+ print(timeout())
28
+ ui.Warning(message=single_error)
29
+ return None
30
+
31
+ except Exception as e:
32
+ print(f"An error occurred: {e}")
33
+ ui.Warning(message=single_error)
34
+ return None
modules/input_configs.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ratio = {
2
+ 'Square (1:1)': '1:1',
3
+ 'Standard TV (4:3)': '4:3',
4
+ '35mm Film (3:2)': '3:2',
5
+ 'Portrait (2:3)': '2:3',
6
+ 'Widescreen TV (16:9)': '16:9',
7
+ 'Portrait Wide (9:16)': '9:16',
8
+ 'Medium Format (5:4)': '5:4',
9
+ 'Portrait Medium (4:5)': '4:5',
10
+ 'Panoramic (3:1)': '3:1',
11
+ 'Portrait Standard (3:4)': '3:4'
12
+ }
13
+
14
+ quality = [
15
+ 'Original',
16
+ 'Enhanced',
17
+ 'Upscaled',
18
+ 'Enhanced and Upscaled'
19
+ ]
20
+
21
+ smart = [
22
+ 'Disabled',
23
+ 'Fusion',
24
+ 'Expansion',
25
+ 'Fusion and Expansion'
26
+ ]
modules/models_remix.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ckpt_remix = {
2
+ 'Anime V1': '21',
3
+ 'Toon V1': '22',
4
+ 'Realistic V1': '29'
5
+ }
6
+
7
+ mode_remix = {
8
+ 'Pose': 'openpose',
9
+ 'Scribble': 'scribble',
10
+ 'Line Art': 'lineart',
11
+ 'Depth': 'depth',
12
+ 'Canny': 'canny'
13
+ }
modules/service_configs.py ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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'
24
+ complete = 'Request Completed'
25
+ liability = 'STELLA can make mistakes and inaccuracies.'
26
+ rights = '© 2023-2024 Ikmal Said. All rights reserved.'
27
+ spholder = 'Imagine a person, place or anything!'
28
+ spholder1 = 'Elements to add into the image!'
29
+ spholder2 = 'Things to get rid of!'
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')}]"
44
+ def receive(): return f"{timestamp()} \U0001F680 {received}"
45
+ def timeout(): return f"{timestamp()} \U000023F0 {timed}"
46
+ def reject(): return f"{timestamp()} \U0000274C {rejected}"
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 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ mode = {
4
+ 'remix' : os.getenv('remix'),
5
+ 'describe' : os.getenv('describe'),
6
+ 'upscale' : os.getenv('upscale'),
7
+ 'fusion' : os.getenv('fusion')
8
+ }
9
+
10
+ head = {
11
+ 'bearer' : os.getenv('bearer')
12
+ }
modules/styles_v1.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ stella_v1 = {
2
+ 'None': '{prompt}',
3
+ '3D Game': '{prompt}, isometric 3d video game design, 3d game art, isometric game art, mobile game assets, fantasy video game, mobile game, 3d epic illustration, epic video game, stylized mobile game graphics',
4
+ 'Abstract Cityscape': '{prompt} abstract cityscape, Ultra Realistic Cinematic Light abstract, futuristic, cityscape, Out of focus background and incredible 16k resolution produced in Unreal Engine 5 and Octan render',
5
+ 'Abstract Vibrant': '{prompt}, vibrant, editorial, abstract elements, colorful, color splatter, realism, Inspired by the style of Ryan Hewett, dynamic realism, soft lighting and intricate details',
6
+ 'Amazonian': '{prompt}, amazonian cave, jungle, waterfall, moss-covered ancient ruins, Dramatic lighting and intense colors, mesmerizing details of the environment and breathtaking atmosphere',
7
+ 'Anime': '{prompt}, anime atmospheric, atmospheric anime, anime character; full body art, digital anime art, beautiful anime art style, anime picture, anime arts, beautiful anime style, digital advanced anime art, anime painting, anime artwork, beautiful anime art, detailed digital anime art, anime epic artwork',
8
+ 'Aquatic': '{prompt}, graceful movement with intricate details, inspired by artists like Lotte Reiniger, Carne Griffiths and Alphonse Mucha. Dreamy and surreal atmosphere, twirling in water surface',
9
+ 'Architecture': '{prompt}, modern architecture design, luxury architecture, bright, very beautiful, trending on unsplash, breath taking',
10
+ 'Avatar': '{prompt}, avatar movie, avatar with blue skin, vfx movie, cinematic lighting, utopian jungle, pandora jungle, sci-fi nether world, lost world, pandora fantasy, high quality render',
11
+ 'Bauhaus': '{prompt} Bauhaus art movement, by Wassily Kandinsky, bauhaus style painting, geometric abstraction, vibrant colors, painting',
12
+ 'Candyland': '{prompt}, candy land style, whimsical fantasy art, japanese pop surrealism, colorfull digital fantasy art, made of candy and lollypops, whimsical and dreamy',
13
+ 'Chromatic': '{prompt}, (((chromatic))) vaporwave nostalgia, vaporwave artwork, ((synthwave)), chromatic colors, , 3d render, vibrant chromatic colors, glowing chromatic colors',
14
+ 'Cinematic Render': '{prompt}, cinematic, breathtaking colors, close-up, cgscociety, computer rendering, by mike winkelmann, uhd, rendered in cinema4d, surface modeling, 8k, render octane, inspired by beksinski',
15
+ 'Claymation': '{prompt} clay animation, as a claymation character, claymation style, animation key shot, plasticine, clay animation, stopmotion animation, aardman character design, plasticine models',
16
+ 'Clip Art': '{prompt}, (((clip art))), clip art illustration, cartoon character, thin black stroke outline, pastel colors, cute illustration, vector illustration',
17
+ 'Coloring Book': '{prompt}, line art illustration, lineart behance hd, illustration line art style, line art colouring page, decora inspired illustrations, coloring pages, digital line-art, line art!!, thick line art, coloring book page, clean coloring book page, black ink line art, coloring page, detailed line art',
18
+ 'Comic Book': '{prompt}, Comic cover, 1960s marvel comic, comic book illustrations',
19
+ 'Comic V2': '{prompt}, comic book, john romita senior, inspired by Alton Tobey, by Alan Davis, arachnophobia, by Alton Tobey, as a panel of a marvel comic, marvel comic',
20
+ 'Cosmic': '{prompt}, in cosmic atmosphere, humanitys cosmic future, space art concept, scene in space, cosmic space, beautiful space star planet, background in space, realistic, cinematic, breathtaking view',
21
+ 'Crayon Art': '{prompt}, crayon drawing, inspired by Louis Valtat, inspired by Gabriele Münter, oil pastels, crayon on paper, crayon texture, crayon illustration, drawing done with crayons, pastel colors',
22
+ 'Cubism': '{prompt} cubist picasso, cubism, a cubist painting, heavy cubism, cubist painting, by Carlo Carrà, style of picasso, modern cubism, futuristic cubism',
23
+ 'Cyberpunk': '{prompt}, synthwave image, (neotokyo), dreamy colorful cyberpunk colors, cyberpunk blade runner art, retrofuturism, cyberpunk, beautiful cyberpunk style, cgsociety 9',
24
+ 'Disney': '{prompt}, disney animation, disney splash art, disney color palette, disney renaissance film, disney pixar movie still, disney art style, disney concept art :: nixri, wonderful compositions, pixar, disney concept artists, 2d character design',
25
+ 'Dystopian': '{prompt}, cifi world, cybernetic civilizations, peter gric and dan mumford, brutalist dark futuristic, dystopian brutalist atmosphere, dark dystopian world, cinematic 8k, end of the world, doomsday',
26
+ 'Elven': '{prompt}, elven lifestyle, photoreal, realistic, 32k quality, crafted by Elves and engraved in copper, elven fantasy land, hyper detailed',
27
+ 'Euphoric': '{prompt}, digital illustration, style of charlie bowater, dreamy colorful cyberpunk colors, euphoric fantasy, epic dreamlike fantasy, beautiful oil matte painting, 8k fantasy art, fantasy art, jessica rossier color scheme, dreamlike diffusion',
28
+ 'Extra-terrestrial': '{prompt}, deepdream cosmic, painting by android jones, cosmic entity, humanoid creature, james jean soft light 4 k, sci fi, extra terrestrial, cinematic',
29
+ 'Fantasy': '{prompt}, fantasy matte painting, ( ( thomas kinkade ) ), high exposure, highly detailed, tim white, michael whelan',
30
+ 'Firebender': '{prompt}, fire elements, fantasy, fire, lava, striking. A majestic composition with fire elements, fire and ashes surrounding, highly detailed and realistic, cinematic lighting',
31
+ 'Forestpunk': '{prompt}, forestpunk, vibrant, HDRI, organic motifs and pollen in the air, bold vibrant colors and textures, spectacular sparkling rays, photorealistic quality with Hasselblad',
32
+ 'Futuristic': '{prompt}, futuristic, elegant atmosphere, glowing lights, highly detailed, digital painting, artstation, concept art, smooth sharp focus, illustration, mars ravelo, gereg rutkowski',
33
+ 'GTA': '{prompt}, gta iv art style, gta art, gta loading screen art, gta chinatowon art style, gta 5 loading screen poster, grand theft auto 5, grand theft auto video game',
34
+ 'Glass Art': '{prompt}, inside glass ball, translucent sphere, cgsociety 9, glass orb, behance, polished, beautiful digital artwork, exquisite digital art, in a short round glass vase, octane render',
35
+ 'Glitch': '{prompt}, glitchwave, vaporwave pixel sorting, ((glitch art)), vektroid, glitch art aesthetic, psychedelic glitch art, glitch outline',
36
+ 'Gothic': '{prompt}, goth lifestyle, dark goth, grunge, cinematic photography, dramatic dark scenery, dark ambient beautiful',
37
+ 'Graffiti': '{prompt}, graffiti background, colorful graffiti, graffiti art style, colorful mural, ravi supa, symbolic mural, juxtapoz, pablo picasso, street art',
38
+ 'Halloween': '{prompt}, vibrant colors, halloween night, spooky aesthetic, creepy vibes, by Anne Stokes, digital painting style, illustration, bewitching, halloween, in a halloween style, dark theme, fearful atmosphere, supernatural, vibrant colors',
39
+ 'Haunted': '{prompt}, horror cgi 4 k, scary color art in 4 k, horror movie cinematography, insidious, la llorona, still from animated horror movie, film still from horror movie, haunted, eerie, unsettling, creepy',
40
+ 'Icon': '{prompt}, single vector graphics icon, ios icon, smooth shape, vector',
41
+ 'Illustration': '{prompt}, minimalistic vector art, illustrative style, style of ian hubert, style of gilles beloeil, inspired by Hsiao-Ron Cheng, style of jonathan solter, style of alexandre chaudret, by Echo Chernik',
42
+ 'Impressionism': '{prompt}, impressionism+++ , impressionist painting, style of claude monet, by Blanche Hoschedé Monet, impressionism and expressionism, impressionist art, monet painting',
43
+ 'Ink': '{prompt}, Black Ink, Hand drawn, Minimal art, artstation, artgem, monochrome',
44
+ 'Interior': '{prompt}, modern architecture by makoto shinkai, ilya kuvshinov, lois van baarle, rossdraws and frank lloyd wright',
45
+ 'Japanese Art': '{prompt}, Ukiyoe, illustration, muted colors',
46
+ 'Kawaii Chibi': '{prompt}, kawaii chibi romance, fantasy, illustration, Colorful idyllic cheerful, Kawaii Chibi inspired',
47
+ 'Knolling Case': '{prompt}, in square glass case, glass cube, glowing, knolling case, ash thorp, studio background, desktopography, cgsociety 9, cgsociety, mind-bending digital art',
48
+ 'Landscape': '{prompt}, landscape 4k, beautiful landscapes, nature wallpaper, 8k photography',
49
+ 'Logo': '{prompt}, creative logo, unique logo, visual identity, geometric type, graphic design, logotype design, brand identity, vector based, trendy typography, best of behance',
50
+ 'Macro Photography': '{prompt}, macro photography, award winning macro photography, depth of field, extreme closeup, 8k hd, focused',
51
+ 'Marble': '{prompt}, in greek marble style, classical antiquities, ancient greek classical ancient greek art, marble art, realistic, cinematic',
52
+ 'Medieval': '{prompt}, movie still from game of thrones, powerful fantasy epic, middle ages, olden times, roman empire, 1400 ce, highly detailed background, cinematic lighting, 8k render, high quality, bright colours',
53
+ 'Minecraft': '{prompt}, minecraft build, style of minecraft, pixel style, 8 bit, epic, cinematic, screenshot from minecraft, detailed natural lighting, minecraft gameplay, mojang, minecraft mods, minecraft in real life, blocky like minecraft',
54
+ 'Minimalism': '{prompt}, minimalism++ , minimal art, minimal aesthetic, minimal design, modern minimalism, minimal color palette, beautiful art, minimal vibes',
55
+ 'Mystical': '{prompt}, fireflies, deep focus, d&d, fantasy, intricate, elegant, highly detailed, digital painting, artstation, concept art, matte, sharp focus, illustration, hearthstrom, gereg rutkowski, alphonse mucha, andreas rocha',
56
+ 'Neo fauvism': '{prompt}, neo-fauvism painting, neo-fauvism movement, digital illustration, poster art, cgsociety saturated colors, fauvist',
57
+ 'Neon': '{prompt}, neon art style, night time dark with neon colors, blue neon lighting, violet and aqua neon lights, blacklight neon colors, rococo cyber neon lighting',
58
+ 'Origami': '{prompt} polygonal art, layered paper art, paper origami, wonderful compositions, folded geometry, paper craft, made from paper',
59
+ 'Painting': '{prompt}, atmospheric dreamscape painting, by Mac Conner, vibrant gouache painting scenery, vibrant painting, vivid painting, a beautiful painting, dream scenery art, instagram art, psychedelic painting, lofi art, bright art',
60
+ 'Palette Knife': '{prompt}, detailed impasto brush strokes, detail acrylic palette knife, thick impasto technique, palette knife, vibrant 8k colors',
61
+ 'PaperCut Style': '{prompt}, layered paper art, paper modeling art, paper craft, paper art, papercraft, paper cutout, paper cut out collage artwork, paper cut art',
62
+ 'Pattern': '{prompt} seamless pattern, ((repetitive pattern)), pattern design, background image, wallpaper, colorful, decorated, flat design',
63
+ 'Picaso': '{prompt}, painting, by pablo picaso, cubism',
64
+ 'Pixel Art': '{prompt}, one pixel brush, pixelart, colorful pixel art',
65
+ 'Polaroid': '{prompt}, old polaroid, 35mm',
66
+ 'Poly Art': '{prompt}, low poly, artstation, studio lightning, stainless steel, grey color scheme',
67
+ 'Pop Art': '{prompt}, pop art painting, detailed patterns pop art, silkscreen pop art, pop art poster, roy lichtenstein style',
68
+ 'Pop Art II': '{prompt}, style of shepherd fairey, (Andy Warhol art style), silkscreen pop art, martin ansin artwork, high contrast illustrations, lowbrow pop art style, trending on artstatioin, vector style',
69
+ 'Poster Art': '{prompt}, album art, Poster, layout, typography, logo, risography, ghibili, simon stalenhag, insane detail, artstation, 8k',
70
+ 'Product Photography': '{prompt}, product photo studio lighting, high detail product photo, product photography, commercial product photography, realistic, light, 8k, award winning product photography, professional closeup',
71
+ 'Psychedelic': '{prompt}, psychedelic painting, psychedelic dripping colors, colorful detailed projections, android jones and chris dyer, psychedelic vibrant colors, intricate psychedelic patterns, psychedelic visuals, hallucinatory art',
72
+ 'Rainbow': '{prompt}, intricate rainbow environment, rainbow bg, from lorax movie, pixar color palette, volumetric rainbow lighting, gorgeous digital painting, 8k cinematic',
73
+ 'Render': '{prompt}, isometric, polaroid octane render, 3 d render 1 5 0 mm lens, keyshot product render, rendered, keyshot product render pinterest, 3 d product render, 3 d cgi render, 3d cgi render, ultra wide angle isometric view',
74
+ 'Rennaisance': '{prompt}, renaissance period, neo-classical painting, italian renaissance workshop, pittura metafisica, raphael high renaissance, ancient roman painting, michelangelo painting, Leonardo da Vinci, italian renaissance architecture',
75
+ 'Retro': '{prompt}, retro futuristic illustration, featured on illustrationx, art deco illustration, beautiful retro art, stylized digital illustration, highly detailed vector art, ( ( mads berg ) ), automotive design art, epic smooth illustration, by mads berg, stylized illustration, ash thorp khyzyl saleem, clean vector art',
76
+ 'Retrowave': '{prompt}, Illustration, retrowave art, noen light, retro, digital art, trending on artstation',
77
+ 'Rococco': '{prompt}, francois boucher oil painting, rococco style, rococco lifestyle, a flemish Baroque, by Karel Dujardin, vintage look, cinematic hazy lighting',
78
+ 'Salvador Dali': '{prompt}, Painting, by salvador dali, allegory, surrealism, religious art, genre painting, portrait, painter, still life',
79
+ 'Samurai': '{prompt}, samurai lifesyle, miyamoto musashi, Japanese art, ancient japanese samurai, feudal japan art, feudal japan art',
80
+ 'Scatter': '{prompt}, breaking pieces, exploding pieces, shattering pieces, disintegration, contemporary digital art, inspired by Dan Hillier, inspired by Igor Morski, dramatic digital art, behance art, cgsociety 9, 3d advanced digital art, mind-bending digital art, disintegrating',
81
+ 'Shamrock Fantasy': '{prompt}, shamrock fantasy, fantasy, vivid colors, grapevine, celtic fantasy art, lucky clovers, dreamlike atmosphere, captivating details, soft light and vivid colors',
82
+ 'Sketch': '{prompt}, pencil, hand drawn, sketch, on paper',
83
+ 'Stained Glass': '{prompt} intricate wiccan spectrum, stained glass art, vividly beautiful colors, beautiful stained glass window, colorful image, intricate stained glass triptych, gothic stained glass style, stained glass window!!!',
84
+ 'Steampunk': '{prompt}, steampunk, stylized digital illustration, sharp focus, elegant, intricate, digital painting, artstation concept art, global illumination, ray tracing, advanced technology, chaykan howard, campion pascal, cooke darwin, davis jack, pink atmosphere',
85
+ 'Sticker': '{prompt}, sticker, sticker art, symmetrical sticker design, sticker - art, sticker illustration, die - cut sticker',
86
+ 'Studio Ghibli': '{prompt} by Hayao Mayazaki, Studio Ghibli, Studio Ghibli Style, Ghibli Style art, Ghibli Style characters, cartoon style, beautifully rendered and expressive rich colors, vibrant pastel colors, imaginative and fantastical landscapes, sharp attention to detail, realism and a strong sense of nostalgia and warmth, sharp attention to small details and textures, fantastical creatures, settings, depth and emotions emphasized and accentuated by lighting and shading, extremely high quality, incredibly high finite definition, high resolution, hand-drawn and cel animation techniques, anime, 4k',
87
+ 'Surrealism': '{prompt}, salvador dali painting, highly detailed surrealist art, surrealist conceptual art, masterpiece surrealism, surreal architecture, surrealistic digital artwork, whimsical surrealism, bizarre art',
88
+ 'Tattoo': '{prompt}, tattoo design, tattoo designs++ , black ink tattoo, line art, extraordinary designs, artistic tattoos, black and white tattoo, impressive, graphic illustrations, tattoo on skin, creative designs, vibrant colors, unique tattoos',
89
+ 'Van Gogh': '{prompt}, painting, by van gogh',
90
+ 'Vibrant': '{prompt}, Psychedelic, water colors spots, vibrant color scheme, highly detailed, romanticism style, cinematic, artstation, greg rutkowski',
91
+ 'Vibrant Viking': '{prompt}, Viking era, digital painting, pop of colour, forest, paint splatter, flowing colors, Background of lush forest and earthy tones, Artistic representation of movement and atmosphere',
92
+ 'Waterbender': '{prompt} water elements, fantasy, water, exotic, A majestic composition with water elements, waterfall, lush moss and exotic flowers, highly detailed and realistic, dynamic lighting',
93
+ 'Woolitize': '{prompt} cute! c4d, made out of wool, volumetric wool felting, wool felting art, houdini sidefx, rendered in arnold, soft smooth lighting, soft pastel colors',
94
+ }