tonyassi commited on
Commit
25f9ca7
1 Parent(s): 949d052

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -9
app.py CHANGED
@@ -15,7 +15,7 @@ model_base = "runwayml/stable-diffusion-v1-5"
15
  pipe = StableDiffusionPipeline.from_pretrained(model_base, torch_dtype=torch.float16, use_safetensors=True, safety_checker=None,)
16
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
17
 
18
- lora_model_path = "./loralucy3/checkpoint-95000"
19
  pipe.unet.load_attn_procs(lora_model_path)
20
  pipe.to("cuda")
21
 
@@ -57,7 +57,7 @@ def face_swap(src_img, dest_img):
57
  def greet(description,color,features,occasion,type_,face):
58
 
59
  # Parse input
60
- prompt = 'white background '
61
  description = 'description:' + description.replace(' ', '-')
62
  color = ' color:' + ','.join(color)
63
  features = ' features:' + ','.join(features)
@@ -83,12 +83,19 @@ def greet(description,color,features,occasion,type_,face):
83
  return image
84
 
85
  iface = gr.Interface(fn=greet,
86
- inputs=[gr.Textbox(label='Description'),
87
- gr.Dropdown(label='Color',choices=['Beige','Black','Blue','Brown','Green','Grey','Orange','Pink','Purple','Red','White','Yellow'],multiselect=True),
88
- gr.Dropdown(label='Features',choices=['3/4-sleeve','Babydoll','Closed-Back','Corset','Crochet','Cutouts','Draped','Floral','Gloves','Halter','Lace','Long','Long-Sleeve','Midi','No-Slit','Off-The-Shoulder','One-Shoulder','Open-Back','Pockets','Print','Puff-Sleeve','Ruched','Satin','Sequins','Shimmer','Short','Short-Sleeve','Side-Slit','Square-Neck','Strapless','Sweetheart-Neck','Tight','V-Neck','Velvet','Wrap'],multiselect=True),
89
- 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),
90
- 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),
91
- gr.Dropdown(label='Face',choices=['Normal','Cat','Lisa','Mila'], value='Normal'),
92
  ],
93
- outputs=gr.Image(type="pil", label="Final Image", width=312, height=512))
 
 
 
 
 
 
 
94
  iface.launch()
 
15
  pipe = StableDiffusionPipeline.from_pretrained(model_base, torch_dtype=torch.float16, use_safetensors=True, safety_checker=None,)
16
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
17
 
18
+ lora_model_path = "./loralucy6/checkpoint-145000"
19
  pipe.unet.load_attn_procs(lora_model_path)
20
  pipe.to("cuda")
21
 
 
57
  def greet(description,color,features,occasion,type_,face):
58
 
59
  # Parse input
60
+ prompt = ''
61
  description = 'description:' + description.replace(' ', '-')
62
  color = ' color:' + ','.join(color)
63
  features = ' features:' + ','.join(features)
 
83
  return image
84
 
85
  iface = gr.Interface(fn=greet,
86
+ inputs=[gr.Textbox(label='Description'),
87
+ gr.Dropdown(interactive=True, label='Color',choices=['Beige','Black','Blue','Brown','Green','Grey','Orange','Pink','Purple','Red','White','Yellow'],multiselect=True),
88
+ gr.Dropdown(interactive=True, label='Features',choices=['3/4-sleeve','Babydoll','Closed-Back','Corset','Crochet','Cutouts','Draped','Floral','Gloves','Halter','Lace','Long','Long-Sleeve','Midi','No-Slit','Off-The-Shoulder','One-Shoulder','Open-Back','Pockets','Print','Puff-Sleeve','Ruched','Satin','Sequins','Shimmer','Short','Short-Sleeve','Side-Slit','Square-Neck','Strapless','Sweetheart-Neck','Tight','V-Neck','Velvet','Wrap'],multiselect=True),
89
+ gr.Dropdown(interactive=True, 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),
90
+ gr.Dropdown(interactive=True, 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),
91
+ gr.Dropdown(interactive=True, label='Face',choices=['Normal','Cat','Lisa','Mila'], value='Cat'),
92
  ],
93
+ outputs=gr.Image(type="pil", label="Final Image", width=312, height=512),
94
+ examples=[['Kailani mesh sequins two piece maxi dress pink',['Pink'],['Cutouts','Long-Sleeve','Sequins','Side-Slit'],['Festival','Party','Prom'],['Maxi-Dresses','Two-Piece-Sets'],'Cat']],
95
+ title='Lucy in the Sky: Text to Image',
96
+ description=
97
+ """
98
+ Design your own Lucy in the Sky dress with text!
99
+ """
100
+ )
101
  iface.launch()