Spaces:
Sleeping
Sleeping
- app.py +2 -0
- requirements.txt +1 -0
app.py
CHANGED
@@ -8,6 +8,7 @@ from PIL.PngImagePlugin import PngInfo
|
|
8 |
import json
|
9 |
import gradio as gr
|
10 |
import tempfile
|
|
|
11 |
|
12 |
# Set environment variable to reduce memory fragmentation
|
13 |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
|
@@ -48,6 +49,7 @@ except Exception as e:
|
|
48 |
pipe = None
|
49 |
|
50 |
|
|
|
51 |
def img2img(
|
52 |
uploaded_image,
|
53 |
image_url: str,
|
|
|
8 |
import json
|
9 |
import gradio as gr
|
10 |
import tempfile
|
11 |
+
import spaces
|
12 |
|
13 |
# Set environment variable to reduce memory fragmentation
|
14 |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
|
|
|
49 |
pipe = None
|
50 |
|
51 |
|
52 |
+
@spaces.GPU
|
53 |
def img2img(
|
54 |
uploaded_image,
|
55 |
image_url: str,
|
requirements.txt
CHANGED
@@ -5,3 +5,4 @@ accelerate>=0.20.0
|
|
5 |
gradio>=4.0.0
|
6 |
Pillow>=9.0.0
|
7 |
xformers>=0.0.20
|
|
|
|
5 |
gradio>=4.0.0
|
6 |
Pillow>=9.0.0
|
7 |
xformers>=0.0.20
|
8 |
+
spaces
|