Brian Watson commited on
Commit
7590a99
1 Parent(s): 935c9bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -47
app.py CHANGED
@@ -6,14 +6,15 @@ from pathlib import Path
6
  models = [
7
  {"name": "Claudfuen 1", "url": "claudfuen/photorealistic-fuen-v1"},
8
  {"name": "Deliberate", "url": "Masagin/Deliberate"},
9
- {"name": "Seek Art Mega", "url": "coreco/seek.art_MEGA"},
10
- {"name": "Realistic Vision 1.4", "url": "SG161222/Realistic_Vision_V1.4"},
11
  {"name": "Dreamshaper", "url": "Lykon/DreamShaper"},
 
 
12
  ]
13
 
14
  current_model = models[0]
15
 
16
- text_gen = gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
17
 
18
  models2 = []
19
  for model in models:
@@ -29,7 +30,7 @@ def text_it(inputs, text_gen=text_gen):
29
  def set_model(current_model_index):
30
  global current_model
31
  current_model = models[current_model_index]
32
- return gr.update(label=f"{current_model['name']}")
33
 
34
 
35
  def send_it(inputs, model_choice):
@@ -37,27 +38,9 @@ def send_it(inputs, model_choice):
37
  return proc(inputs)
38
 
39
 
40
- css = """"""
41
-
42
- with gr.Blocks(css=css) as myface:
43
  gr.HTML(
44
- """<!DOCTYPE html>
45
- <html lang="en">
46
- <head>
47
- <meta charset="utf-8" />
48
- <meta name="twitter:card" content="player"/>
49
- <meta name="twitter:site" content=""/>
50
- <meta name="twitter:player" content="https://omnibus-maximum-multiplier-places.hf.space"/>
51
- <meta name="twitter:player:stream" content="https://omnibus-maximum-multiplier-places.hf.space"/>
52
- <meta name="twitter:player:width" content="100%"/>
53
- <meta name="twitter:player:height" content="600"/>
54
- <meta property="og:title" content="Embedded Live Viewer"/>
55
- <meta property="og:description" content="Tweet Genie - A Huggingface Space"/>
56
- <meta property="og:image" content="https://cdn.glitch.global/80dbe92e-ce75-44af-84d5-74a2e21e9e55/omnicard.png?v=1676772531627"/>
57
- <!--<meta http-equiv="refresh" content="0; url=https://huggingface.co/spaces/corbt/tweet-genie">-->
58
- </head>
59
- </html>
60
- """
61
  )
62
 
63
  with gr.Row():
@@ -74,28 +57,31 @@ with gr.Blocks(css=css) as myface:
74
  with gr.Row():
75
  see_prompts = gr.Button("Generate Prompts")
76
  run = gr.Button("Generate Images", variant="primary")
77
- with gr.Tab("Main"):
78
- with gr.Row():
79
- output1 = gr.Image(label=f"{current_model['name']}")
80
- output2 = gr.Image(label=f"{current_model['name']}")
81
- output3 = gr.Image(label=f"{current_model['name']}")
82
- output4 = gr.Image(label=f"{current_model['name']}")
83
- with gr.Row():
84
- magic1 = gr.Textbox(lines=4)
85
- magic2 = gr.Textbox(lines=4)
86
- magic3 = gr.Textbox(lines=4)
87
- magic4 = gr.Textbox(lines=4)
88
-
89
- with gr.Row():
90
- output5 = gr.Image(label=f"{current_model['name']}")
91
- output6 = gr.Image(label=f"{current_model['name']}")
92
- output7 = gr.Image(label=f"{current_model['name']}")
93
- output8 = gr.Image(label=f"{current_model['name']}")
94
- with gr.Row():
95
- magic5 = gr.Textbox(lines=4)
96
- magic6 = gr.Textbox(lines=4)
97
- magic7 = gr.Textbox(lines=4)
98
- magic8 = gr.Textbox(lines=4)
 
 
 
99
 
100
  model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
101
 
@@ -118,4 +104,4 @@ with gr.Blocks(css=css) as myface:
118
  see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
119
 
120
  myface.queue(concurrency_count=200)
121
- myface.launch(inline=True, show_api=False, max_threads=400)
 
6
  models = [
7
  {"name": "Claudfuen 1", "url": "claudfuen/photorealistic-fuen-v1"},
8
  {"name": "Deliberate", "url": "Masagin/Deliberate"},
9
+ {"name": "Dreamlike Photoreal", "url": "dreamlike-art/dreamlike-photoreal-2.0"},
 
10
  {"name": "Dreamshaper", "url": "Lykon/DreamShaper"},
11
+ {"name": "Realistic Vision 1.4", "url": "SG161222/Realistic_Vision_V1.4"},
12
+ {"name": "Seek Art Mega", "url": "coreco/seek.art_MEGA"},
13
  ]
14
 
15
  current_model = models[0]
16
 
17
+ text_gen = gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
18
 
19
  models2 = []
20
  for model in models:
 
30
  def set_model(current_model_index):
31
  global current_model
32
  current_model = models[current_model_index]
33
+ return gr.update(value=f"{current_model['name']}")
34
 
35
 
36
  def send_it(inputs, model_choice):
 
38
  return proc(inputs)
39
 
40
 
41
+ with gr.Blocks() as myface:
 
 
42
  gr.HTML(
43
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  )
45
 
46
  with gr.Row():
 
57
  with gr.Row():
58
  see_prompts = gr.Button("Generate Prompts")
59
  run = gr.Button("Generate Images", variant="primary")
60
+
61
+ with gr.Row():
62
+ output1 = gr.Image(label="")
63
+ output2 = gr.Image(label="")
64
+ with gr.Row():
65
+ magic1 = gr.Textbox(lines=2)
66
+ magic2 = gr.Textbox(lines=2)
67
+ with gr.Row():
68
+ output3 = gr.Image(label="")
69
+ output4 = gr.Image(label="")
70
+ with gr.Row():
71
+ magic3 = gr.Textbox(lines=2)
72
+ magic4 = gr.Textbox(lines=2)
73
+ with gr.Row():
74
+ output5 = gr.Image(label="")
75
+ output6 = gr.Image(label="")
76
+ with gr.Row():
77
+ magic5 = gr.Textbox(lines=2)
78
+ magic6 = gr.Textbox(lines=2)
79
+ with gr.Row():
80
+ output7 = gr.Image(label="")
81
+ output8 = gr.Image(label="")
82
+ with gr.Row():
83
+ magic7 = gr.Textbox(lines=2)
84
+ magic8 = gr.Textbox(lines=2)
85
 
86
  model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
87
 
 
104
  see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
105
 
106
  myface.queue(concurrency_count=200)
107
+ myface.launch(inline=True, show_api=False, max_threads=400)