Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
5ddbee5
1
Parent(s):
5769334
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
29 |
MAX_IMAGE_SIZE = 1024
|
30 |
|
31 |
@spaces.GPU
|
32 |
-
def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
33 |
|
34 |
if randomize_seed:
|
35 |
seed = random.randint(0, MAX_SEED)
|
@@ -146,8 +146,10 @@ with gr.Blocks(css=css) as demo:
|
|
146 |
|
147 |
gr.Examples(
|
148 |
examples = examples,
|
|
|
149 |
inputs = [prompt],
|
150 |
-
|
|
|
151 |
)
|
152 |
|
153 |
gr.on(
|
|
|
29 |
MAX_IMAGE_SIZE = 1024
|
30 |
|
31 |
@spaces.GPU
|
32 |
+
def infer(prompt, negative_prompt="", seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=5.0, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
33 |
|
34 |
if randomize_seed:
|
35 |
seed = random.randint(0, MAX_SEED)
|
|
|
146 |
|
147 |
gr.Examples(
|
148 |
examples = examples,
|
149 |
+
fn = infer,
|
150 |
inputs = [prompt],
|
151 |
+
outputs = [result, seed]
|
152 |
+
cache_examples="lazy"
|
153 |
)
|
154 |
|
155 |
gr.on(
|