Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,34 +25,44 @@ theme = gr.themes.Ocean(
|
|
25 |
font_mono=[gr.themes.GoogleFont('Source Code Pro'), gr.themes.GoogleFont('Inconsolata'), gr.themes.GoogleFont('Inconsolata'), 'monospace'],
|
26 |
).set(
|
27 |
#Body Settings
|
28 |
-
body_background_fill='*
|
29 |
body_text_color='secondary_600',
|
30 |
body_text_color_subdued='*primary_500',
|
31 |
body_text_weight='500',
|
|
|
|
|
32 |
background_fill_primary='*primary_100',
|
33 |
background_fill_secondary='*secondary_200',
|
|
|
34 |
color_accent='*primary_300',
|
|
|
|
|
35 |
border_color_accent_subdued='*primary_400',
|
36 |
border_color_primary='*primary_400',
|
|
|
|
|
37 |
block_radius='*radius_md',
|
38 |
-
block_background_fill='*
|
|
|
39 |
block_border_width='*panel_border_width',
|
40 |
block_info_text_color='*primary_700',
|
41 |
block_info_text_size='*text_md',
|
|
|
|
|
42 |
panel_background_fill='*primary_200',
|
43 |
accordion_text_color='*primary_600',
|
|
|
44 |
slider_color='*primary_500',
|
45 |
table_text_color='*primary_600',
|
46 |
input_background_fill='*primary_50',
|
47 |
input_background_fill_focus='*primary_100',
|
48 |
-
|
49 |
#Button Settings
|
50 |
button_border_width='1px',
|
51 |
-
button_transform_hover='scale(1.
|
52 |
button_transition='all 0.1s ease-in-out',
|
53 |
button_transform_active='Scale(0.9)',
|
54 |
button_large_radius='*radius_xl',
|
55 |
-
#button_medium_radius='*radius_xl',
|
56 |
button_small_radius='*radius_xl',
|
57 |
button_primary_border_color='*primary_500',
|
58 |
button_secondary_border_color='*primary_400',
|
@@ -138,18 +148,15 @@ examples = [
|
|
138 |
"a beautiful woman with black hair and brown eyes",
|
139 |
]
|
140 |
|
141 |
-
|
142 |
css = """
|
143 |
#app-container {
|
144 |
-
|
145 |
max-width: 930px;
|
146 |
margin-left: auto;
|
147 |
margin-right: auto;
|
148 |
-
background: url(file=https://huggingface.co/spaces/DigiP-AI/FLUX.Dev-LORA/blob/main/abstract.jpg)
|
149 |
-
|
150 |
}
|
|
|
|
|
151 |
"""
|
152 |
-
|
153 |
with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
154 |
gr.HTML("<center><h6>🎨 FLUX.1-Dev with LoRA 🇬🇧</h6></center>")
|
155 |
with gr.Tab("Text to Image"):
|
@@ -163,7 +170,7 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
163 |
gr.Markdown("""
|
164 |
- **sdxl-realistic**: szn style
|
165 |
- **stylesdxl-cyberpunk**: szn style
|
166 |
-
- **
|
167 |
- **surreal-harmony**: Surreal Harmony
|
168 |
- **extremely-detailed**: extremely detailed
|
169 |
- **dark-fantasy**: Dark Fantasy
|
@@ -179,7 +186,7 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
179 |
""")
|
180 |
|
181 |
with gr.Row():
|
182 |
-
custom_lora = gr.Dropdown([" ", "jwu114/lora-sdxl-realistic", "issaccyj/lora-sdxl-cyberpunk", "
|
183 |
with gr.Row():
|
184 |
with gr.Accordion("⚙️ Advanced Settings", open=False, elem_id="settings-container"):
|
185 |
negative_prompt = gr.Textbox(label="Negative Prompt", lines=5, placeholder="What should not be in the image", value=" Bad anatomy, Bad proportions, Deformed, Disconnected limbs, Disfigured, Extra arms, Extra limbs, Extra hands, Fused fingers, Gross proportions, Long neck, Malformed limbs, Mutated, Mutated hands, Mutated limbs, Missing arms, Missing fingers, Poorly drawn hands, Poorly drawn face ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face, blurry, draft, grainy, text, logo, watermark, banner, extra digits, signature, unprompted-nsfw")
|
@@ -196,7 +203,7 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
196 |
seed_output = gr.Textbox(label="Seed Used", show_copy_button = True, elem_id="seed-output")
|
197 |
|
198 |
with gr.Row():
|
199 |
-
text_button = gr.Button("
|
200 |
clr_button =gr.Button("Clear Prompt",variant="primary", elem_id="clear_button")
|
201 |
clr_button.click(lambda: gr.Textbox(value=""), None, text_prompt)
|
202 |
|
@@ -219,8 +226,8 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
219 |
image_output = gr.Image(format="png")
|
220 |
with gr.Row():
|
221 |
image_button = gr.Button("Run", variant='primary')
|
222 |
-
image_button.click(flip_image, inputs=image_input, outputs=image_output, concurrency_limit=
|
223 |
|
224 |
app.queue() # <-- Sets up a queue with default parameters
|
225 |
if __name__ == "__main__":
|
226 |
-
app.launch(show_api=False, share=
|
|
|
25 |
font_mono=[gr.themes.GoogleFont('Source Code Pro'), gr.themes.GoogleFont('Inconsolata'), gr.themes.GoogleFont('Inconsolata'), 'monospace'],
|
26 |
).set(
|
27 |
#Body Settings
|
28 |
+
body_background_fill='linear-gradient(10deg, *primary_200, *secondary_50)',
|
29 |
body_text_color='secondary_600',
|
30 |
body_text_color_subdued='*primary_500',
|
31 |
body_text_weight='500',
|
32 |
+
|
33 |
+
#Background Settings
|
34 |
background_fill_primary='*primary_100',
|
35 |
background_fill_secondary='*secondary_200',
|
36 |
+
|
37 |
color_accent='*primary_300',
|
38 |
+
|
39 |
+
#Border Settings
|
40 |
border_color_accent_subdued='*primary_400',
|
41 |
border_color_primary='*primary_400',
|
42 |
+
|
43 |
+
#Block Settings
|
44 |
block_radius='*radius_md',
|
45 |
+
block_background_fill='*primary_200',
|
46 |
+
block_border_color='*primary_500',
|
47 |
block_border_width='*panel_border_width',
|
48 |
block_info_text_color='*primary_700',
|
49 |
block_info_text_size='*text_md',
|
50 |
+
|
51 |
+
container_radius='*radius_xl',
|
52 |
panel_background_fill='*primary_200',
|
53 |
accordion_text_color='*primary_600',
|
54 |
+
checkbox_border_radius='*radius_xl',
|
55 |
slider_color='*primary_500',
|
56 |
table_text_color='*primary_600',
|
57 |
input_background_fill='*primary_50',
|
58 |
input_background_fill_focus='*primary_100',
|
59 |
+
|
60 |
#Button Settings
|
61 |
button_border_width='1px',
|
62 |
+
button_transform_hover='scale(1.01)',
|
63 |
button_transition='all 0.1s ease-in-out',
|
64 |
button_transform_active='Scale(0.9)',
|
65 |
button_large_radius='*radius_xl',
|
|
|
66 |
button_small_radius='*radius_xl',
|
67 |
button_primary_border_color='*primary_500',
|
68 |
button_secondary_border_color='*primary_400',
|
|
|
148 |
"a beautiful woman with black hair and brown eyes",
|
149 |
]
|
150 |
|
|
|
151 |
css = """
|
152 |
#app-container {
|
|
|
153 |
max-width: 930px;
|
154 |
margin-left: auto;
|
155 |
margin-right: auto;
|
|
|
|
|
156 |
}
|
157 |
+
".gradio-container {background: url('file=abstract.jpg')}
|
158 |
+
|
159 |
"""
|
|
|
160 |
with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
161 |
gr.HTML("<center><h6>🎨 FLUX.1-Dev with LoRA 🇬🇧</h6></center>")
|
162 |
with gr.Tab("Text to Image"):
|
|
|
170 |
gr.Markdown("""
|
171 |
- **sdxl-realistic**: szn style
|
172 |
- **stylesdxl-cyberpunk**: szn style
|
173 |
+
- **SD3.5-Turbo-Realism-2.0-LoRA**: Turbo Realism
|
174 |
- **surreal-harmony**: Surreal Harmony
|
175 |
- **extremely-detailed**: extremely detailed
|
176 |
- **dark-fantasy**: Dark Fantasy
|
|
|
186 |
""")
|
187 |
|
188 |
with gr.Row():
|
189 |
+
custom_lora = gr.Dropdown([" ", "jwu114/lora-sdxl-realistic", "issaccyj/lora-sdxl-cyberpunk", "prithivMLmods/SD3.5-Turbo-Realism-2.0-LoRA", "hugovntr/flux-schnell-realism", "fofr/sdxl-deep-down", "KappaNeuro/surreal-harmony", "ntc-ai/SDXL-LoRA-slider.extremely-detailed", "prithivMLmods/Canopus-LoRA-Flux-FaceRealism", "KappaNeuro/dark-fantasy", "prithivMLmods/Flux.1-Dev-LoRA-HDR-Realism", "KappaNeuro/jules-bastien-lepage-style", "KappaNeuro/john-singer-sargent-style", "KappaNeuro/alphonse-mucha-style", "ntc-ai/SDXL-LoRA-slider.ultra-realistic-illustration", "ntc-ai/SDXL-LoRA-slider.eye-catching", "KappaNeuro/john-constable-style", "dvyio/flux-lora-film-noir", "dvyio/flux-lora-pro-headshot"], label="Custom LoRA",)
|
190 |
with gr.Row():
|
191 |
with gr.Accordion("⚙️ Advanced Settings", open=False, elem_id="settings-container"):
|
192 |
negative_prompt = gr.Textbox(label="Negative Prompt", lines=5, placeholder="What should not be in the image", value=" Bad anatomy, Bad proportions, Deformed, Disconnected limbs, Disfigured, Extra arms, Extra limbs, Extra hands, Fused fingers, Gross proportions, Long neck, Malformed limbs, Mutated, Mutated hands, Mutated limbs, Missing arms, Missing fingers, Poorly drawn hands, Poorly drawn face ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face, blurry, draft, grainy, text, logo, watermark, banner, extra digits, signature, unprompted-nsfw")
|
|
|
203 |
seed_output = gr.Textbox(label="Seed Used", show_copy_button = True, elem_id="seed-output")
|
204 |
|
205 |
with gr.Row():
|
206 |
+
text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
|
207 |
clr_button =gr.Button("Clear Prompt",variant="primary", elem_id="clear_button")
|
208 |
clr_button.click(lambda: gr.Textbox(value=""), None, text_prompt)
|
209 |
|
|
|
226 |
image_output = gr.Image(format="png")
|
227 |
with gr.Row():
|
228 |
image_button = gr.Button("Run", variant='primary')
|
229 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output, concurrency_limit=2)
|
230 |
|
231 |
app.queue() # <-- Sets up a queue with default parameters
|
232 |
if __name__ == "__main__":
|
233 |
+
app.launch(show_api=False, share=True)
|