Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,6 @@ from diffusers import AutoencoderKL, DiffusionPipeline
|
|
15 |
DESCRIPTION = """
|
16 |
# OpenDalle 1.1
|
17 |
"""
|
18 |
-
if not torch.cuda.is_available():
|
19 |
-
DESCRIPTION += "\n<h1>Running on CPU 🥶 This demo does not work on CPU. Please use <a href=\"https://huggingface.co/spaces/mrfakename/OpenDalleV1.1-GPU-Demo\">the online demo</a> instead</h1>"
|
20 |
-
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
22 |
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "0") == "1"
|
23 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "1024"))
|
@@ -137,25 +134,28 @@ examples = [
|
|
137 |
"Realistic image of Thai temple in front of Sunlight, the scene extreme closeup, background in forest"
|
138 |
]
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
144 |
gr.Markdown(DESCRIPTION)
|
145 |
-
gr.
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
)
|
150 |
with gr.Group():
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
159 |
result = gr.Image(label="Result", show_label=False)
|
160 |
with gr.Accordion("Advanced options", open=False):
|
161 |
with gr.Row():
|
|
|
15 |
DESCRIPTION = """
|
16 |
# OpenDalle 1.1
|
17 |
"""
|
|
|
|
|
|
|
18 |
MAX_SEED = np.iinfo(np.int32).max
|
19 |
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "0") == "1"
|
20 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "1024"))
|
|
|
134 |
"Realistic image of Thai temple in front of Sunlight, the scene extreme closeup, background in forest"
|
135 |
]
|
136 |
|
137 |
+
css = '''
|
138 |
+
.gradio-container{max-width: 100% !important}
|
139 |
+
h1{text-align:center}
|
140 |
+
'''
|
141 |
+
|
142 |
+
with gr.Blocks(css=css) as demo:
|
143 |
gr.Markdown(DESCRIPTION)
|
144 |
+
gr.Markdown(
|
145 |
+
"""
|
146 |
+
Made by csit.udru.ac.th for non-commercial license
|
147 |
+
"""
|
148 |
)
|
149 |
with gr.Group():
|
150 |
+
with gr.Row():
|
151 |
+
prompt = gr.Text(
|
152 |
+
label="Prompt",
|
153 |
+
show_label=False,
|
154 |
+
max_lines=1,
|
155 |
+
container=False,
|
156 |
+
placeholder="Describe the image you want",
|
157 |
+
)
|
158 |
+
run_button = gr.Button("Generate")
|
159 |
result = gr.Image(label="Result", show_label=False)
|
160 |
with gr.Accordion("Advanced options", open=False):
|
161 |
with gr.Row():
|