Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,8 +11,15 @@ pipe.load_lora_weights(
|
|
11 |
)
|
12 |
pipe.to('cuda')
|
13 |
@spaces.GPU
|
14 |
-
def generate(prompt, negative_prompt, num_inference_steps, width, height):
|
15 |
-
return pipe(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
|
18 |
app = gr.Interface(
|
@@ -20,9 +27,10 @@ app = gr.Interface(
|
|
20 |
inputs=[
|
21 |
gr.Text(label="Prompt"),
|
22 |
gr.Text("", label="Negative Prompt"),
|
23 |
-
gr.
|
24 |
-
gr.Number(
|
25 |
-
gr.Number(
|
|
|
26 |
],
|
27 |
outputs=gr.Gallery(),
|
28 |
)
|
|
|
11 |
)
|
12 |
pipe.to('cuda')
|
13 |
@spaces.GPU
|
14 |
+
def generate(prompt, negative_prompt, num_inference_steps, width, height, num_samples):
|
15 |
+
return pipe(
|
16 |
+
prompt,
|
17 |
+
negative_prompt=negative_prompt,
|
18 |
+
num_inference_steps=num_inference_steps,
|
19 |
+
width=width,
|
20 |
+
height=height,
|
21 |
+
num_images_per_prompt=num_samples
|
22 |
+
).images
|
23 |
|
24 |
|
25 |
app = gr.Interface(
|
|
|
27 |
inputs=[
|
28 |
gr.Text(label="Prompt"),
|
29 |
gr.Text("", label="Negative Prompt"),
|
30 |
+
gr.Slider(min=1, max=100, default=45, label="Number inference steps"),
|
31 |
+
gr.Number(512, label='Image width'),
|
32 |
+
gr.Number(512, label='Image height'),
|
33 |
+
gr.Slider(min=1, max=10, default=1, label='Number samples'),
|
34 |
],
|
35 |
outputs=gr.Gallery(),
|
36 |
)
|