Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,7 +110,7 @@ def inference(prompt, negative_prompt, guidance_scale, ddim_steps, seed):
|
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
-
@spaces.GPU()
|
| 114 |
@torch.no_grad()
|
| 115 |
def edit_inference(input_image, prompt, negative_prompt, guidance_scale, ddim_steps, seed, start_noise, a1, a2, a3, a4):
|
| 116 |
|
|
@@ -197,7 +197,7 @@ def edit_inference(input_image, prompt, negative_prompt, guidance_scale, ddim_st
|
|
| 197 |
|
| 198 |
return (image, input_image["background"])
|
| 199 |
|
| 200 |
-
@spaces.GPU()
|
| 201 |
def sample_then_run():
|
| 202 |
sample_model()
|
| 203 |
prompt = "sks person"
|
|
@@ -342,7 +342,7 @@ def invert(image, mask, pcs=10000, epochs=400, weight_decay = 1e-10, lr=1e-1):
|
|
| 342 |
return network
|
| 343 |
|
| 344 |
|
| 345 |
-
@spaces.GPU(duration=200)
|
| 346 |
def run_inversion(input_image, pcs, epochs, weight_decay,lr):
|
| 347 |
global network
|
| 348 |
init_image = input_image["background"].convert("RGB").resize((512, 512))
|
|
@@ -364,7 +364,7 @@ def run_inversion(input_image, pcs, epochs, weight_decay,lr):
|
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
-
@spaces.GPU()
|
| 368 |
def file_upload(file):
|
| 369 |
global unet
|
| 370 |
del unet
|
|
|
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
+
# @spaces.GPU()
|
| 114 |
@torch.no_grad()
|
| 115 |
def edit_inference(input_image, prompt, negative_prompt, guidance_scale, ddim_steps, seed, start_noise, a1, a2, a3, a4):
|
| 116 |
|
|
|
|
| 197 |
|
| 198 |
return (image, input_image["background"])
|
| 199 |
|
| 200 |
+
# @spaces.GPU()
|
| 201 |
def sample_then_run():
|
| 202 |
sample_model()
|
| 203 |
prompt = "sks person"
|
|
|
|
| 342 |
return network
|
| 343 |
|
| 344 |
|
| 345 |
+
# @spaces.GPU(duration=200)
|
| 346 |
def run_inversion(input_image, pcs, epochs, weight_decay,lr):
|
| 347 |
global network
|
| 348 |
init_image = input_image["background"].convert("RGB").resize((512, 512))
|
|
|
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
+
# @spaces.GPU()
|
| 368 |
def file_upload(file):
|
| 369 |
global unet
|
| 370 |
del unet
|