hra commited on
Commit
48e0d06
1 Parent(s): 1a74be9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -7
app.py CHANGED
@@ -159,31 +159,39 @@ def getadvertisement(topic):
159
  input_keyword=getadline(random.choice('abcdefghijklmnopqrstuvwxyz'))
160
  if 'Unsafe content found' in input_keyword:
161
  input_keyword='Abstract art with a splash of colors'
 
 
162
  prompt_SD=input_keyword+','+prompt_image
163
  # generate image
164
  image = generate_image(prompt_SD)
165
 
166
  # save to disk
167
  image.save("finalimage.png")
 
 
 
 
 
168
 
169
- return 'finalimage.png'
170
 
171
 
172
  with gr.Blocks() as demo:
173
- gr.Markdown("<h1><center>Tee Shirt Designs</center></h1>")
174
  gr.Markdown(
175
- """Enter a prompt and get the tee shirt design. Use examples as a guide. We use an equally powerful AI model bigscience/bloom."""
176
  )
177
  with gr.Row() as row:
178
  with gr.Column():
179
- textbox = gr.Textbox(placeholder="Enter prompt...", lines=1,label='Your prompt')
180
  btn = gr.Button("Generate")
181
  with gr.Column():
182
- output_image = gr.components.Image(label="Your tee shirt")
 
183
 
184
 
185
- btn.click(getadvertisement,inputs=[textbox], outputs=[output_image])
186
- examples = gr.Examples(examples=['anime art of man fighting','intricate skull','heavy metal band cover','abstract art of plants',],
187
  inputs=[textbox])
188
 
189
 
 
159
  input_keyword=getadline(random.choice('abcdefghijklmnopqrstuvwxyz'))
160
  if 'Unsafe content found' in input_keyword:
161
  input_keyword='Abstract art with a splash of colors'
162
+ print(input_keyword)
163
+ print(datetime.today().strftime("%d-%m-%Y"))
164
  prompt_SD=input_keyword+','+prompt_image
165
  # generate image
166
  image = generate_image(prompt_SD)
167
 
168
  # save to disk
169
  image.save("finalimage.png")
170
+
171
+ image = generate_image(prompt_SD)
172
+
173
+ # save to disk
174
+ image.save("finalimage1.png")
175
 
176
+ return 'finalimage.png',"finalimage1.png"
177
 
178
 
179
  with gr.Blocks() as demo:
180
+ gr.Markdown("<h1><center>T-Shirt Designs</center></h1>")
181
  gr.Markdown(
182
+ """Enter a prompt and get the t-shirt design. Use examples as a guide. We use an equally powerful AI model bigscience/bloom."""
183
  )
184
  with gr.Row() as row:
185
  with gr.Column():
186
+ textbox = gr.Textbox(placeholder="Enter prompt (keep it crisp)...", lines=1,label='Your prompt (Optional)')
187
  btn = gr.Button("Generate")
188
  with gr.Column():
189
+ output_image1 = gr.components.Image(label="Your tee shirt")
190
+ output_image2 = gr.components.Image(label="Your tee shirt")
191
 
192
 
193
+ btn.click(getadvertisement,inputs=[textbox], outputs=[output_image1,output_image2])
194
+ examples = gr.Examples(examples=['anime art of man fighting','intricate skull concept art','heavy metal band album cover','abstract art of plants',],
195
  inputs=[textbox])
196
 
197