mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 23:00:51 +08:00
Merge branch 'comfyanonymous:master' into feature/colab-gdrive
This commit is contained in:
commit
c47c16ba07
2
nodes.py
2
nodes.py
@ -779,7 +779,7 @@ class SaveImage:
|
|||||||
metadata.add_text(x, json.dumps(extra_pnginfo[x]))
|
metadata.add_text(x, json.dumps(extra_pnginfo[x]))
|
||||||
|
|
||||||
file = f"{filename}_{counter:05}_.png"
|
file = f"{filename}_{counter:05}_.png"
|
||||||
img.save(os.path.join(full_output_folder, file), pnginfo=metadata, optimize=True)
|
img.save(os.path.join(full_output_folder, file), pnginfo=metadata, compress_level=4)
|
||||||
results.append({
|
results.append({
|
||||||
"filename": file,
|
"filename": file,
|
||||||
"subfolder": subfolder,
|
"subfolder": subfolder,
|
||||||
|
|||||||
@ -129,12 +129,12 @@ class PromptServer():
|
|||||||
return web.Response(status=403)
|
return web.Response(status=403)
|
||||||
output_dir = full_output_dir
|
output_dir = full_output_dir
|
||||||
|
|
||||||
file = request.rel_url.query["filename"]
|
filename = request.rel_url.query["filename"]
|
||||||
file = os.path.basename(file)
|
filename = os.path.basename(filename)
|
||||||
file = os.path.join(output_dir, file)
|
file = os.path.join(output_dir, filename)
|
||||||
|
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
return web.FileResponse(file)
|
return web.FileResponse(file, headers={"Content-Disposition": f"filename=\"{filename}\""})
|
||||||
|
|
||||||
return web.Response(status=404)
|
return web.Response(status=404)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user