mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-23 02:57:00 +08:00
Revert changes to folder_paths.py, changes to nodes.py instead https://github.com/comfyanonymous/ComfyUI/pull/3402\#issuecomment-2094914458
This commit is contained in:
parent
2b2adb9462
commit
06e94f0e2e
@ -242,13 +242,9 @@ def get_save_image_path(filename_prefix, output_dir, image_width=0, image_height
|
|||||||
input = input.replace("%height%", str(image_height))
|
input = input.replace("%height%", str(image_height))
|
||||||
return input
|
return input
|
||||||
|
|
||||||
current_date = time.strftime("%Y-%m-%d")
|
|
||||||
filename_prefix = compute_vars(filename_prefix, image_width, image_height)
|
filename_prefix = compute_vars(filename_prefix, image_width, image_height)
|
||||||
|
|
||||||
if filename_prefix:
|
|
||||||
subfolder = os.path.dirname(os.path.normpath(filename_prefix))
|
subfolder = os.path.dirname(os.path.normpath(filename_prefix))
|
||||||
else:
|
|
||||||
subfolder = current_date
|
|
||||||
filename = os.path.basename(os.path.normpath(filename_prefix))
|
filename = os.path.basename(os.path.normpath(filename_prefix))
|
||||||
|
|
||||||
full_output_folder = os.path.join(output_dir, subfolder)
|
full_output_folder = os.path.join(output_dir, subfolder)
|
||||||
|
|||||||
7
nodes.py
7
nodes.py
@ -1388,7 +1388,8 @@ class SaveImage:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required":
|
return {"required":
|
||||||
{"images": ("IMAGE", ),
|
{"images": ("IMAGE", ),
|
||||||
"filename_prefix": ("STRING", {"default": "ComfyUI"})},
|
"filename_prefix": ("STRING", {"default": "ComfyUI"}),
|
||||||
|
"organize_by_date": ("BOOLEAN", {"default": True, "label_on": "enable", "label_off": "disable"})},
|
||||||
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
|
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1399,8 +1400,10 @@ class SaveImage:
|
|||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "image"
|
||||||
|
|
||||||
def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
|
def save_images(self, images, filename_prefix="ComfyUI", organize_by_date=True, prompt=None, extra_pnginfo=None):
|
||||||
filename_prefix += self.prefix_append
|
filename_prefix += self.prefix_append
|
||||||
|
if organize_by_date:
|
||||||
|
filename_prefix = time.strftime("%Y-%m-%d") + "/" + filename_prefix
|
||||||
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])
|
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])
|
||||||
results = list()
|
results = list()
|
||||||
for (batch_number, image) in enumerate(images):
|
for (batch_number, image) in enumerate(images):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user