AkashKumarave commited on
Commit
a383ea5
·
verified ·
1 Parent(s): 00d7ed0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -95,4 +95,19 @@ def generate_image(uploaded_image, prompt):
95
  image_embeds=face_emb,
96
  num_inference_steps=20,
97
  guidance_scale=7.5,
98
- height=512,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  image_embeds=face_emb,
96
  num_inference_steps=20,
97
  guidance_scale=7.5,
98
+ height=512,
99
+ width=512,
100
+ ).images[0] # Closing parenthesis here
101
+ return "Image generated successfully!", image
102
+ except Exception as e:
103
+ return f"Generation failed: {e}", None
104
+
105
+ interface = gr.Interface(
106
+ fn=generate_image,
107
+ inputs=[gr.Image(type="pil", label="Upload Reference Image"), gr.Textbox(label="Enter Prompt", placeholder="e.g., A photorealistic astronaut in space")],
108
+ outputs=[gr.Textbox(label="Status"), gr.Image(label="Generated Image")],
109
+ title="Face Reference Image Generator (Kolors with IP-Adapter)",
110
+ description="Upload an image with a face, enter a prompt, and generate a new image preserving the reference face."
111
+ )
112
+
113
+ interface.launch()