Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import sys
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
models = [
|
| 7 |
-
"ItsJayQz/SynthwavePunk-v2",
|
| 8 |
"DucHaiten/DH_ClassicAnime",
|
| 9 |
"DucHaiten/DucHaitenAnime",
|
| 10 |
"DucHaiten/DucHaitenAIart",
|
|
@@ -52,6 +51,7 @@ models = [
|
|
| 52 |
"wavymulder/modelshoot",
|
| 53 |
"wavymulder/portraitplus",
|
| 54 |
"wavymulder/timeless-diffusion",
|
|
|
|
| 55 |
"gsdf/Counterfeit-V2.0",
|
| 56 |
"stablediffusionapi/counterfeit-v30",
|
| 57 |
"dreamlike-art/dreamlike-anime-1.0",
|
|
@@ -148,13 +148,6 @@ models = [
|
|
| 148 |
current_model = models[0]
|
| 149 |
|
| 150 |
text_gen1=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 151 |
-
text_gen2=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 152 |
-
text_gen3=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 153 |
-
text_gen4=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 154 |
-
text_gen5=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 155 |
-
text_gen6=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 156 |
-
text_gen7=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 157 |
-
text_gen8=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
| 158 |
|
| 159 |
models2=[
|
| 160 |
gr.Interface.load(f"models/{models[0]}",live=True,preprocess=False),
|
|
@@ -292,29 +285,6 @@ models2=[
|
|
| 292 |
def text_it1(inputs,text_gen1=text_gen1):
|
| 293 |
go_t1=text_gen1(inputs)
|
| 294 |
return(go_t1)
|
| 295 |
-
def text_it2(inputs,text_gen2=text_gen2):
|
| 296 |
-
go_t2=text_gen2(inputs)
|
| 297 |
-
return(go_t2)
|
| 298 |
-
def text_it3(inputs,text_gen3=text_gen3):
|
| 299 |
-
go_t3=text_gen3(inputs)
|
| 300 |
-
return(go_t3)
|
| 301 |
-
def text_it4(inputs,text_gen4=text_gen4):
|
| 302 |
-
go_t4=text_gen4(inputs)
|
| 303 |
-
return(go_t4)
|
| 304 |
-
def text_it5(inputs,text_gen5=text_gen5):
|
| 305 |
-
go_t5=text_gen5(inputs)
|
| 306 |
-
return(go_t5)
|
| 307 |
-
def text_it6(inputs,text_gen6=text_gen6):
|
| 308 |
-
go_t6=text_gen6(inputs)
|
| 309 |
-
return(go_t6)
|
| 310 |
-
def text_it7(inputs,text_gen7=text_gen7):
|
| 311 |
-
go_t7=text_gen7(inputs)
|
| 312 |
-
return(go_t7)
|
| 313 |
-
def text_it8(inputs,text_gen8=text_gen8):
|
| 314 |
-
go_t8=text_gen8(inputs)
|
| 315 |
-
return(go_t8)
|
| 316 |
-
|
| 317 |
-
|
| 318 |
|
| 319 |
def set_model(current_model):
|
| 320 |
current_model = models[current_model]
|
|
@@ -325,34 +295,6 @@ def send_it1(inputs, model_choice):
|
|
| 325 |
proc1=models2[model_choice]
|
| 326 |
output1=proc1(inputs)
|
| 327 |
return(output1)
|
| 328 |
-
def send_it2(inputs, model_choice):
|
| 329 |
-
proc2=models2[model_choice]
|
| 330 |
-
output2=proc2(inputs)
|
| 331 |
-
return(output2)
|
| 332 |
-
def send_it3(inputs, model_choice):
|
| 333 |
-
proc3=models2[model_choice]
|
| 334 |
-
output3=proc3(inputs)
|
| 335 |
-
return(output3)
|
| 336 |
-
def send_it4(inputs, model_choice):
|
| 337 |
-
proc4=models2[model_choice]
|
| 338 |
-
output4=proc4(inputs)
|
| 339 |
-
return(output4)
|
| 340 |
-
def send_it5(inputs, model_choice):
|
| 341 |
-
proc5=models2[model_choice]
|
| 342 |
-
output5=proc5(inputs)
|
| 343 |
-
return(output5)
|
| 344 |
-
def send_it6(inputs, model_choice):
|
| 345 |
-
proc6=models2[model_choice]
|
| 346 |
-
output6=proc6(inputs)
|
| 347 |
-
return(output6)
|
| 348 |
-
def send_it7(inputs, model_choice):
|
| 349 |
-
proc7=models2[model_choice]
|
| 350 |
-
output7=proc7(inputs)
|
| 351 |
-
return(output7)
|
| 352 |
-
def send_it8(inputs, model_choice):
|
| 353 |
-
proc8=models2[model_choice]
|
| 354 |
-
output8=proc8(inputs)
|
| 355 |
-
return(output8)
|
| 356 |
css=""""""
|
| 357 |
|
| 358 |
|
|
@@ -441,58 +383,19 @@ with gr.Blocks(css=css) as myface:
|
|
| 441 |
with gr.Tab("Main"):
|
| 442 |
with gr.Row():
|
| 443 |
output1=gr.Image(label=(f"{current_model}"))
|
| 444 |
-
output2=gr.Image(label=(f"{current_model}"))
|
| 445 |
-
output3=gr.Image(label=(f"{current_model}"))
|
| 446 |
-
output4=gr.Image(label=(f"{current_model}"))
|
| 447 |
with gr.Row():
|
| 448 |
magic1=gr.Textbox(lines=4)
|
| 449 |
-
magic2=gr.Textbox(lines=4)
|
| 450 |
-
magic3=gr.Textbox(lines=4)
|
| 451 |
-
magic4=gr.Textbox(lines=4)
|
| 452 |
-
with gr.Row():
|
| 453 |
-
output5=gr.Image(label=(f"{current_model}"))
|
| 454 |
-
output6=gr.Image(label=(f"{current_model}"))
|
| 455 |
-
output7=gr.Image(label=(f"{current_model}"))
|
| 456 |
-
output8=gr.Image(label=(f"{current_model}"))
|
| 457 |
-
with gr.Row():
|
| 458 |
-
magic5=gr.Textbox(lines=4)
|
| 459 |
-
magic6=gr.Textbox(lines=4)
|
| 460 |
-
magic7=gr.Textbox(lines=4)
|
| 461 |
-
magic8=gr.Textbox(lines=4)
|
| 462 |
|
| 463 |
def short_prompt(inputs):
|
| 464 |
return(inputs)
|
| 465 |
|
| 466 |
-
model_name1.change(set_model,inputs=model_name1,outputs=[output1
|
| 467 |
|
| 468 |
run.click(send_it1, inputs=[magic1, model_name1], outputs=[output1])
|
| 469 |
-
run.click(send_it2, inputs=[magic2, model_name1], outputs=[output2])
|
| 470 |
-
run.click(send_it3, inputs=[magic3, model_name1], outputs=[output3])
|
| 471 |
-
run.click(send_it4, inputs=[magic4, model_name1], outputs=[output4])
|
| 472 |
-
run.click(send_it5, inputs=[magic5, model_name1], outputs=[output5])
|
| 473 |
-
run.click(send_it6, inputs=[magic6, model_name1], outputs=[output6])
|
| 474 |
-
run.click(send_it7, inputs=[magic7, model_name1], outputs=[output7])
|
| 475 |
-
run.click(send_it8, inputs=[magic8, model_name1], outputs=[output8])
|
| 476 |
|
| 477 |
use_short.click(short_prompt,inputs=[input_text],outputs=magic1)
|
| 478 |
-
use_short.click(short_prompt,inputs=[input_text],outputs=magic2)
|
| 479 |
-
use_short.click(short_prompt,inputs=[input_text],outputs=magic3)
|
| 480 |
-
use_short.click(short_prompt,inputs=[input_text],outputs=magic4)
|
| 481 |
-
use_short.click(short_prompt,inputs=[input_text],outputs=magic5)
|
| 482 |
-
use_short.click(short_prompt,inputs=[input_text],outputs=magic6)
|
| 483 |
-
use_short.click(short_prompt,inputs=[input_text],outputs=magic7)
|
| 484 |
-
use_short.click(short_prompt,inputs=[input_text],outputs=magic8)
|
| 485 |
|
| 486 |
see_prompts.click(text_it1,inputs=[input_text],outputs=magic1)
|
| 487 |
-
|
| 488 |
-
see_prompts.click(text_it3,inputs=[input_text],outputs=magic3)
|
| 489 |
-
see_prompts.click(text_it4,inputs=[input_text],outputs=magic4)
|
| 490 |
-
see_prompts.click(text_it5,inputs=[input_text],outputs=magic5)
|
| 491 |
-
see_prompts.click(text_it6,inputs=[input_text],outputs=magic6)
|
| 492 |
-
see_prompts.click(text_it7,inputs=[input_text],outputs=magic7)
|
| 493 |
-
see_prompts.click(text_it8,inputs=[input_text],outputs=magic8)
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
myface.queue(concurrency_count=200)
|
| 498 |
myface.launch(inline=True, show_api=False, max_threads=400)
|
|
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
models = [
|
|
|
|
| 7 |
"DucHaiten/DH_ClassicAnime",
|
| 8 |
"DucHaiten/DucHaitenAnime",
|
| 9 |
"DucHaiten/DucHaitenAIart",
|
|
|
|
| 51 |
"wavymulder/modelshoot",
|
| 52 |
"wavymulder/portraitplus",
|
| 53 |
"wavymulder/timeless-diffusion",
|
| 54 |
+
"ItsJayQz/SynthwavePunk-v2",
|
| 55 |
"gsdf/Counterfeit-V2.0",
|
| 56 |
"stablediffusionapi/counterfeit-v30",
|
| 57 |
"dreamlike-art/dreamlike-anime-1.0",
|
|
|
|
| 148 |
current_model = models[0]
|
| 149 |
|
| 150 |
text_gen1=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
|
| 152 |
models2=[
|
| 153 |
gr.Interface.load(f"models/{models[0]}",live=True,preprocess=False),
|
|
|
|
| 285 |
def text_it1(inputs,text_gen1=text_gen1):
|
| 286 |
go_t1=text_gen1(inputs)
|
| 287 |
return(go_t1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
|
| 289 |
def set_model(current_model):
|
| 290 |
current_model = models[current_model]
|
|
|
|
| 295 |
proc1=models2[model_choice]
|
| 296 |
output1=proc1(inputs)
|
| 297 |
return(output1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
css=""""""
|
| 299 |
|
| 300 |
|
|
|
|
| 383 |
with gr.Tab("Main"):
|
| 384 |
with gr.Row():
|
| 385 |
output1=gr.Image(label=(f"{current_model}"))
|
|
|
|
|
|
|
|
|
|
| 386 |
with gr.Row():
|
| 387 |
magic1=gr.Textbox(lines=4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
|
| 389 |
def short_prompt(inputs):
|
| 390 |
return(inputs)
|
| 391 |
|
| 392 |
+
model_name1.change(set_model,inputs=model_name1,outputs=[output1])
|
| 393 |
|
| 394 |
run.click(send_it1, inputs=[magic1, model_name1], outputs=[output1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 395 |
|
| 396 |
use_short.click(short_prompt,inputs=[input_text],outputs=magic1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
|
| 398 |
see_prompts.click(text_it1,inputs=[input_text],outputs=magic1)
|
| 399 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 400 |
myface.queue(concurrency_count=200)
|
| 401 |
myface.launch(inline=True, show_api=False, max_threads=400)
|