Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
2646440
1
Parent(s):
e4092f4
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,6 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
47 |
@spaces.GPU
|
48 |
def run(prompt="a photo of an astronaut riding a horse on mars",
|
49 |
negative_prompt="",
|
50 |
-
num_inference_steps=10,
|
51 |
randomize_seed=False,
|
52 |
seed=20,
|
53 |
progress=gr.Progress(track_tqdm=True)
|
@@ -60,8 +59,6 @@ def run(prompt="a photo of an astronaut riding a horse on mars",
|
|
60 |
ays_images = pipe(
|
61 |
prompt,
|
62 |
negative_prompt=negative_prompt,
|
63 |
-
num_inference_steps=num_inference_steps,
|
64 |
-
num_images_per_prompt=1,
|
65 |
timesteps=sampling_schedule,
|
66 |
).images
|
67 |
return ays_images[0], seed
|
@@ -119,18 +116,10 @@ with gr.Blocks(css=css) as demo:
|
|
119 |
)
|
120 |
|
121 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
122 |
-
|
123 |
-
num_inference_steps = gr.Slider(
|
124 |
-
label="Number of inference steps",
|
125 |
-
minimum=4,
|
126 |
-
maximum=12,
|
127 |
-
step=1,
|
128 |
-
value=8,
|
129 |
-
)
|
130 |
gr.on(
|
131 |
[run_button.click, prompt.submit, negative_prompt.submit],
|
132 |
fn = run,
|
133 |
-
inputs = [prompt, negative_prompt,
|
134 |
outputs = [result, seed]
|
135 |
)
|
136 |
|
|
|
47 |
@spaces.GPU
|
48 |
def run(prompt="a photo of an astronaut riding a horse on mars",
|
49 |
negative_prompt="",
|
|
|
50 |
randomize_seed=False,
|
51 |
seed=20,
|
52 |
progress=gr.Progress(track_tqdm=True)
|
|
|
59 |
ays_images = pipe(
|
60 |
prompt,
|
61 |
negative_prompt=negative_prompt,
|
|
|
|
|
62 |
timesteps=sampling_schedule,
|
63 |
).images
|
64 |
return ays_images[0], seed
|
|
|
116 |
)
|
117 |
|
118 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
gr.on(
|
120 |
[run_button.click, prompt.submit, negative_prompt.submit],
|
121 |
fn = run,
|
122 |
+
inputs = [prompt, negative_prompt, randomize_seed, seed],
|
123 |
outputs = [result, seed]
|
124 |
)
|
125 |
|