Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ from PIL import Image, ImageOps, ImageFilter
|
|
18 |
from torch import autocast
|
19 |
import cv2
|
20 |
import imageio
|
|
|
21 |
|
22 |
sys.path.append("./stable_diffusion")
|
23 |
|
@@ -155,6 +156,7 @@ model_wrap = CompVisDenoiser(model)
|
|
155 |
model_wrap_cfg = CFGDenoiser(model_wrap)
|
156 |
null_token = model.get_learned_conditioning([""])
|
157 |
|
|
|
158 |
def generate(
|
159 |
input_image: Image.Image,
|
160 |
instruction: str,
|
|
|
18 |
from torch import autocast
|
19 |
import cv2
|
20 |
import imageio
|
21 |
+
import spaces
|
22 |
|
23 |
sys.path.append("./stable_diffusion")
|
24 |
|
|
|
156 |
model_wrap_cfg = CFGDenoiser(model_wrap)
|
157 |
null_token = model.get_learned_conditioning([""])
|
158 |
|
159 |
+
@spaces.GPU(duration=20)
|
160 |
def generate(
|
161 |
input_image: Image.Image,
|
162 |
instruction: str,
|