Add file_path output with the absolute path of the loaded image
New STRING output (appended last so existing workflows keep their link slots) carrying the absolute path of the file loaded this run, alongside the existing filename output. Bump version to 1.4.0. Closes #1.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
│ └──────────────────────────────────┘ │
|
||||
└───────────────┬──────────────────────┘
|
||||
│
|
||||
image · mask · filename · index · total
|
||||
image · mask · filename · index · total · file_path
|
||||
```
|
||||
|
||||
Drop the node on the canvas, point it at a folder, wire **image** (and **mask** if you need it) into your graph, and Queue. Each Queue loads the next image; when it reaches the end it loops back to the start. That's the whole idea.
|
||||
@@ -98,6 +98,7 @@ While a hold is active, the other buttons grey out; **▶ Resume** restores the
|
||||
| `filename` | STRING | basename of the loaded file |
|
||||
| `index` | INT | 0-based position used this run |
|
||||
| `total` | INT | number of matching files found |
|
||||
| `file_path` | STRING | absolute path of the loaded file (e.g. `C:\frames\frame_003.png`) |
|
||||
|
||||
## How "advance per Queue" works
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "sequential-image-loader"
|
||||
description = "Load a folder of images one at a time, in order — a fresh image on every Queue press. A paced, single-image folder sequencer for batch-processing frames or photos through any ComfyUI workflow."
|
||||
version = "1.3.0"
|
||||
version = "1.4.0"
|
||||
license = { file = "LICENSE" }
|
||||
readme = "README.md"
|
||||
dependencies = []
|
||||
|
||||
@@ -138,8 +138,10 @@ class SequentialImageLoader:
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE", "MASK", "STRING", "INT", "INT")
|
||||
RETURN_NAMES = ("image", "mask", "filename", "index", "total")
|
||||
# file_path is declared last (newest output) so links in older saved
|
||||
# workflows keep their slot positions.
|
||||
RETURN_TYPES = ("IMAGE", "MASK", "STRING", "INT", "INT", "STRING")
|
||||
RETURN_NAMES = ("image", "mask", "filename", "index", "total", "file_path")
|
||||
FUNCTION = "load"
|
||||
CATEGORY = "image"
|
||||
|
||||
@@ -162,7 +164,7 @@ class SequentialImageLoader:
|
||||
)
|
||||
|
||||
pos = int(index) % total # wrap around at the end
|
||||
path = files[pos]
|
||||
path = os.path.abspath(files[pos])
|
||||
filename = os.path.basename(path)
|
||||
|
||||
image, mask = _load_image_tensors(path)
|
||||
@@ -174,7 +176,7 @@ class SequentialImageLoader:
|
||||
"index": pos,
|
||||
"total": total,
|
||||
}]},
|
||||
"result": (image, mask, filename, pos, total),
|
||||
"result": (image, mask, filename, pos, total, path),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user