Nodes/Illustrious LoRA Tools/Illustrious Dataset Prepare (Folder / ZIP)
ComfyUI Node

Illustrious Dataset Prepare (Folder / ZIP)

Turn a folder or ZIP into a dataset the trainer will actually eat

By katorikonoe-ai·Created 17 days ago·Updated 3 days ago· 0
Illustrious Dataset Prepare (Folder / ZIP)
    • dataset
    • report
    sourcedataset.zip
    run_labeldataset
    max_images1000

    Every trainer needs the same boring thing before it can do anything clever: a list of images it trusts. IllustriousDatasetPrepare is where the Illustrious LoRA Tools pack makes that list. Point it at a folder or a ZIP sitting under ComfyUI/input, queue once, and you get a "prepared run" - a private copy of your images plus a manifest that every other node in the pack reads instead of your original files.

    That copy is the whole point. Nothing downstream ever touches your source images, so a bad crop or a re-tag is never destructive - you just queue again and get another run. It also means a stale run can't sneak into a later step, because the run is referenced by name, not by "whatever is in that folder now."

    What it actually does with your images

    The node resolves source relative to ComfyUI/input and accepts either a directory (walked recursively, sorted, up to 10,000 entries) or a .zip. Every candidate image is opened and verified as a real PNG, JPEG or WEBP - the file extension alone isn't trusted - then re-written into a fresh run directory as 000000.png, 000001.jpg, and so on. Sidecar captions come along: a foo.txt next to foo.png is copied to 000000.txt, decoded as UTF-8 with BOM tolerance. A dataset.json manifest is written at the end listing each file, its source name and its real pixel dimensions; that manifest is what the rest of the pack thinks your dataset is.

    Pulled from the shipped source, the hard limits are: 64 MiB per image, 32 million pixels per image, 1 GiB uncompressed per ZIP, and 1000 images total. It errors rather than truncating - if you hand it 1,200 images you get Found 1200 images; limit is 1000. Nothing is silently truncated. That's the right call. A trainer that quietly drops 200 images while pretending it trained on all of them is worse than one that refuses.

    The ZIP handling is where you'll notice the pack is written defensively: absolute paths, .., backslashes, symlinks, encrypted entries and case-insensitive duplicate names are all rejected outright. Normal archives you get from a friend are fine. Weird archives re-zipped on a phone sometimes aren't, and the error tells you which rule tripped.

    The three inputs, and the two outputs

    source is the only one you'll think about - the relative path under ComfyUI/input, e.g. my_char/ or dataset.zip. Keep the trailing slash off; a bare name works either way since the node checks for a directory first.

    run_label names the run folder. It has to be 1–64 ASCII characters from letters, digits, _ and -, and the real directory gets a unique suffix appended, so dataset becomes something like dataset_9f3c1ab4.... You'll be pasting that full name into other nodes later, which is why the second output matters.

    max_images caps how many images make it in. Default 1000, which is also the maximum - the pack has no interest in multi-thousand-image runs.

    Output dataset is the handle you wire into tagging, cropping, auditing, and finally the trainer. Output report is JSON, printed in the node's text box: status, per-image file names, dimensions, and whether any captions came across. Read it. It's the cheapest way to notice you accidentally prepared 1000 frames of a video instead of 60 stills.

    Install

    Install through ComfyUI Manager by searching the pack title (ComfyUI-IllustriousLoRATools, displayed as Illustrious LoRA Tools), or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/katorikonoe-ai/ComfyUI-IllustriousLoRATools
    pip install -r ComfyUI-IllustriousLoRATools/requirements.txt
    

    Install those requirements with the same Python that runs ComfyUI, and don't let pip swap your CUDA PyTorch build out - the pin list is numpy, Pillow, onnxruntime, huggingface-hub, safetensors, diffusers, transformers, peft, accelerate, bitsandbytes. It's heavy, but it's the whole pack, not this node. This particular node only needs Pillow. Keep native/, web/ and crop_routes.py together - the pack's own README calls that out, and dropping files in by hand is how people end up with nodes that register but do nothing. Restart after.

    Where people get burned

    The source has to live under ComfyUI/input. Absolute paths are refused by design (Use a relative path under the configured root), and Windows-style backslashes are refused too, so convert \ to /.

    Two images sharing a stem is a hard error: foo.jpg and foo.png in one folder means one caption file would have to describe both, so the node makes you rename. Same for ZIPs with case-duplicate names.

    And the disk thing - every queue produces a new run, and runs are never cleaned up. Ten experiments is ten full copies of your dataset under ComfyUI/output/illustrious_native/. Prune them when you're done with them.

    CategoryKatori/Illustrious Native Training

    Inputs (3)

    NameTypeDefaultDescription
    sourceSTRINGdataset.zip
    run_labelSTRINGdataset
    max_imagesINT10001–1000

    Outputs (2)

    NameTypeDescription
    datasetILLUSTRIOUS_DATASET
    reportSTRING