Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,43 @@ import time
|
|
7 |
from PIL import Image
|
8 |
from deep_translator import GoogleTranslator
|
9 |
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
|
12 |
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
@@ -88,13 +125,13 @@ examples = [
|
|
88 |
|
89 |
css = """
|
90 |
#app-container {
|
91 |
-
max-width:
|
92 |
margin-left: auto;
|
93 |
margin-right: auto;
|
94 |
}
|
95 |
"""
|
96 |
|
97 |
-
with gr.Blocks(theme=
|
98 |
gr.HTML("<center><h1>FLUX.1-Dev with LoRA support</h1></center>")
|
99 |
with gr.Column(elem_id="app-container"):
|
100 |
with gr.Row():
|
|
|
7 |
from PIL import Image
|
8 |
from deep_translator import GoogleTranslator
|
9 |
import json
|
10 |
+
from fastapi import FastAPI
|
11 |
+
|
12 |
+
app = FastAPI()
|
13 |
+
|
14 |
+
#----------Start of theme----------
|
15 |
+
theme = gr.themes.Soft(
|
16 |
+
primary_hue="zinc",
|
17 |
+
secondary_hue="stone",
|
18 |
+
font=[gr.themes.GoogleFont('Kavivanar'), gr.themes.GoogleFont('Kavivanar'), 'system-ui', 'sans-serif'],
|
19 |
+
font_mono=[gr.themes.GoogleFont('Source Code Pro'), gr.themes.GoogleFont('Inconsolata'), gr.themes.GoogleFont('Inconsolata'), 'monospace'],
|
20 |
+
).set(
|
21 |
+
body_background_fill='*primary_100',
|
22 |
+
body_text_color='secondary_600',
|
23 |
+
body_text_color_subdued='*primary_500',
|
24 |
+
body_text_weight='500',
|
25 |
+
background_fill_primary='*primary_100',
|
26 |
+
background_fill_secondary='*secondary_200',
|
27 |
+
color_accent='*primary_300',
|
28 |
+
border_color_accent_subdued='*primary_400',
|
29 |
+
border_color_primary='*primary_400',
|
30 |
+
block_background_fill='*primary_300',
|
31 |
+
block_border_width='*panel_border_width',
|
32 |
+
block_info_text_color='*primary_700',
|
33 |
+
block_info_text_size='*text_md',
|
34 |
+
panel_background_fill='*primary_200',
|
35 |
+
accordion_text_color='*primary_600',
|
36 |
+
table_text_color='*primary_600',
|
37 |
+
input_background_fill='*primary_50',
|
38 |
+
input_background_fill_focus='*primary_100',
|
39 |
+
button_primary_background_fill='*primary_500',
|
40 |
+
button_primary_background_fill_hover='*primary_400',
|
41 |
+
button_primary_text_color='*primary_50',
|
42 |
+
button_primary_text_color_hover='*primary_100',
|
43 |
+
button_cancel_background_fill='*primary_500',
|
44 |
+
button_cancel_background_fill_hover='*primary_400'
|
45 |
+
)
|
46 |
+
#----------End of theme----------
|
47 |
|
48 |
|
49 |
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
|
|
125 |
|
126 |
css = """
|
127 |
#app-container {
|
128 |
+
max-width: 896px;
|
129 |
margin-left: auto;
|
130 |
margin-right: auto;
|
131 |
}
|
132 |
"""
|
133 |
|
134 |
+
with gr.Blocks(theme=theme, css=css) as app:
|
135 |
gr.HTML("<center><h1>FLUX.1-Dev with LoRA support</h1></center>")
|
136 |
with gr.Column(elem_id="app-container"):
|
137 |
with gr.Row():
|