Nodes/ComfyUI_Lam/创建空图片
ComfyUI Node

创建空图片

A solid-color image generator — the humble node every canvas starts with

By yanlang0123·Created 2 years ago·Updated 11 days ago· 77
创建空图片
    • IMAGE
    count1
    width512
    height512
    red255
    green255
    blue255

    ImageBlank (创建空图片, "create a blank image") makes solid-color images. You pick the size, the count, and the color, and out comes a tensor full of blank frames. It's the most boring node in the pack and also one of the more useful ones, because half of ComfyUI work is creating canvas before you do anything interesting to it.

    Think of the cases: an empty latent-sized canvas to composite onto, a neutral background to paste a subject into, a batch of blank frames to fill in a video pipeline, or a placeholder image so a graph that needs IMAGE at every input doesn't choke on an empty one. Every serious node collection has a blank-canvas node; this is ComfyUI_Lam's, and it gets the batch case right.

    How it works

    Nothing magical - it allocates RGB images of the given size and fills them with the color you specify. Two details are worth remembering:

    • Sizes snap to multiples of 8. You ask for 500x500 and it quietly gives you 496x496 (or similar). This is deliberate - downstream sampling nodes want dimensions that divide cleanly - but it means the node doesn't return exactly what you typed. If exact pixels matter, feed it values that are already multiples of 8 and it'll leave them alone.
    • count makes a batch. Ask for 8 and you get one tensor of 8 identical frames, which is the batch-friendly behavior that fits the rest of this pack.

    The inputs

    • count (INT, default 1) - how many identical frames. This is the "make a batch" knob.
    • width / height (INT, default 512 each, 8–4096) - canvas size.
    • red / green / blue (INT, 0–255) - the fill color. Default is all 255, i.e. white.

    Output: IMAGE - the batch of blank frames.

    Install

    The usual pack install, and this node is dependency-free on top of it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yanlang0123/ComfyUI_Lam
    

    and restart. No models, no patch, no Baidu Pan. If you installed the whole pack already, it's just there.

    Common issues

    • My size came back wrong - the multiple-of-8 rounding. Pick 8-aligned dimensions if it matters.
    • It's white but I asked for black - check the RGB inputs, not the preview; default is white (255, 255, 255).
    • Compositing looks like a white box - you're pasting onto a fully-opaque blank. If you want transparency, you'll want a blank with an alpha channel, which this node doesn't produce - feed its output through the pack's ImageAddMask or a core alpha node instead.

    Three numbers and a color. It won't impress anyone, but it's the node that makes "start from a canvas" graphs work in one place instead of a workaround.

    Categorylam

    Inputs (6)

    NameTypeDefaultDescription
    countINT11–99999
    widthINT5128–4096
    heightINT5128–4096
    redINT2550–255
    greenINT2550–255
    blueINT2550–255

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE