Nodes/HiDream_O1-ComfyUI/HiDream O1 Dataset Maker
ComfyUI Node

HiDream O1 Dataset Maker

Turn a folder of images into the training manifest in one click

By Saganaki22·Created 4 months ago·Updated 3 months ago· 70
HiDream O1 Dataset Maker
    • dataset_path
    image_directory
    output_filenametrain.jsonl

    Before the trainer can learn anything, it needs to know which image goes with which caption. That's the entire job of HiDream O1 Dataset Maker: you point it at a folder, it scans for images, pairs each with a same-named .txt caption, and writes a train.jsonl manifest that the HiDream O1 LoRA Trainer eats. It's the most boring node in this pack, and it's the one that decides whether your LoRA turns out recognizable or mush.

    What it does

    Two inputs, one output:

    • image_directory - the folder with your images and captions.
    • output_filename - default train.jsonl, written inside that folder.
    • output dataset_path - the full path to the manifest, ready to wire into the trainer.

    Mechanically it's simple: it lists jpg/jpeg/png files, looks for a .txt with the exact same basename next to each, and writes one JSON line per valid pair:

    {"image": "/abs/path/to/image_001.png", "caption": "photo of mytrigger person, ..."}
    

    Images without a matching caption are skipped. If nothing matches, it raises a clear error instead of writing an empty manifest - that error is the feature.

    The folder layout it expects

    my_dataset/
      image_001.png
      image_001.txt
      image_002.jpg
      image_002.txt
    

    Caption files are just plain text. Keep captions consistent and direct - for a person LoRA, the pack's training notes recommend a unique trigger token, placed early in every caption, with the same token in all of them:

    photo of m0n0y0 person, close-up portrait, curly black hair, city street background
    photo of m0n0y0 person, upper body portrait, neutral expression, natural light
    

    Avoid over-describing saturation, contrast, or heavy grading if you want identity rather than baked-in style - the caption problem, not the node, is where most training runs go wrong.

    Wiring it

    HiDream O1 Dataset Maker → HiDream O1 Train Config → HiDream O1 LoRA Trainer
    

    The dataset_path output is a string, so it also wires straight into the trainer's dataset_path input without the Train Config in between - but the config node is what sets learning rate, rank, and the rest, so you'll want it in the graph anyway.

    Where people get burned

    • Wrong image types. Only .jpg, .jpeg, .png count. GIFs, WebPs, and whatever else your folder accumulated get silently ignored.
    • Caption file names. image_001.txt matches image_001.png; image_001 (1).txt doesn't. If you've got junk in the folder, you'll get a manifest with fewer rows than you expected - check the count.
    • Relative vs absolute paths. The manifest writes absolute resolved paths, which is exactly what you want for training. If you move the folder after generating the manifest, regenerate it.
    • Not captioning at all. The node skips uncaptioned images rather than failing, so a "successful" run can quietly drop half your dataset. Don't treat zero errors as "it worked" - treat it as "every image you wanted is actually in the manifest."

    One workflow trick: run this node once, read the dataset_path output, and if it's shorter than you expected, the folder layout is the culprit. The fix is almost always a renamed caption file, not a settings change.

    CategoryHiDream O1/training

    Inputs (2)

    NameTypeDefaultDescription
    image_directorySTRINGFolder containing image files and matching .txt captions.
    output_filenameSTRINGtrain.jsonlDataset manifest filename to write inside the image folder.

    Outputs (1)

    NameTypeDescription
    dataset_pathSTRING