Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,8 +138,10 @@ def create_demo():
|
|
| 138 |
min-height:100vh;
|
| 139 |
margin:0 !important;
|
| 140 |
padding:0 !important;
|
|
|
|
|
|
|
| 141 |
overflow-x:hidden !important;
|
| 142 |
-
display:flex;
|
| 143 |
justify-content:center;
|
| 144 |
align-items:center;
|
| 145 |
flex-direction:column;
|
|
@@ -150,95 +152,84 @@ def create_demo():
|
|
| 150 |
height:600px;
|
| 151 |
background:#000000 !important;
|
| 152 |
}
|
| 153 |
-
.
|
| 154 |
-
width:100%;
|
| 155 |
-
max-width:100vw;
|
| 156 |
-
padding:0 1rem;
|
| 157 |
-
box-sizing:border-box;
|
| 158 |
-
margin:0 auto;
|
| 159 |
-
display:flex;
|
| 160 |
-
flex-direction:column;
|
| 161 |
-
align-items:center;
|
| 162 |
-
}
|
| 163 |
-
.gr-blocks,
|
| 164 |
-
.gradio-container,
|
| 165 |
-
.container{
|
| 166 |
width:100% !important;
|
| 167 |
-
max-width:
|
| 168 |
margin:0 !important;
|
| 169 |
padding:0 !important;
|
| 170 |
box-sizing:border-box !important;
|
|
|
|
| 171 |
background:#000000 !important;
|
| 172 |
color:#FFFFFF !important;
|
| 173 |
}
|
| 174 |
#general_items{
|
| 175 |
-
width:100
|
| 176 |
-
max-width:
|
| 177 |
-
margin:2rem 0;
|
| 178 |
-
display:flex;
|
| 179 |
flex-direction:column;
|
| 180 |
align-items:center;
|
| 181 |
justify-content:center;
|
| 182 |
-
background:#000000;
|
| 183 |
-
color:#FFFFFF;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
}
|
| 185 |
h1{
|
| 186 |
font-size:5rem;
|
| 187 |
font-weight:700;
|
| 188 |
text-align:center;
|
| 189 |
-
color:#FFFFFF;
|
| 190 |
-
text-shadow:0 0 8px rgba(255,255,255,0.3);
|
| 191 |
-
margin:0 auto .5rem;
|
|
|
|
| 192 |
max-width:100%;
|
| 193 |
-
word-break:break-word;
|
| 194 |
}
|
| 195 |
#subtitle{
|
| 196 |
font-size:1rem;
|
| 197 |
text-align:center;
|
| 198 |
-
color:#FFFFFF;
|
| 199 |
opacity:0.8;
|
| 200 |
margin-bottom:1rem;
|
|
|
|
| 201 |
max-width:100%;
|
| 202 |
-
word-break:break-word;
|
| 203 |
-
}
|
| 204 |
-
#input_column{
|
| 205 |
-
background:#000000;
|
| 206 |
-
border:none;
|
| 207 |
-
border-radius:8px;
|
| 208 |
-
padding:1rem;
|
| 209 |
-
box-shadow:0 0 10px rgba(255,255,255,0.3);
|
| 210 |
-
width:100%;
|
| 211 |
-
max-width:100%;
|
| 212 |
-
box-sizing:border-box;
|
| 213 |
-
color:#FFFFFF;
|
| 214 |
}
|
| 215 |
.gradio-component{
|
| 216 |
background:#000000 !important;
|
| 217 |
border:none;
|
| 218 |
margin:0.75rem 0;
|
| 219 |
width:100% !important;
|
| 220 |
-
max-width:
|
| 221 |
color:#FFFFFF !important;
|
| 222 |
-
box-sizing:border-box;
|
| 223 |
}
|
| 224 |
.image-container{
|
| 225 |
aspect-ratio:1/1;
|
| 226 |
-
width:100
|
| 227 |
-
max-width:
|
| 228 |
min-height:500px;
|
| 229 |
height:auto;
|
| 230 |
-
border:0.5px solid #FFFFFF;
|
| 231 |
border-radius:4px;
|
| 232 |
-
|
| 233 |
-
|
|
|
|
| 234 |
position:relative;
|
| 235 |
-
|
| 236 |
-
color:#FFFFFF;
|
| 237 |
}
|
| 238 |
-
.image-container img{
|
| 239 |
-
width:100
|
| 240 |
height:auto;
|
| 241 |
-
|
|
|
|
| 242 |
}
|
| 243 |
.image-container[aria-label="Input Image"] .file-upload,
|
| 244 |
.image-container[aria-label="Input Image"] .file-preview,
|
|
@@ -267,30 +258,32 @@ def create_demo():
|
|
| 267 |
display:none !important;
|
| 268 |
}
|
| 269 |
.image-container[aria-label="Result Image"].processing{
|
| 270 |
-
background:#000000;
|
| 271 |
-
position:relative;
|
| 272 |
}
|
| 273 |
.image-container[aria-label="Result Image"].processing::before{
|
| 274 |
content:"PROCESSING...";
|
| 275 |
-
position:absolute;
|
| 276 |
-
top:50
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
font-
|
| 281 |
-
font-
|
| 282 |
-
|
| 283 |
-
text-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
|
|
|
|
|
|
| 294 |
}
|
| 295 |
.image-container[aria-label="Result Image"].processing *{
|
| 296 |
display:none !important;
|
|
@@ -305,15 +298,15 @@ def create_demo():
|
|
| 305 |
border-radius:4px;
|
| 306 |
padding:0.5rem;
|
| 307 |
width:100% !important;
|
| 308 |
-
max-width:
|
| 309 |
box-sizing:border-box !important;
|
| 310 |
}
|
| 311 |
input:hover,textarea:hover{
|
| 312 |
-
box-shadow:0 0 8px rgba(255,255,255,0.3);
|
| 313 |
transition:box-shadow 0.3s;
|
| 314 |
}
|
| 315 |
.gr-button-primary{
|
| 316 |
-
background:linear-gradient(90deg,rgba(0,255,128,0.3),rgba(0,200,100,0.3),rgba(0,255,128,0.3));
|
| 317 |
background-size:200% 100%;
|
| 318 |
animation:slide 4s ease-in-out infinite,glow 3s ease-in-out infinite;
|
| 319 |
color:#FFFFFF !important;
|
|
@@ -322,38 +315,21 @@ def create_demo():
|
|
| 322 |
padding:0.75rem 1.5rem;
|
| 323 |
font-size:1.1rem;
|
| 324 |
font-weight:600;
|
| 325 |
-
box-shadow:0 0 14px rgba(0,255,128,0.7);
|
| 326 |
transition:box-shadow 0.3s,transform 0.3s;
|
| 327 |
width:100% !important;
|
| 328 |
-
max-width:
|
| 329 |
min-height:48px;
|
| 330 |
cursor:pointer;
|
| 331 |
}
|
| 332 |
.gr-button-primary:hover{
|
| 333 |
-
box-shadow:0 0 20px rgba(0,255,128,0.9);
|
| 334 |
animation:slide 4s ease-in-out infinite,glow-hover 3s ease-in-out infinite;
|
| 335 |
transform:scale(1.05);
|
| 336 |
}
|
| 337 |
-
button[aria-label="Fullscreen"],
|
| 338 |
-
button[aria-label="Share"]{
|
| 339 |
display:none !important;
|
| 340 |
}
|
| 341 |
-
button[aria-label="Download"]{
|
| 342 |
-
display:inline-block !important;
|
| 343 |
-
transform:scale(3);
|
| 344 |
-
transform-origin:top right;
|
| 345 |
-
background:#000000 !important;
|
| 346 |
-
color:#FFFFFF !important;
|
| 347 |
-
border:1px solid #FFFFFF !important;
|
| 348 |
-
border-radius:4px !important;
|
| 349 |
-
padding:0.4rem !important;
|
| 350 |
-
margin:0.5rem !important;
|
| 351 |
-
box-shadow:0 0 8px rgba(255,255,255,0.3) !important;
|
| 352 |
-
transition:box-shadow 0.3s;
|
| 353 |
-
}
|
| 354 |
-
button[aria-label="Download"]:hover{
|
| 355 |
-
box-shadow:0 0 12px rgba(255,255,255,0.5) !important;
|
| 356 |
-
}
|
| 357 |
.progress-text,.gr-progress,.gr-prose,.gr-log{
|
| 358 |
display:none !important;
|
| 359 |
}
|
|
@@ -364,7 +340,7 @@ def create_demo():
|
|
| 364 |
background:#000000 !important;
|
| 365 |
border:none !important;
|
| 366 |
width:100% !important;
|
| 367 |
-
max-width:
|
| 368 |
}
|
| 369 |
@media (max-width:768px){
|
| 370 |
h1{font-size:4rem;}
|
|
@@ -377,7 +353,7 @@ def create_demo():
|
|
| 377 |
min-height:300px;
|
| 378 |
}
|
| 379 |
.image-container[aria-label="Result Image"].processing::before{
|
| 380 |
-
font-size:1.2rem;
|
| 381 |
}
|
| 382 |
}
|
| 383 |
</style>
|
|
@@ -427,17 +403,17 @@ def create_demo():
|
|
| 427 |
show_download_button=False,
|
| 428 |
show_share_button=False,
|
| 429 |
interactive=True,
|
| 430 |
-
elem_classes=["gradio-component", "image-container"]
|
| 431 |
)
|
| 432 |
prompt = gr.Textbox(
|
| 433 |
label="Prompt",
|
| 434 |
lines=3,
|
| 435 |
-
elem_classes=["gradio-component"]
|
| 436 |
)
|
| 437 |
run_button = gr.Button(
|
| 438 |
"Edit!",
|
| 439 |
variant="primary",
|
| 440 |
-
elem_classes=["gradio-component", "gr-button-primary"]
|
| 441 |
)
|
| 442 |
result_image = gr.Image(
|
| 443 |
label="Result Image",
|
|
@@ -445,7 +421,7 @@ def create_demo():
|
|
| 445 |
interactive=False,
|
| 446 |
show_download_button=True,
|
| 447 |
show_share_button=False,
|
| 448 |
-
elem_classes=["gradio-component", "image-container"]
|
| 449 |
)
|
| 450 |
run_button.click(fn=infer, inputs=[input_image, prompt], outputs=[result_image])
|
| 451 |
prompt.submit(fn=infer, inputs=[input_image, prompt], outputs=[result_image])
|
|
@@ -464,4 +440,4 @@ async def catch_all(path: str):
|
|
| 464 |
|
| 465 |
if __name__ == "__main__":
|
| 466 |
logger.info(f"Gradio version: {gr.__version__}")
|
| 467 |
-
demo.queue().launch(share=True)
|
|
|
|
| 138 |
min-height:100vh;
|
| 139 |
margin:0 !important;
|
| 140 |
padding:0 !important;
|
| 141 |
+
width:100% !important;
|
| 142 |
+
max-width:100vw !important;
|
| 143 |
overflow-x:hidden !important;
|
| 144 |
+
display:flex !important;
|
| 145 |
justify-content:center;
|
| 146 |
align-items:center;
|
| 147 |
flex-direction:column;
|
|
|
|
| 152 |
height:600px;
|
| 153 |
background:#000000 !important;
|
| 154 |
}
|
| 155 |
+
.gr-blocks,.container{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
width:100% !important;
|
| 157 |
+
max-width:100vw !important;
|
| 158 |
margin:0 !important;
|
| 159 |
padding:0 !important;
|
| 160 |
box-sizing:border-box !important;
|
| 161 |
+
overflow-x:hidden !important;
|
| 162 |
background:#000000 !important;
|
| 163 |
color:#FFFFFF !important;
|
| 164 |
}
|
| 165 |
#general_items{
|
| 166 |
+
width:100% !important;
|
| 167 |
+
max-width:100vw !important;
|
| 168 |
+
margin:2rem 0 !important;
|
| 169 |
+
display:flex !important;
|
| 170 |
flex-direction:column;
|
| 171 |
align-items:center;
|
| 172 |
justify-content:center;
|
| 173 |
+
background:#000000 !important;
|
| 174 |
+
color:#FFFFFF !important;
|
| 175 |
+
}
|
| 176 |
+
#input_column{
|
| 177 |
+
background:#000000 !important;
|
| 178 |
+
border:none !important;
|
| 179 |
+
border-radius:8px;
|
| 180 |
+
padding:1rem !important;
|
| 181 |
+
box-shadow:0 0 10px rgba(255,255,255,0.3) !important;
|
| 182 |
+
width:100% !important;
|
| 183 |
+
max-width:100vw !important;
|
| 184 |
+
box-sizing:border-box !important;
|
| 185 |
+
color:#FFFFFF !important;
|
| 186 |
}
|
| 187 |
h1{
|
| 188 |
font-size:5rem;
|
| 189 |
font-weight:700;
|
| 190 |
text-align:center;
|
| 191 |
+
color:#FFFFFF !important;
|
| 192 |
+
text-shadow:0 0 8px rgba(255,255,255,0.3) !important;
|
| 193 |
+
margin:0 auto .5rem auto;
|
| 194 |
+
display:block;
|
| 195 |
max-width:100%;
|
|
|
|
| 196 |
}
|
| 197 |
#subtitle{
|
| 198 |
font-size:1rem;
|
| 199 |
text-align:center;
|
| 200 |
+
color:#FFFFFF !important;
|
| 201 |
opacity:0.8;
|
| 202 |
margin-bottom:1rem;
|
| 203 |
+
display:block;
|
| 204 |
max-width:100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
}
|
| 206 |
.gradio-component{
|
| 207 |
background:#000000 !important;
|
| 208 |
border:none;
|
| 209 |
margin:0.75rem 0;
|
| 210 |
width:100% !important;
|
| 211 |
+
max-width:100vw !important;
|
| 212 |
color:#FFFFFF !important;
|
|
|
|
| 213 |
}
|
| 214 |
.image-container{
|
| 215 |
aspect-ratio:1/1;
|
| 216 |
+
width:100% !important;
|
| 217 |
+
max-width:100vw !important;
|
| 218 |
min-height:500px;
|
| 219 |
height:auto;
|
| 220 |
+
border:0.5px solid #FFFFFF !important;
|
| 221 |
border-radius:4px;
|
| 222 |
+
box-sizing:border-box !important;
|
| 223 |
+
background:#000000 !important;
|
| 224 |
+
box-shadow:0 0 10px rgba(255,255,255,0.3) !important;
|
| 225 |
position:relative;
|
| 226 |
+
color:#FFFFFF !important;
|
|
|
|
| 227 |
}
|
| 228 |
+
.image-container img,.image-container video{
|
| 229 |
+
width:100% !important;
|
| 230 |
height:auto;
|
| 231 |
+
box-sizing:border-box !important;
|
| 232 |
+
display:block !important;
|
| 233 |
}
|
| 234 |
.image-container[aria-label="Input Image"] .file-upload,
|
| 235 |
.image-container[aria-label="Input Image"] .file-preview,
|
|
|
|
| 258 |
display:none !important;
|
| 259 |
}
|
| 260 |
.image-container[aria-label="Result Image"].processing{
|
| 261 |
+
background:#000000 !important;
|
| 262 |
+
position:relative !important;
|
| 263 |
}
|
| 264 |
.image-container[aria-label="Result Image"].processing::before{
|
| 265 |
content:"PROCESSING...";
|
| 266 |
+
position:absolute !important;
|
| 267 |
+
top:50% !important;
|
| 268 |
+
left:50% !important;
|
| 269 |
+
transform:translate(-50%,-50%) !important;
|
| 270 |
+
color:#FFFFFF !important;
|
| 271 |
+
font-family:'Orbitron',sans-serif !important;
|
| 272 |
+
font-size:1.8rem !important;
|
| 273 |
+
font-weight:700 !important;
|
| 274 |
+
text-align:center !important;
|
| 275 |
+
text-shadow:0 0 10px rgba(0,255,128,0.8) !important;
|
| 276 |
+
animation:pulse 1.5s ease-in-out infinite,glow 2s ease-in-out infinite !important;
|
| 277 |
+
z-index:9999 !important;
|
| 278 |
+
width:100% !important;
|
| 279 |
+
height:100% !important;
|
| 280 |
+
display:flex !important;
|
| 281 |
+
align-items:center !important;
|
| 282 |
+
justify-content:center !important;
|
| 283 |
+
pointer-events:none !important;
|
| 284 |
+
background:#000000 !important;
|
| 285 |
+
border-radius:4px !important;
|
| 286 |
+
box-sizing:border-box !important;
|
| 287 |
}
|
| 288 |
.image-container[aria-label="Result Image"].processing *{
|
| 289 |
display:none !important;
|
|
|
|
| 298 |
border-radius:4px;
|
| 299 |
padding:0.5rem;
|
| 300 |
width:100% !important;
|
| 301 |
+
max-width:100vw !important;
|
| 302 |
box-sizing:border-box !important;
|
| 303 |
}
|
| 304 |
input:hover,textarea:hover{
|
| 305 |
+
box-shadow:0 0 8px rgba(255,255,255,0.3) !important;
|
| 306 |
transition:box-shadow 0.3s;
|
| 307 |
}
|
| 308 |
.gr-button-primary{
|
| 309 |
+
background:linear-gradient(90deg,rgba(0,255,128,0.3),rgba(0,200,100,0.3),rgba(0,255,128,0.3)) !important;
|
| 310 |
background-size:200% 100%;
|
| 311 |
animation:slide 4s ease-in-out infinite,glow 3s ease-in-out infinite;
|
| 312 |
color:#FFFFFF !important;
|
|
|
|
| 315 |
padding:0.75rem 1.5rem;
|
| 316 |
font-size:1.1rem;
|
| 317 |
font-weight:600;
|
| 318 |
+
box-shadow:0 0 14px rgba(0,255,128,0.7) !important;
|
| 319 |
transition:box-shadow 0.3s,transform 0.3s;
|
| 320 |
width:100% !important;
|
| 321 |
+
max-width:100vw !important;
|
| 322 |
min-height:48px;
|
| 323 |
cursor:pointer;
|
| 324 |
}
|
| 325 |
.gr-button-primary:hover{
|
| 326 |
+
box-shadow:0 0 20px rgba(0,255,128,0.9) !important;
|
| 327 |
animation:slide 4s ease-in-out infinite,glow-hover 3s ease-in-out infinite;
|
| 328 |
transform:scale(1.05);
|
| 329 |
}
|
| 330 |
+
button[aria-label="Fullscreen"],button[aria-label="Share"],button[aria-label="Download"]{
|
|
|
|
| 331 |
display:none !important;
|
| 332 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
.progress-text,.gr-progress,.gr-prose,.gr-log{
|
| 334 |
display:none !important;
|
| 335 |
}
|
|
|
|
| 340 |
background:#000000 !important;
|
| 341 |
border:none !important;
|
| 342 |
width:100% !important;
|
| 343 |
+
max-width:100vw !important;
|
| 344 |
}
|
| 345 |
@media (max-width:768px){
|
| 346 |
h1{font-size:4rem;}
|
|
|
|
| 353 |
min-height:300px;
|
| 354 |
}
|
| 355 |
.image-container[aria-label="Result Image"].processing::before{
|
| 356 |
+
font-size:1.2rem !important;
|
| 357 |
}
|
| 358 |
}
|
| 359 |
</style>
|
|
|
|
| 403 |
show_download_button=False,
|
| 404 |
show_share_button=False,
|
| 405 |
interactive=True,
|
| 406 |
+
elem_classes=["gradio-component", "image-container"]
|
| 407 |
)
|
| 408 |
prompt = gr.Textbox(
|
| 409 |
label="Prompt",
|
| 410 |
lines=3,
|
| 411 |
+
elem_classes=["gradio-component"]
|
| 412 |
)
|
| 413 |
run_button = gr.Button(
|
| 414 |
"Edit!",
|
| 415 |
variant="primary",
|
| 416 |
+
elem_classes=["gradio-component", "gr-button-primary"]
|
| 417 |
)
|
| 418 |
result_image = gr.Image(
|
| 419 |
label="Result Image",
|
|
|
|
| 421 |
interactive=False,
|
| 422 |
show_download_button=True,
|
| 423 |
show_share_button=False,
|
| 424 |
+
elem_classes=["gradio-component", "image-container"]
|
| 425 |
)
|
| 426 |
run_button.click(fn=infer, inputs=[input_image, prompt], outputs=[result_image])
|
| 427 |
prompt.submit(fn=infer, inputs=[input_image, prompt], outputs=[result_image])
|
|
|
|
| 440 |
|
| 441 |
if __name__ == "__main__":
|
| 442 |
logger.info(f"Gradio version: {gr.__version__}")
|
| 443 |
+
demo.queue().launch(share=True)
|