test path
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ import time
|
|
15 |
from safetensors.torch import load_file
|
16 |
import time
|
17 |
import tempfile
|
|
|
18 |
|
19 |
# Constants
|
20 |
BASE = "stabilityai/stable-diffusion-xl-base-1.0"
|
@@ -136,7 +137,7 @@ def predict(prompt, seed=1231231):
|
|
136 |
image = results.images[0]
|
137 |
with tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) as tmpfile:
|
138 |
image.save(tmpfile, "JPEG", quality=80, optimize=True, progressive=True)
|
139 |
-
return tmpfile.name
|
140 |
|
141 |
|
142 |
css = """
|
|
|
15 |
from safetensors.torch import load_file
|
16 |
import time
|
17 |
import tempfile
|
18 |
+
from pathlib import Path
|
19 |
|
20 |
# Constants
|
21 |
BASE = "stabilityai/stable-diffusion-xl-base-1.0"
|
|
|
137 |
image = results.images[0]
|
138 |
with tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) as tmpfile:
|
139 |
image.save(tmpfile, "JPEG", quality=80, optimize=True, progressive=True)
|
140 |
+
return Path(tmpfile.name)
|
141 |
|
142 |
|
143 |
css = """
|