Nodes/ComfyUI_Fill-Nodes/FL Image Caption Layout
ComfyUI Node

FL Image Caption Layout

Build a contact sheet of images and their captions

By filliptm·Created 3 years ago·Updated about 7 hours ago· 628
FL Image Caption Layout
    • IMAGE
    image_directory
    images_per_row3
    image_size256
    caption_height64
    font_size12
    padding10

    If you've captioned a training dataset - whether by hand or with one of Fill-Nodes' own captioning nodes - the fastest way to sanity-check a hundred caption files is not opening them one at a time. FL_ImageCaptionLayout builds a single contact-sheet image: a grid of your dataset's images, each with its caption text printed underneath, so you can eyeball a whole dataset's worth of captions in one view.

    How it works

    Point it at a directory of images with matching caption text files (the standard image.png / image.txt pairing that most captioning and training tools expect), and it lays them out in a grid - so many per row, each cell sized consistently, with a text box under each thumbnail holding that image's caption. The whole thing renders down to one composite image.

    The inputs and outputs that matter

    All required, and all straightforward layout controls:

    • image_directory - the folder of images + caption .txt files.
    • images_per_row (1–10, default 3) - grid width.
    • image_size (64–1024, default 256) - thumbnail size per cell.
    • caption_height (32–256, default 64) - how tall the caption text box under each thumbnail is.
    • font_size (8–32, default 12) and padding (0–100, default 10) - text and spacing tuning.

    Output: a single IMAGE - the contact sheet. This node is also an output node, meaning it's meant to be a terminal step you view directly rather than something you necessarily chain further.

    How to install it

    Ships in ComfyUI_Fill-Nodes. ComfyUI Manager: search ComfyUI_Fill-Nodes, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
    

    then restart. PIL-based image and text compositing - no model download.

    Common issues & troubleshooting

    No caption file for an image usually means an empty or missing caption cell, not an error. If your captioning pass skipped some images (a common gap after a batch-caption run got interrupted), those thumbnails will show up with blank or missing caption text rather than the node refusing to run. Worth a scan of the contact sheet specifically to catch that - it's the whole point of the node.

    Large datasets make a very large output image. With hundreds of images at images_per_row=3, you get a tall composite - that's expected, but it can be slow to render and heavy to preview. For a first pass, point image_directory at a subset, or accept that you may need to scroll/zoom the resulting image rather than expecting it to fit on screen at once.

    Text gets cut off in the caption box. If your captions run long relative to caption_height and font_size, text can overflow or get clipped at the box edge - this node doesn't auto-wrap or auto-shrink text to fit. Increasing caption_height or dropping font_size a couple of points fixes truncated captions; there's no dynamic sizing to lean on instead.

    Pairs naturally with FL_HF_Character. If you're publishing a character's training assets to Hugging Face, FL_HF_Character accepts a caption_layout IMAGE input specifically - running this node first and feeding its output there gives anyone browsing the repo an at-a-glance view of the dataset without downloading every file.

    Category🏵️Fill Nodes/Captioning

    Inputs (6)

    NameTypeDefaultDescription
    image_directorySTRING
    images_per_rowINT31–10
    image_sizeINT25664–1024
    caption_heightINT6432–256
    font_sizeINT128–32
    paddingINT100–100

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE