mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-22 12:57:02 +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))
|
||||
return input
|
||||
|
||||
current_date = time.strftime("%Y-%m-%d")
|
||||
filename_prefix = compute_vars(filename_prefix, image_width, image_height)
|
||||
|
||||
if filename_prefix:
|
||||
subfolder = os.path.dirname(os.path.normpath(filename_prefix))
|
||||
else:
|
||||
subfolder = current_date
|
||||
filename = os.path.basename(os.path.normpath(filename_prefix))
|
||||
|
||||
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):
|
||||
return {"required":
|
||||
{"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"},
|
||||
}
|
||||
|
||||
@ -1399,8 +1400,10 @@ class SaveImage:
|
||||
|
||||
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
|
||||
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])
|
||||
results = list()
|
||||
for (batch_number, image) in enumerate(images):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user