Update app.py
Browse files
app.py
CHANGED
|
@@ -12,11 +12,28 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 12 |
pipe.to('cuda')
|
| 13 |
|
| 14 |
@spaces.GPU
|
| 15 |
-
def generate(prompt):
|
| 16 |
-
return pipe(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
gr.Interface(
|
| 19 |
fn=generate,
|
| 20 |
-
inputs=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
outputs=gr.Gallery(),
|
| 22 |
).launch()
|
|
|
|
| 12 |
pipe.to('cuda')
|
| 13 |
|
| 14 |
@spaces.GPU
|
| 15 |
+
def generate(prompt, negative_prompt, num_inference_steps, guidance_scale, width, height, num_samples):
|
| 16 |
+
return pipe(
|
| 17 |
+
prompt,
|
| 18 |
+
negative_prompt=negative_prompt,
|
| 19 |
+
num_inference_steps=num_inference_steps,
|
| 20 |
+
guidance_scale=guidance_scale,
|
| 21 |
+
width=width,
|
| 22 |
+
height=height,
|
| 23 |
+
num_images_per_prompt=num_samples
|
| 24 |
+
).images
|
| 25 |
+
|
| 26 |
|
| 27 |
gr.Interface(
|
| 28 |
fn=generate,
|
| 29 |
+
inputs=[
|
| 30 |
+
gr.Text(label="Prompt"),
|
| 31 |
+
gr.Text("", label="Negative Prompt"),
|
| 32 |
+
gr.Number(7, label="Number inference steps"),
|
| 33 |
+
gr.Number(3, label="Guidance scale"),
|
| 34 |
+
gr.Number(512, label="Width"),
|
| 35 |
+
gr.Number(512, label="Height"),
|
| 36 |
+
gr.Number(1, label="# images"),
|
| 37 |
+
],
|
| 38 |
outputs=gr.Gallery(),
|
| 39 |
).launch()
|