Update app.py
Browse files
app.py
CHANGED
|
@@ -152,39 +152,32 @@ h1 {
|
|
| 152 |
background: #e64a19;
|
| 153 |
}
|
| 154 |
'''
|
| 155 |
-
|
| 156 |
with gr.Blocks(css=css) as demo:
|
| 157 |
gr.Markdown("# Image Generation with Face ID")
|
| 158 |
gr.Markdown("Upload your face images and enter a prompt to generate images.")
|
| 159 |
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
with gr.Column():
|
| 179 |
-
output_gallery = gr.Gallery(label="Generated Images")
|
| 180 |
-
|
| 181 |
-
# Define the event handler for the button click
|
| 182 |
run_button.click(
|
| 183 |
fn=generate_image,
|
| 184 |
inputs=[images_input, gender_input, prompt_input],
|
| 185 |
outputs=output_gallery
|
| 186 |
)
|
| 187 |
|
| 188 |
-
# Launch the interface
|
| 189 |
demo.queue()
|
| 190 |
demo.launch()
|
|
|
|
| 152 |
background: #e64a19;
|
| 153 |
}
|
| 154 |
'''
|
|
|
|
| 155 |
with gr.Blocks(css=css) as demo:
|
| 156 |
gr.Markdown("# Image Generation with Face ID")
|
| 157 |
gr.Markdown("Upload your face images and enter a prompt to generate images.")
|
| 158 |
|
| 159 |
+
images_input = gr.Files(
|
| 160 |
+
label="Drag 1 or more photos of your face",
|
| 161 |
+
file_types=["image"]
|
| 162 |
+
)
|
| 163 |
+
gender_input = gr.Radio(
|
| 164 |
+
label="Select Gender",
|
| 165 |
+
choices=["Female", "Male"],
|
| 166 |
+
value="Female",
|
| 167 |
+
type="value"
|
| 168 |
+
)
|
| 169 |
+
prompt_input = gr.Textbox(
|
| 170 |
+
label="Enter your prompt",
|
| 171 |
+
placeholder="Describe the image you want to generate..."
|
| 172 |
+
)
|
| 173 |
+
run_button = gr.Button("Generate Image")
|
| 174 |
+
output_gallery = gr.Gallery(label="Generated Images")
|
| 175 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
run_button.click(
|
| 177 |
fn=generate_image,
|
| 178 |
inputs=[images_input, gender_input, prompt_input],
|
| 179 |
outputs=output_gallery
|
| 180 |
)
|
| 181 |
|
|
|
|
| 182 |
demo.queue()
|
| 183 |
demo.launch()
|