Update
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from PIL import Image, ImageDraw
|
|
6 |
from diffusers import DiffusionPipeline
|
7 |
import gradio as gr
|
8 |
from gradio.components.image_editor import EditorValue
|
|
|
9 |
|
10 |
DEVICE = "cuda"
|
11 |
|
@@ -35,7 +36,7 @@ def crop_divisible_by_16(image: Image.Image) -> Image.Image:
|
|
35 |
return image.crop((0, 0, w, h))
|
36 |
|
37 |
|
38 |
-
|
39 |
def predict(
|
40 |
image_and_mask: EditorValue,
|
41 |
condition_image: Image.Image | None,
|
|
|
6 |
from diffusers import DiffusionPipeline
|
7 |
import gradio as gr
|
8 |
from gradio.components.image_editor import EditorValue
|
9 |
+
import spaces
|
10 |
|
11 |
DEVICE = "cuda"
|
12 |
|
|
|
36 |
return image.crop((0, 0, w, h))
|
37 |
|
38 |
|
39 |
+
@spaces.GPU(duration=150)
|
40 |
def predict(
|
41 |
image_and_mask: EditorValue,
|
42 |
condition_image: Image.Image | None,
|