AYYasaswini commited on
Commit
13dcc8e
·
verified ·
1 Parent(s): 803e08c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -1
app.py CHANGED
@@ -1068,4 +1068,34 @@ def generate_image_from_prompt(text_in, style_in):
1068
 
1069
  #loss_generated_img = (loss_style(prompt, style_embed[0], style_seed))
1070
 
1071
- return [generated_image]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1068
 
1069
  #loss_generated_img = (loss_style(prompt, style_embed[0], style_seed))
1070
 
1071
+ return [generated_image]
1072
+
1073
+
1074
+ # Define Interface
1075
+ title = 'Stable Diffusion Art Generator'
1076
+
1077
+ # Add clear and concise labels and instructions
1078
+ prompt_label = "Enter a prompt (e.g., 'A campfire (oil on canvas)'"
1079
+ styles_label = "Select a Pretrained Style:"
1080
+
1081
+ instructions = "Explore creative art generation using Stable Diffusion. Enter a prompt and choose a style to get started."
1082
+
1083
+ demo = gr.Interface(generate_image_from_prompt,
1084
+ inputs=[
1085
+ gr.Textbox('A campfire (oil on canvas)', label=prompt_label),
1086
+ gr.Dropdown(
1087
+ ['learned_embeds_gartic-phone', 'learned_embeds_hawaiian-shirt', 'learned_embeds_phone01', 'learned_embeds_style-spdmn', 'learned_embedssd_yvmqznrm'],
1088
+ value="learned_embeds_gartic-phone",
1089
+ label=styles_label
1090
+ ),
1091
+ ],
1092
+ outputs=[
1093
+ gr.Gallery(label="Generated Images", show_label=False, elem_id="gallery", columns=[2], rows=[2],
1094
+ object_fit="contain"),
1095
+ ],
1096
+ title=title,
1097
+ description=instructions
1098
+ )
1099
+
1100
+ demo.launch(debug=True)
1101
+