Spaces:
Runtime error
Runtime error
fix interface
Browse files
app.py
CHANGED
|
@@ -38,19 +38,31 @@ def infer(prompt, negative_prompt, image):
|
|
| 38 |
prompt,
|
| 39 |
cond_input,
|
| 40 |
generator=generator,
|
| 41 |
-
num_images_per_prompt=
|
| 42 |
num_inference_steps=20
|
| 43 |
)
|
| 44 |
|
| 45 |
return output
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
|
|
|
| 38 |
prompt,
|
| 39 |
cond_input,
|
| 40 |
generator=generator,
|
| 41 |
+
num_images_per_prompt=4,
|
| 42 |
num_inference_steps=20
|
| 43 |
)
|
| 44 |
|
| 45 |
return output
|
| 46 |
|
| 47 |
+
gr.Interface(
|
| 48 |
+
infer,
|
| 49 |
+
inputs=[
|
| 50 |
+
gr.Textbox(
|
| 51 |
+
label="Enter prompt",
|
| 52 |
+
max_lines=1,
|
| 53 |
+
placeholder="1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, watercolor, night, turtleneck",
|
| 54 |
+
),
|
| 55 |
+
gr.Textbox(
|
| 56 |
+
label="Enter negative prompt",
|
| 57 |
+
max_lines=1,
|
| 58 |
+
placeholder="low quality",
|
| 59 |
+
),
|
| 60 |
+
gr.Image(type="pil"),
|
| 61 |
+
],
|
| 62 |
+
outputs=gr.Gallery().style(grid=[2], height="auto"),
|
| 63 |
+
title="Generate controlled outputs with Categorical Conditioning on Waifu Diffusion 1.5 beta 2.",
|
| 64 |
+
description="This Space uses image examples as style conditioning.",
|
| 65 |
+
examples=[["wikipe_cond_1.png", "1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, watercolor, night, turtleneck"]],
|
| 66 |
+
allow_flagging=False,
|
| 67 |
+
).launch(enable_queue=True)
|
| 68 |
|