ComfyUI-DirGir

ComfyUI-DirGir
★ 29

目录浏览器智能循环正则过滤Tkinter依赖
为ComfyUI提供目录自动化工具,含带GUI的Directory Get-It-Right浏览器及支持正则、扩展名过滤和排序的智能目录循环节点;需Tkinter。
💡 可视化选择目录并按规则批量遍历与筛选文件。
🍴 6 Forks💻 Python🔄 2025-05-04
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/79aaff81621b
📦 requirements.txt
aiohttp
tk
Scoot
Manager Search
GIR Directory Picker
GIR Loopy Dir
GIR Image Nabber
Let's Dance!
Picker Demo
Loopy Demo
Loopy Regex Demo
Muffin
📄 README

ComfyUI Directory GIR (Get It Right)

Utility nodes to get directories right in ComfyUI. Ever want to select a random directory and loop bulk queue more than the number of files available automatically reverting to 0 index after they were all done? So did I!

To create this custom node pack, I uploaded the sparse ComfyUI documentation, a few custom node sources, and app js source code to an OpenAi GPTs ComfyUI Craftsman, this GPTs is good at answering questions and offering guidance based on real ComfyUI implementations.

Installation

Tkinker is required, launching this custom node will attempt to install automatically. If this fails, the Directory Picker will not work properly. See TKinker Installation

Comfy Manager

Search Dirgir in Comfy Manager!

Manual installation:

cd Your_ComfyUI_Path/custom_nodes
git clone https://github.com/AshMartian/ComfyUI-DirGir

Then restart ComfyUI

Nodes

| Node | Description |

| :——————————————————————-: | :————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————- |

| GIR Directory Picker | “Select Directory” opens a GUI file browser using tkinker, the selected directory is persistent on disk (server restarts are no problem!), and available via output string. Changing the Selected Directory manually is supported too. |

| GIR Loopy Dir | Directory in, automatic loopy-ness out. Auto-increment and auto resetting, when the loop_index reaches the end of filtered files in directory, goes back to zero. Filter by extension or regex, manually change loop_index to override! Note: When queuing, the loop_index will increment in real time, queuing over the number of files available is no problem, the loop_index will tell you what index is next as the queue progresses. |

| GIR Image Nabber | A simple path to image node, for working with results of Loopy Dir without relying on an external node pack that has it’s own directory filtering logic _(For videos, use VHS Load Video (Path)_) |

| GIR Happy Dance!\* | These nodes simplify and streamline the process of directory selection and iteration, making complex tasks feel like a breeze. With the ability to effortlessly pick directories and loop through files with smart reset capabilities, GIR is over the moon, knowing users can focus on creativity and productivity, leaving the tedious parts to the automation magic of ComfyUI DirGir. |

Examples

Get It Right Directory Picker (Tested on MacOS\*\* and Windows)

A simple workflow using both nodes

  • GIR Dir Picker outputting a directory to both GIR Loopy Dir and LoadImagesFromPath
  • GIR Loopy Dir configured to filter for file extensions of png, outputs 11 matching files
  • current_index connected to LoadImagesFromPath
  • As the queue is prompted, new images load
  • As the queue goes beyond the file_count, loop_index is reset automatically.
  • Regex Usage

  • The problem with using LoadImagesFromPath is it’s own built in directory filtering and index logic. GIR Loopy Dir will output filtered indexes that don’t always align (especially with regex).
  • Using GIR Image Nabber we can reliably load images from a direct path.
  • \*GIR Happy dance is not a real node, open an Issue to request it!

    \*\*MacOS Works great on first directory selection, but on subsequent selections the directory browser is behind web browser. Not an issue on Windows.