Nodes/KJNodes for ComfyUI/ImageBatchTestPattern
ComfyUI Node Runs on cloud

ImageBatchTestPattern

Number your frames so you can actually verify your batch logic

By kijai·Created 3 years ago·Updated about 15 hours ago· 2,930
ImageBatchTestPattern
    • image
    batch_size1
    start_from0
    text_x256
    text_y256
    width512
    height512
    font
    font_size255

    When you're building or debugging anything that reorders, splits, merges, or interleaves an image batch - a custom batching node, a frame-selection step, an odd video-encoding pipeline - real content actively gets in the way. You can't tell at a glance whether frame 7 and frame 12 got swapped when they're both just plausible-looking generated images. ImageBatchTestPattern solves that by generating a batch where every frame is unmistakably labeled with its own index number, so any reordering, duplication, or drop is obvious the instant you look at the output.

    It's a debugging tool, not a creative one - you're not meant to ship this into a final render, you're meant to run your suspect pipeline on it once, glance at the numbers, and confirm your batch logic actually does what you think it does.

    How it works

    It generates batch_size blank frames, each width × height, and renders a number onto each one starting from start_from and incrementing by one per frame - frame 0 in the batch shows start_from, frame 1 shows start_from + 1, and so on. That gives you a synthetic batch where the content itself tells you the correct order.

    The inputs and outputs that matter

    • batch_size (default 1, up to 4096) - how many numbered frames to generate.
    • start_from (default 0) - the number the first frame is labeled with, useful if you're testing a mid-pipeline slice rather than a batch that should start at zero.
    • text_x / text_y (both default 256) - where on the canvas the number gets drawn.
    • width / height (both default 512) - canvas size for each generated frame.
    • font and font_size (default 255) - font choice and size for the number; the default size is deliberately huge, since the point is to read it at a glance, not to look tidy.

    Output is a single image batch of numbered frames - feed it straight into whatever node you're testing in place of your real content.

    How to install it

    Via ComfyUI Manager: search "KJNodes for ComfyUI," install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kijai/ComfyUI-KJNodes
    pip install -r ComfyUI-KJNodes/requirements.txt
    

    then restart. No extra dependencies - text rendering and blank canvas generation, nothing heavier.

    Common issues & troubleshooting

    The numbers are cut off or overlapping the edge. font_size defaults large (255) relative to a 512px canvas - if you're using a smaller width/height, drop font_size and adjust text_x/text_y so the number actually fits inside the frame.

    You expected this to test something visually complex. It won't - the whole point is a minimal, unambiguous signal. If you need to test how your pipeline handles actual image content (color shifts, resizing artifacts), this isn't the right node; use it specifically for ordering and batch-integrity checks.

    Numbers are hard to read at a glance in a busy comparison grid. Increase font_size further or simplify the font choice - this node is meant to be skimmed fast, so err on the side of oversized, blunt labeling rather than subtlety.

    CategoryKJNodes/text

    Inputs (8)

    NameTypeDefaultDescription
    batch_sizeINT11–4096
    start_fromINT00–4096
    text_xINT2560–4096
    text_yINT2560–4096
    widthINT51216–4096
    heightINT51216–4096
    fontCOMBO3 options: FreeMono.ttf, FreeMonoBoldOblique.otf, TTNorms-Black.otf
    font_sizeINT2558–4096

    Outputs (1)

    NameTypeDescription
    imageIMAGE