Brian Watson commited on
Commit
4a236b8
1 Parent(s): 986994b

Update app.py

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