diff --git a/CHANGELOG.md b/CHANGELOG.md index ed22b31..48db9c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## v0.0 +## v0.0.9 (2025-02-06) + +- add subfolder output to FileQueue and ImageQueue + ## v0.0.8 (2025-01-30) - improve reset strategy on queues, to handle early interruptions diff --git a/package.json b/package.json index fb0ca35..9a8767e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "confylab-pack", "private": true, - "version": "0.0.8", + "version": "0.0.9", "type": "module", "scripts": { "watch": "tsc-watch -p tsconfig.json --onSuccess 'tsc-alias -p tsconfig.json -r build/replacers.js/mock.js'", diff --git a/pyproject.toml b/pyproject.toml index ea43dbb..2b4b974 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfylab-pack" description = "Nodes: fully-customizable and versatile XY Plot grid, dynamic outputs from config files, Format String, various List utilities, ... visit the wiki for a complete list, tutorials and more." -version = "0.0.8" +version = "0.0.9" authors = [{ name = "bugltd" }] license = {file = "LICENSE"} readme = "README.md" diff --git a/src/python/nodes/queue.py b/src/python/nodes/queue.py index 50a6f59..ba561eb 100644 --- a/src/python/nodes/queue.py +++ b/src/python/nodes/queue.py @@ -81,12 +81,20 @@ class FileQueue: } FUNCTION = 'run' - RETURN_TYPES = ('STRING', 'STRING', 'STRING', 'INT', 'INT') - RETURN_NAMES = ('filename', 'full_path', 'relative_path', 'index', 'total') + RETURN_TYPES = ('STRING', 'STRING', 'STRING', 'STRING', 'INT', 'INT') + RETURN_NAMES = ( + 'filename', + 'full_path', + 'relative_path', + 'subfolder', + 'index', + 'total', + ) OUTPUT_TOOLTIPS = ( 'filename', 'full path', 'relative path', + 'subfolder (relative)', 'current index', 'total files', ) @@ -151,9 +159,10 @@ class FileQueue: return { 'result': ( str(file.name) if with_extension else file.stem, - # do not resolve, to ensure relative path is accurate + # do not resolve, to ensure relative path is accurate (if symlinks) str(file), str(file.relative_to(self.root)), + str(file.parent.relative_to(self.root)), index + 1, self.total, ), @@ -195,13 +204,22 @@ class ImageQueue(FileQueue): }, } - RETURN_TYPES = ('IMAGE', 'STRING', 'STRING', 'STRING', 'INT', 'INT') - RETURN_NAMES = ('image', 'filename', 'full_path', 'relative_path', 'index', 'total') + RETURN_TYPES = ('IMAGE', 'STRING', 'STRING', 'STRING', 'STRING', 'INT', 'INT') + RETURN_NAMES = ( + 'image', + 'filename', + 'full_path', + 'relative_path', + 'subfolder', + 'index', + 'total', + ) OUTPUT_TOOLTIPS = ( 'image', 'filename', 'full path', 'relative path', + 'subfolder (relative)', 'current index', 'total files', )