randeom commited on
Commit
584268b
·
verified ·
1 Parent(s): c683ec1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -109,7 +109,7 @@ css = """
109
  def process_request(logo_request, width, height, guidance_scale):
110
  improved_prompt = generate_improved_prompt(logo_request)
111
  image, image_url = generate_image(improved_prompt, width, height, guidance_scale)
112
- return image, image_url, improved_prompt, f"{width}x{height}", guidance_scale
113
 
114
  with gr.Blocks(css=css) as app:
115
  with gr.Row():
@@ -124,25 +124,22 @@ with gr.Blocks(css=css) as app:
124
  gr.HTML("<h1><center>Magical AI Logo Generator</h1><center>")
125
  generate_button = gr.Button("Generate")
126
  image_output = gr.Image(label="Generated Logo")
127
- url_output = gr.Textbox(label="Image URL", interactive=False, visible=False)
128
- prompt_output = gr.Textbox(label="Generated Prompt", interactive=False, visible=False)
129
- size_output = gr.Textbox(label="Image Size", interactive=False, visible=False)
130
- guidance_output = gr.Textbox(label="Guidance Scale", interactive=False, visible=False)
131
  generate_button.click(
132
  fn=process_request,
133
  inputs=[logo_input, width, height, guidance_scale],
134
- outputs=[image_output, url_output, prompt_output, size_output, guidance_output]
135
  )
 
136
  with gr.Row():
137
- with gr.Column():
138
- gr.Markdown("""
139
- | **Preview Image** | **Used Prompt** | **Size** | **Guidance Scale** |
140
- |-------------------|-----------------|----------|-------------------|
141
- """)
142
- gr.Image(url_output)
143
- gr.Textbox(prompt_output, interactive=False)
144
- gr.Textbox(size_output, interactive=False)
145
- gr.Textbox(guidance_output, interactive=False)
146
  gr.Markdown("""
147
  ---
148
  ### Meta Information
 
109
  def process_request(logo_request, width, height, guidance_scale):
110
  improved_prompt = generate_improved_prompt(logo_request)
111
  image, image_url = generate_image(improved_prompt, width, height, guidance_scale)
112
+ return image
113
 
114
  with gr.Blocks(css=css) as app:
115
  with gr.Row():
 
124
  gr.HTML("<h1><center>Magical AI Logo Generator</h1><center>")
125
  generate_button = gr.Button("Generate")
126
  image_output = gr.Image(label="Generated Logo")
 
 
 
 
127
  generate_button.click(
128
  fn=process_request,
129
  inputs=[logo_input, width, height, guidance_scale],
130
+ outputs=[image_output]
131
  )
132
+
133
  with gr.Row():
134
+ gr.HTML("<h2>Generated Examples</h2>")
135
+ gr.Markdown("""
136
+ | **Preview Image** | **Used Prompt** | **Size** | **Guidance Scale** |
137
+ |-------------------|--------------------------------|-----------|--------------------|
138
+ | ![Preview](https://i.imgur.com/CBvJ3sy.png) | Coffeeshop website logo | 1024x1024 | 3 |
139
+ | ![Preview](https://i.imgur.com/i2XpinX.png) | Bio food website logo | 1024x1024 | 3 |
140
+ | ![Preview](https://i.imgur.com/HeEjh4T.png) | Car seller website logo | 1024x1024 | 3 |
141
+ """)
142
+
143
  gr.Markdown("""
144
  ---
145
  ### Meta Information