mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-26 00:47:24 +08:00
Compare commits
4 Commits
8303b3a751
...
fa0decbe38
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa0decbe38 | ||
|
|
6bcd8b96ab | ||
|
|
9c34f5f36a | ||
|
|
7b7becc34c |
@ -120,6 +120,11 @@ def set_temp_directory(temp_dir: str) -> None:
|
||||
def set_input_directory(input_dir: str) -> None:
|
||||
global input_directory
|
||||
input_directory = input_dir
|
||||
if not os.path.exists(input_directory):
|
||||
try:
|
||||
os.makedirs(input_directory)
|
||||
except:
|
||||
logging.error("Failed to create input directory")
|
||||
|
||||
def get_output_directory() -> str:
|
||||
global output_directory
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
comfyui-frontend-package==1.42.15
|
||||
comfyui-frontend-package==1.43.17
|
||||
comfyui-workflow-templates==0.9.69
|
||||
comfyui-embedded-docs==0.4.4
|
||||
torch
|
||||
|
||||
@ -560,7 +560,7 @@ class PromptServer():
|
||||
buffer.seek(0)
|
||||
|
||||
return web.Response(body=buffer.read(), content_type=f'image/{image_format}',
|
||||
headers={"Content-Disposition": f"attachment; filename=\"{filename}\""})
|
||||
headers={"Content-Disposition": f"filename=\"{filename}\""})
|
||||
|
||||
if 'channel' not in request.rel_url.query:
|
||||
channel = 'rgba'
|
||||
@ -580,7 +580,7 @@ class PromptServer():
|
||||
buffer.seek(0)
|
||||
|
||||
return web.Response(body=buffer.read(), content_type='image/png',
|
||||
headers={"Content-Disposition": f"attachment; filename=\"{filename}\""})
|
||||
headers={"Content-Disposition": f"filename=\"{filename}\""})
|
||||
|
||||
elif channel == 'a':
|
||||
with Image.open(file) as img:
|
||||
@ -597,7 +597,7 @@ class PromptServer():
|
||||
alpha_buffer.seek(0)
|
||||
|
||||
return web.Response(body=alpha_buffer.read(), content_type='image/png',
|
||||
headers={"Content-Disposition": f"attachment; filename=\"{filename}\""})
|
||||
headers={"Content-Disposition": f"filename=\"{filename}\""})
|
||||
else:
|
||||
# Use the content type from asset resolution if available,
|
||||
# otherwise guess from the filename.
|
||||
@ -614,7 +614,7 @@ class PromptServer():
|
||||
return web.FileResponse(
|
||||
file,
|
||||
headers={
|
||||
"Content-Disposition": f"attachment; filename=\"{filename}\"",
|
||||
"Content-Disposition": f"filename=\"{filename}\"",
|
||||
"Content-Type": content_type
|
||||
}
|
||||
)
|
||||
|
||||
13
tests/test_folder_paths.py
Normal file
13
tests/test_folder_paths.py
Normal file
@ -0,0 +1,13 @@
|
||||
import folder_paths
|
||||
|
||||
|
||||
def test_set_input_directory_creates_missing_directory(tmp_path):
|
||||
original_input_directory = folder_paths.get_input_directory()
|
||||
custom_input_directory = tmp_path / "custom-input"
|
||||
|
||||
try:
|
||||
folder_paths.set_input_directory(str(custom_input_directory))
|
||||
|
||||
assert custom_input_directory.is_dir()
|
||||
finally:
|
||||
folder_paths.set_input_directory(original_input_directory)
|
||||
Loading…
Reference in New Issue
Block a user