Spaces:
Runtime error
Runtime error
Indentation fixed
Browse files
app.py
CHANGED
|
@@ -12,8 +12,8 @@ from typing import Tuple
|
|
| 12 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
| 13 |
styles = {
|
| 14 |
"3840 x 2160": (
|
| 15 |
-
"hyper-realistic
|
| 16 |
-
"
|
| 17 |
),
|
| 18 |
"Style Zero": ("{prompt}", ""),
|
| 19 |
}
|
|
@@ -85,38 +85,39 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 85 |
gr.Markdown("<h2 style='text-align:center; color:white; font-weight:bold; text-decoration:underline;'>Developed using RealVisXL_V5.0_Lightning model with ❤ by Aklavya</h2>")
|
| 86 |
|
| 87 |
with gr.Row():
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
| 120 |
|
| 121 |
run_button.click(
|
| 122 |
fn=generate,
|
|
@@ -124,25 +125,4 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 124 |
outputs=[result_image],
|
| 125 |
)
|
| 126 |
|
| 127 |
-
# # Footer with custom style and text
|
| 128 |
-
# gr.Markdown("""
|
| 129 |
-
# <style>
|
| 130 |
-
# .footer {
|
| 131 |
-
# position: relative;
|
| 132 |
-
# left: 0;
|
| 133 |
-
# bottom: 0;
|
| 134 |
-
# width: 100%;
|
| 135 |
-
# background-color: white;
|
| 136 |
-
# color: black;
|
| 137 |
-
# text-align: center;
|
| 138 |
-
# }
|
| 139 |
-
# #output_image {
|
| 140 |
-
# height: calc(100% + 512px); /* Dynamically increases height by 100% */
|
| 141 |
-
# }
|
| 142 |
-
# </style>
|
| 143 |
-
# <div class="footer">
|
| 144 |
-
# <p>Developed with ❤ by Aklavya(Bucky)</p>
|
| 145 |
-
# </div>
|
| 146 |
-
# """)
|
| 147 |
-
|
| 148 |
demo.launch()
|
|
|
|
| 12 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
| 13 |
styles = {
|
| 14 |
"3840 x 2160": (
|
| 15 |
+
"hyper-realistic image of {prompt}. lifelike, authentic, natural colors, true-to-life details, realistic lighting, immersive, highly detailed",
|
| 16 |
+
"unrealistic, low resolution, artificial, over-saturated, distorted, fake",
|
| 17 |
),
|
| 18 |
"Style Zero": ("{prompt}", ""),
|
| 19 |
}
|
|
|
|
| 85 |
gr.Markdown("<h2 style='text-align:center; color:white; font-weight:bold; text-decoration:underline;'>Developed using RealVisXL_V5.0_Lightning model with ❤ by Aklavya</h2>")
|
| 86 |
|
| 87 |
with gr.Row():
|
| 88 |
+
with gr.Column(scale=3):
|
| 89 |
+
prompt = gr.Textbox(
|
| 90 |
+
label="Input Prompt",
|
| 91 |
+
placeholder="Describe the image you want to create",
|
| 92 |
+
lines=2,
|
| 93 |
+
)
|
| 94 |
+
run_button = gr.Button("Generate Image")
|
| 95 |
+
|
| 96 |
+
# Example prompts box
|
| 97 |
+
example_prompts_text = (
|
| 98 |
+
"Dew-covered spider web in morning sunlight, with blurred greenery\n"
|
| 99 |
+
"--------------------------------------------\n"
|
| 100 |
+
"Glass of cold water with ice cubes and condensation on a wooden table\n"
|
| 101 |
+
"--------------------------------------------\n"
|
| 102 |
+
"Coffee cup with latte art, steam rising, and morning sunlight\n"
|
| 103 |
+
"--------------------------------------------\n"
|
| 104 |
+
"Autumn forest with golden leaves, sunlight through trees, and a breeze"
|
| 105 |
+
)
|
| 106 |
+
|
| 107 |
+
example_prompts = gr.Textbox(
|
| 108 |
+
value=example_prompts_text,
|
| 109 |
+
lines=5,
|
| 110 |
+
label="Sample Inputs",
|
| 111 |
+
interactive=False,
|
| 112 |
+
)
|
| 113 |
+
|
| 114 |
+
with gr.Column(scale=7):
|
| 115 |
+
result_image = gr.Image(
|
| 116 |
+
label="Generated Image",
|
| 117 |
+
type="filepath",
|
| 118 |
+
elem_id="output_image",
|
| 119 |
+
height=1024 # Increased the height by 100%
|
| 120 |
+
)
|
| 121 |
|
| 122 |
run_button.click(
|
| 123 |
fn=generate,
|
|
|
|
| 125 |
outputs=[result_image],
|
| 126 |
)
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
demo.launch()
|