Nodes/ComfyUI-LoraBlockWeight/LoRA Block Weight Save Grid
ComfyUI Node

LoRA Block Weight Save Grid

Turn a wall of sweep images into a labeled grid you can actually read

By Baldwinzc·Created 4 months ago·Updated 3 months ago· 24
LoRA Block Weight Save Grid
  • images
    blocks
    values0,0.5,1.0
    filename_prefixlbw_grid
    label_size36
    pad16
    compress_level4

    If you've run a block-weight sweep, you've stared at the output: dozens or hundreds of images dumped out of a Batch node with no way to tell which is which. LoRA Block Weight Save Grid is the terminal node that fixes it. It takes the batched IMAGE from any sweep node in this pack, arranges the cells into a grid, and writes a labeled PNG - block tags down the Y axis, weight values across the X axis - so you can actually see the pattern at a glance instead of squinting at filenames.

    It's model-agnostic, which is the point. It doesn't know or care whether your cells came from FLUX, Qwen-Image, or SD3.5; you tell it the labels and it trusts you.

    How it works

    The IMAGE batch is interpreted row-major: outer loop = blocks (rows), inner loop = values (columns). That matches the Batch and Group sweep nodes' iteration order exactly, which is the single most important thing to get right. The inputs:

    • images - the batched IMAGE from a sweep node.
    • blocks - block tags in row order, comma-separated. Must match the sweep order.
    • values - the strengths in column order, comma-separated.
    • filename_prefix - output name prefix, default lbw_grid.
    • label_size (8–256, default 36) and pad (0–256, default 16) - the label font and padding. Bump label_size if you're rendering a wide grid and the tags get cramped.
    • compress_level (0–9, default 4) - PNG deflate level. PNG is always lossless; this only trades encode speed against file size.

    There are no outputs and the node is an output node, so it runs last and writes to your ComfyUI output/ directory.

    The wiring trick that saves you

    The Batch node outputs blocks_used and values_used - the exact strings it actually swept. Wire those two STRING outputs straight into Save Grid's blocks and values inputs. You never hand-type the labels, and they can never drift out of sync with the images. Do this and the grid always labels itself correctly, even when you trim the block list mid-experiment.

    Common issues

    "Images batch size doesn't match rows × cols." This is the node's loud error when the count is off - you either trimmed block_list after the sweep but left the old labels in, or you're feeding it from a Group node where "blocks" means groups. Count the images, fix the labels, rerun the grid; the images are cached, so it's cheap.

    Labels don't match what you think you ran. You typed D00,D01,... in the wrong order, or you fed it labels from a different sweep run. This is why the blocks_used wiring trick above exists.

    Everything else - font size, padding, compression - is cosmetic. Set compress_level to 9 if you want the smallest file, 0 if you're impatient; quality is identical either way.

    Install

    Via ComfyUI Manager, search "LoraBlockWeight", or:

    cd <ComfyUI>/custom_nodes
    git clone https://github.com/Baldwinzc/ComfyUI-LoraBlockWeight.git
    

    Restart ComfyUI. No extra dependencies beyond what ComfyUI ships.

    One nice property worth knowing: like every ComfyUI PNG saver, the grid file carries the workflow embedded in its metadata - drag the grid PNG back onto the canvas and the whole sweep graph reconstructs. That makes the grid file itself a shareable, reproducible artifact of the experiment.

    CategoryLoraBlockWeight

    Inputs (7)

    NameTypeDefaultDescription
    imagesIMAGE
    blocksSTRINGBlock tags in row order, must match the order used in the sweep.
    valuesSTRING0,0.5,1.0Values in column order, must match the order used in the sweep.
    filename_prefixSTRINGlbw_grid
    label_sizeINT368–256
    padINT160–256
    compress_levelINT40–9PNG deflate level. PNG is always lossless; 0 = no compression (fastest, biggest file), 9 = max.

    Outputs (0)

    No outputs