Nodes/ComfyUI-AnimaForge-Windows/Anima Batch Folder Loader
ComfyUI Node

Anima Batch Folder Loader

Where every Anima batch starts

By AI-KSK·Created 3 months ago·Updated 3 months ago· 0
Anima Batch Folder Loader
    • TASK_LIST
    • scan_log
    dataset_root
    image_extensions.png,.jpg,.jpeg,.webp,.bmp
    folder_filter
    include_root_imagesfalse
    max_images_per_folder0

    AnimaForge's whole bet is that a LoRA factory should be organized by your filesystem, not by a spreadsheet. AnimaBatchFolderLoader is the node that turns that bet into a TASK_LIST. You point it at a root folder, and it treats every first-level subfolder as one training task, with the folder's name becoming that LoRA's trigger word. One dataset folder equals one LoRA, exactly as the pack's README frames it - no per-task setup, no CSV, no clicking through a hundred thumbnails.

    How it works

    Under the hood it's a plain filesystem scan (scan_task_folders in dataset_utils.py). It lists the child folders of dataset_root, looks for images inside each one (.png, .jpg, .jpeg, .webp, .bmp by default), and for every folder that has at least one image it emits a task dict: the folder path, the normalized trigger word, the image list, and how many of those images already have a .txt caption. That dict is the currency the whole pack trades in - caption nodes, the trainer, even the LoRA finder all consume TASK_LIST.

    Two details are worth knowing before you fight them. First, the folder name becomes the trigger word through normalize_trigger_word, which swaps spaces for underscores and strips special characters. So rebecca girl quietly becomes rebecca_girl, and Rebecca-Girl!!! becomes rebecca_girl. The README's advice is blunt: name your folders like rebecca_girl or blue_dress_style, avoid spaces and exclamation marks, and you'll never wonder why your trigger changed on you. Second, tasks are scanned fresh every execution (IS_CHANGED returns the current time), so dropping new images into a folder and re-running the workflow picks them up without a restart.

    The inputs that matter

    You'll set most of these once and forget them:

    • dataset_root - the only input you have to get right. Point it at the folder containing your per-concept folders, e.g. C:\AnimaTrain.
    • folder_filter - a comma-separated list of folder names or regexes. Leave it empty for everything; use it to train only rebecca_girl,lucy_girl out of a big root.
    • include_root_images - if true, images sitting directly in dataset_root (not in a subfolder) become their own task, named after the root. Usually false.
    • max_images_per_folder - cap how many images a task uses (0 = unlimited).

    The two outputs are TASK_LIST and scan_log. Wire TASK_LIST forward to the captioning and training nodes; the log is a text dump of what was found (Found 2 task folder(s)...), handy for checking that you didn't point at the wrong root.

    Installing it

    This node ships in the AnimaForge Windows pack, so install the pack: in ComfyUI Manager search "ComfyUI-AnimaForge-Windows", or clone it directly:

    cd C:\ComfyUI\custom_nodes
    git clone https://github.com/AI-KSK/ComfyUI-AnimaForge-Windows.git
    cd ComfyUI-AnimaForge-Windows
    powershell -ExecutionPolicy Bypass -File .\scripts\install_windows.ps1
    

    The full training side also needs setup_sd_scripts_backend.ps1 (or install_windows.ps1 -SetupBackend), which clones kohya's sd-scripts into backend\sd-scripts and builds a separate Python venv with CUDA PyTorch - that part is multi-gigabyte and slow the first time. Restart ComfyUI after.

    Common issues

    The classic beginner trip-up is pointing dataset_root at the wrong level: set it to the folder that contains your per-concept folders, not the per-concept folder itself, or you'll get one task whose trigger is the wrong name. A folder with no images is silently skipped and shows up as SKIP: no images found in the log. And if scan_log ends in ERROR: no valid LoRA task folders were found, check the path exists - the node returns that error rather than crashing, which is friendlier than it looks. The community consensus on Anima is that a small, clean, well-cropped set beats a huge sloppy one (the KB's ~1800-step budget for Anima LoRAs assumes it), so use max_images_per_folder if a concept folder went overboard.

    CategoryAnima/Batch LoRA

    Inputs (5)

    NameTypeDefaultDescription
    dataset_rootSTRING
    image_extensionsSTRING.png,.jpg,.jpeg,.webp,.bmp
    folder_filterSTRING
    include_root_imagesBOOLEANfalse
    max_images_per_folderINT00–100000

    Outputs (2)

    NameTypeDescription
    TASK_LISTTASK_LIST
    scan_logSTRING