Spaces:
Runtime error
Runtime error
Commit
•
5e32e8a
1
Parent(s):
a06e683
GRADIO_TEMP_DIR fix (#3)
Browse files- GRADIO_TEMP_DIR fix (0deab391eafa1360e583e4a3a40cb5574010d578)
Co-authored-by: Morpheus <[email protected]>
app.py
CHANGED
@@ -7,6 +7,7 @@ import gc
|
|
7 |
import cv2
|
8 |
import torch
|
9 |
import random
|
|
|
10 |
import numpy as np
|
11 |
from PIL import Image
|
12 |
from diffusers import ControlNetModel, StableDiffusionXLControlNetPipeline
|
@@ -163,7 +164,7 @@ def create_image(image_pil,
|
|
163 |
target="Load only style blocks",
|
164 |
neg_content_prompt=None,
|
165 |
neg_content_scale=0,
|
166 |
-
progress=gr.Progress(track_tqdm=True)
|
167 |
):
|
168 |
|
169 |
if target =="Load original IP-Adapter":
|
@@ -215,7 +216,7 @@ def create_image(image_pil,
|
|
215 |
controlnet_conditioning_scale=float(control_scale),
|
216 |
)
|
217 |
|
218 |
-
gradio_temp_dir = os.environ
|
219 |
temp_file_path = os.path.join(gradio_temp_dir, "image.png")
|
220 |
images[0].save(temp_file_path, format="PNG")
|
221 |
print(f"Image saved in: {temp_file_path}")
|
|
|
7 |
import cv2
|
8 |
import torch
|
9 |
import random
|
10 |
+
import tempfile
|
11 |
import numpy as np
|
12 |
from PIL import Image
|
13 |
from diffusers import ControlNetModel, StableDiffusionXLControlNetPipeline
|
|
|
164 |
target="Load only style blocks",
|
165 |
neg_content_prompt=None,
|
166 |
neg_content_scale=0,
|
167 |
+
# progress=gr.Progress(track_tqdm=True)
|
168 |
):
|
169 |
|
170 |
if target =="Load original IP-Adapter":
|
|
|
216 |
controlnet_conditioning_scale=float(control_scale),
|
217 |
)
|
218 |
|
219 |
+
gradio_temp_dir = os.environ.get('GRADIO_TEMP_DIR', tempfile.gettempdir())
|
220 |
temp_file_path = os.path.join(gradio_temp_dir, "image.png")
|
221 |
images[0].save(temp_file_path, format="PNG")
|
222 |
print(f"Image saved in: {temp_file_path}")
|