Spaces:
Runtime error
Runtime error
Commit
•
48df6f9
1
Parent(s):
acb6168
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,7 @@ pipe = pipe.to(device)
|
|
24 |
|
25 |
@spaces.GPU
|
26 |
def run(prompt, negative_prompt="", guidance_scale=7.0, pag_scale=3.0, randomize_seed=True, seed=42, progress=gr.Progress(track_tqdm=True)):
|
|
|
27 |
if(randomize_seed):
|
28 |
seed = random.randint(0, sys.maxsize)
|
29 |
if(prompt == ""):
|
@@ -57,7 +58,7 @@ with gr.Blocks(css=css, theme=theme) as demo:
|
|
57 |
pag_scale = gr.Number(label="Pag Scale", value=3.0)
|
58 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
59 |
seed = gr.Slider(minimum=1, maximum=18446744073709551615, step=1, randomize=True)
|
60 |
-
gr.Examples(fn=run, examples=["", "an insect robot preparing a delicious meal, anime style", "a photo of a group of friends at an amusement park"], inputs=prompt, outputs=[output, seed], cache_examples=True)
|
61 |
gr.on(
|
62 |
triggers=[
|
63 |
button.click,
|
|
|
24 |
|
25 |
@spaces.GPU
|
26 |
def run(prompt, negative_prompt="", guidance_scale=7.0, pag_scale=3.0, randomize_seed=True, seed=42, progress=gr.Progress(track_tqdm=True)):
|
27 |
+
prompt = prompt.strip()
|
28 |
if(randomize_seed):
|
29 |
seed = random.randint(0, sys.maxsize)
|
30 |
if(prompt == ""):
|
|
|
58 |
pag_scale = gr.Number(label="Pag Scale", value=3.0)
|
59 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
60 |
seed = gr.Slider(minimum=1, maximum=18446744073709551615, step=1, randomize=True)
|
61 |
+
gr.Examples(fn=run, examples=[" ", "an insect robot preparing a delicious meal, anime style", "a photo of a group of friends at an amusement park"], inputs=prompt, outputs=[output, seed], cache_examples=True)
|
62 |
gr.on(
|
63 |
triggers=[
|
64 |
button.click,
|