multimodalart HF staff commited on
Commit
a550ff1
β€’
1 Parent(s): ad7df92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -42,10 +42,10 @@ def generate_image(image, prompt, negative_prompt):
42
  faces = app.get(image)
43
  faceid_embeds = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0)
44
 
45
- images = ip_model.generate(
46
  prompt=prompt, negative_prompt=negative_prompt, faceid_embeds=faceid_embeds, width=512, height=512, num_inference_steps=30
47
- )
48
- return images.image[0]
49
 
50
  demo = gr.Interface(fn=generate_image, inputs=[gr.Image(label="Your face"), gr.Textbox(label="Prompt"), gr.Textbox(label="Negative Prompt")], outputs=[gr.Image(label="Generated Image")])
51
  demo.launch()
 
42
  faces = app.get(image)
43
  faceid_embeds = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0)
44
 
45
+ image = ip_model.generate(
46
  prompt=prompt, negative_prompt=negative_prompt, faceid_embeds=faceid_embeds, width=512, height=512, num_inference_steps=30
47
+ ).images[0]
48
+ return image
49
 
50
  demo = gr.Interface(fn=generate_image, inputs=[gr.Image(label="Your face"), gr.Textbox(label="Prompt"), gr.Textbox(label="Negative Prompt")], outputs=[gr.Image(label="Generated Image")])
51
  demo.launch()