anusha-bhambore commited on
Commit
449842d
·
verified ·
1 Parent(s): 34f5fc4

commit changes

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,12 +5,13 @@ import gradio as gr
5
  device = "cuda" if torch.cuda.is_available() else "cpu"
6
  pipeline = DiffusionPipeline.from_pretrained("anusha-bhambore/live-eventful")
7
  pipeline = pipeline.to(device)
8
- def generate_image_interface(prompt, negative_prompt,num_inference_steps=50, weight=640):
9
  params = {'prompt': prompt, 'num_inference_steps': num_inference_steps, 'num_images_per_prompt':2, 'height':int(1.2*weight),
10
- 'weight': weight, 'negative_prompt': negative_prompt}
11
 
12
  img = pipeline(**params).images
13
  return img[0],img[1]
 
14
  description = "Experience the magic of personalized birthday event design with our innovative web app! Simply input your preferences and prompts, and watch as your creative ideas transform into stunning, one-of-a-kind birthday event images. "
15
  demo = gr.Interface(generate_image_interface,title="Birthday Events", inputs=["text","text","text", "text",gr.Slider(1,100),gr.Slider(512,640)], outputs=["image","image"], description=description)
16
  demo.launch()
 
5
  device = "cuda" if torch.cuda.is_available() else "cpu"
6
  pipeline = DiffusionPipeline.from_pretrained("anusha-bhambore/live-eventful")
7
  pipeline = pipeline.to(device)
8
+ def generate_image_interface(prompt, negative_prompt, gender, age, num_inference_steps=50, weight=640):
9
  params = {'prompt': prompt, 'num_inference_steps': num_inference_steps, 'num_images_per_prompt':2, 'height':int(1.2*weight),
10
+ 'weight': weight, 'negative_prompt': negative_prompt,'gender': gender, 'age': age }
11
 
12
  img = pipeline(**params).images
13
  return img[0],img[1]
14
+
15
  description = "Experience the magic of personalized birthday event design with our innovative web app! Simply input your preferences and prompts, and watch as your creative ideas transform into stunning, one-of-a-kind birthday event images. "
16
  demo = gr.Interface(generate_image_interface,title="Birthday Events", inputs=["text","text","text", "text",gr.Slider(1,100),gr.Slider(512,640)], outputs=["image","image"], description=description)
17
  demo.launch()