Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,15 +36,6 @@ def infer(input_image, prompt, seed=42, randomize_seed=False, guidance_scale=2.5
|
|
| 36 |
|
| 37 |
Returns:
|
| 38 |
The modified image and seed used for generation.
|
| 39 |
-
|
| 40 |
-
Example:
|
| 41 |
-
>>> edited_image, used_seed, button_update = infer(
|
| 42 |
-
... input_image=my_image,
|
| 43 |
-
... prompt="Add sunglasses",
|
| 44 |
-
... seed=123,
|
| 45 |
-
... randomize_seed=False,
|
| 46 |
-
... guidance_scale=2.5
|
| 47 |
-
... )
|
| 48 |
"""
|
| 49 |
if randomize_seed:
|
| 50 |
seed = random.randint(0, MAX_SEED)
|
|
@@ -69,7 +60,7 @@ def infer(input_image, prompt, seed=42, randomize_seed=False, guidance_scale=2.5
|
|
| 69 |
).images[0]
|
| 70 |
return image, seed, gr.Button(visible=True)
|
| 71 |
|
| 72 |
-
@spaces.GPU
|
| 73 |
def infer_example(input_image, prompt):
|
| 74 |
image, seed, _ = infer(input_image, prompt)
|
| 75 |
return image, seed
|
|
|
|
| 36 |
|
| 37 |
Returns:
|
| 38 |
The modified image and seed used for generation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
"""
|
| 40 |
if randomize_seed:
|
| 41 |
seed = random.randint(0, MAX_SEED)
|
|
|
|
| 60 |
).images[0]
|
| 61 |
return image, seed, gr.Button(visible=True)
|
| 62 |
|
| 63 |
+
@spaces.GPU(duration=20)
|
| 64 |
def infer_example(input_image, prompt):
|
| 65 |
image, seed, _ = infer(input_image, prompt)
|
| 66 |
return image, seed
|