Spaces:
Runtime error
Runtime error
gbarbadillo
commited on
Commit
·
0d9d7db
1
Parent(s):
b2a11c1
updated output to work with a single image
Browse files
app.py
CHANGED
|
@@ -83,7 +83,7 @@ def generate_images(prompt, img_filepath,
|
|
| 83 |
num_samples=n_images, width=512, height=512, num_inference_steps=num_inference_steps, seed=seed,
|
| 84 |
scale=img_prompt_scale, # with scale=1 I get weird images
|
| 85 |
)
|
| 86 |
-
return [images, Image.fromarray(face_image[..., [2, 1, 0]])]
|
| 87 |
|
| 88 |
|
| 89 |
with gr.Blocks() as demo:
|
|
@@ -91,6 +91,8 @@ with gr.Blocks() as demo:
|
|
| 91 |
"""
|
| 92 |
# IP-Adapter-FaceID-plus
|
| 93 |
Generate images conditioned on a image prompt and a text prompt. Learn more here: https://huggingface.co/h94/IP-Adapter-FaceID
|
|
|
|
|
|
|
| 94 |
""")
|
| 95 |
with gr.Row():
|
| 96 |
with gr.Column():
|
|
@@ -104,7 +106,7 @@ with gr.Blocks() as demo:
|
|
| 104 |
|
| 105 |
with gr.Column():
|
| 106 |
demo_outputs = []
|
| 107 |
-
demo_outputs.append(gr.
|
| 108 |
demo_outputs.append(gr.Image(label='detected face', height=224, width=224))
|
| 109 |
btn.click(generate_images, inputs=demo_inputs, outputs=demo_outputs)
|
| 110 |
sample_prompts = [
|
|
|
|
| 83 |
num_samples=n_images, width=512, height=512, num_inference_steps=num_inference_steps, seed=seed,
|
| 84 |
scale=img_prompt_scale, # with scale=1 I get weird images
|
| 85 |
)
|
| 86 |
+
return [images[0], Image.fromarray(face_image[..., [2, 1, 0]])]
|
| 87 |
|
| 88 |
|
| 89 |
with gr.Blocks() as demo:
|
|
|
|
| 91 |
"""
|
| 92 |
# IP-Adapter-FaceID-plus
|
| 93 |
Generate images conditioned on a image prompt and a text prompt. Learn more here: https://huggingface.co/h94/IP-Adapter-FaceID
|
| 94 |
+
|
| 95 |
+
This demo is intended to use on GPU. It will work also on CPU but generating one image could take 900 seconds compared to a few sceonds on GPU.
|
| 96 |
""")
|
| 97 |
with gr.Row():
|
| 98 |
with gr.Column():
|
|
|
|
| 106 |
|
| 107 |
with gr.Column():
|
| 108 |
demo_outputs = []
|
| 109 |
+
demo_outputs.append(gr.Image(label='generated image'))
|
| 110 |
demo_outputs.append(gr.Image(label='detected face', height=224, width=224))
|
| 111 |
btn.click(generate_images, inputs=demo_inputs, outputs=demo_outputs)
|
| 112 |
sample_prompts = [
|