James Peter Perrfone Jefferies
commited on
Commit
·
6e0823f
1
Parent(s):
86cdd5d
Add additional inputs
Browse files
app.py
CHANGED
@@ -2,12 +2,18 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from diffusers import DiffusionPipeline
|
4 |
|
5 |
-
def generate(
|
|
|
|
|
6 |
pipeline = DiffusionPipeline.from_pretrained("Lykon/DreamShaper")
|
7 |
|
8 |
return pipeline(
|
9 |
prompt=prompt,
|
10 |
negative_prompt=negative_prompt,
|
|
|
|
|
|
|
|
|
11 |
).images[0]
|
12 |
|
13 |
iface = gr.Interface(
|
@@ -15,6 +21,10 @@ iface = gr.Interface(
|
|
15 |
inputs=[
|
16 |
gr.Textbox(label="Prompt", value=""),
|
17 |
gr.Textbox(label="Negative Prompt", value=""),
|
|
|
|
|
|
|
|
|
18 |
],
|
19 |
outputs="image",
|
20 |
)
|
|
|
2 |
import torch
|
3 |
from diffusers import DiffusionPipeline
|
4 |
|
5 |
+
def generate(
|
6 |
+
prompt, negative_prompt, num_inference_steps, width, height, guidance_scale
|
7 |
+
):
|
8 |
pipeline = DiffusionPipeline.from_pretrained("Lykon/DreamShaper")
|
9 |
|
10 |
return pipeline(
|
11 |
prompt=prompt,
|
12 |
negative_prompt=negative_prompt,
|
13 |
+
num_inference_steps=num_inference_steps,
|
14 |
+
width=width,
|
15 |
+
height=height,
|
16 |
+
guidance_scale=guidance_scale,
|
17 |
).images[0]
|
18 |
|
19 |
iface = gr.Interface(
|
|
|
21 |
inputs=[
|
22 |
gr.Textbox(label="Prompt", value=""),
|
23 |
gr.Textbox(label="Negative Prompt", value=""),
|
24 |
+
gr.Slider(label="Sampling Steps", minimum=1, maximum=150, value=30, step=1),
|
25 |
+
gr.Slider(label="Width", minimum=64, maximum=2048, value=512, step=1),
|
26 |
+
gr.Slider(label="Height", minimum=64, maximum=2048, value=512, step=1),
|
27 |
+
gr.Slider(label="CFG Scale", minimum=1, maximum=30, value=9, step=0.5),
|
28 |
],
|
29 |
outputs="image",
|
30 |
)
|