tonyassi commited on
Commit
3bb139d
·
1 Parent(s): 7fbef3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -27,9 +27,19 @@ def greet(description,color,features,occasion,type):
27
 
28
  type = ' type:' + ','.join(type)
29
 
30
- final += description + color + features + occasion + type
 
 
 
 
 
 
 
 
 
 
31
 
32
- return final
33
 
34
  iface = gr.Interface(fn=greet,
35
  inputs=[gr.Textbox(label='Description'),
@@ -38,5 +48,5 @@ iface = gr.Interface(fn=greet,
38
  gr.Dropdown(label='Occasion',choices=['Homecoming','Casual','Wedding-Guest','Festival','Sorority','Day','Vacation','Summer','Pool-Party','Birthday','Date-Night','Party','Holiday','Winter-Formal','Valentines-Day','Prom','Graduation'],multiselect=True),
39
  gr.Dropdown(label='Type',choices=['Mini-Dresses','Midi-Dresses','Maxi-Dresses','Two-Piece-Sets','Rompers','Jeans','Jumpsuits','Pants','Tops','Jumpers/Cardigans','Skirts','Shorts','Bodysuits','Swimwear'],multiselect=True),
40
  ],
41
- outputs="text")
42
  iface.launch()
 
27
 
28
  type = ' type:' + ','.join(type)
29
 
30
+ prompt += description + color + features + occasion + type
31
+
32
+ print(prompt)
33
+ image = pipe(
34
+ prompt,
35
+ width=512,
36
+ height=512,
37
+ num_inference_steps=100,
38
+ guidance_scale=7.5,
39
+ cross_attention_kwargs={"scale": 1.0}
40
+ ).images[0]
41
 
42
+ return image
43
 
44
  iface = gr.Interface(fn=greet,
45
  inputs=[gr.Textbox(label='Description'),
 
48
  gr.Dropdown(label='Occasion',choices=['Homecoming','Casual','Wedding-Guest','Festival','Sorority','Day','Vacation','Summer','Pool-Party','Birthday','Date-Night','Party','Holiday','Winter-Formal','Valentines-Day','Prom','Graduation'],multiselect=True),
49
  gr.Dropdown(label='Type',choices=['Mini-Dresses','Midi-Dresses','Maxi-Dresses','Two-Piece-Sets','Rompers','Jeans','Jumpsuits','Pants','Tops','Jumpers/Cardigans','Skirts','Shorts','Bodysuits','Swimwear'],multiselect=True),
50
  ],
51
+ outputs="image")
52
  iface.launch()