Spaces:
Sleeping
Sleeping
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import time
|
|
|
3 |
import torch
|
4 |
from diffusers import StableDiffusionXLImg2ImgPipeline
|
5 |
from diffusers.utils import load_image
|
@@ -8,7 +9,6 @@ from PIL.PngImagePlugin import PngInfo
|
|
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"
|
|
|
1 |
import os
|
2 |
import time
|
3 |
+
import spaces # Must be imported before torch/CUDA
|
4 |
import torch
|
5 |
from diffusers import StableDiffusionXLImg2ImgPipeline
|
6 |
from diffusers.utils import load_image
|
|
|
9 |
import json
|
10 |
import gradio as gr
|
11 |
import tempfile
|
|
|
12 |
|
13 |
# Set environment variable to reduce memory fragmentation
|
14 |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
|