diff --git a/nodes.py b/nodes.py index ac9360f..fca3608 100644 --- a/nodes.py +++ b/nodes.py @@ -49,6 +49,11 @@ class SaveImageAsSDWebUI: CATEGORY = "image" def save_images(self, images, seed, filename_prefix="ComfyUI", image_format="png", quality=100, prompt=None, extra_pnginfo=None): + # If prefix ends with a path separator (e.g. "comfy-txt2img/"), + # treat it as a directory and append default filename "ComfyUI". + if filename_prefix.endswith('/') or filename_prefix.endswith('\\'): + filename_prefix = filename_prefix + "ComfyUI" + full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path( filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0] )