Nodes/Comfyroll Studio/πŸ”΅ CR Random Shape Pattern
ComfyUI Node Runs on cloud

πŸ”΅ CR Random Shape Pattern

Build a randomized two-color shape grid

By Suzie1Β·Created 3 years agoΒ·Updated 2 years agoΒ· 1,287
πŸ”΅ CR Random Shape Pattern
    • IMAGE
    • show_help
    β—„width512β–Ί
    β—„height512β–Ί
    β—„num_rows5β–Ί
    β—„num_cols5β–Ί
    β—„color1β–Ύβ–Ί
    β—„color2β–Ύβ–Ί
    β—„color1_hex#000000β–Ί
    β—„color2_hex#000000β–Ί

    CR Random Shape Pattern lays out a grid of shapes in two colors and randomizes them, giving you a patterned image without touching a model. Think decorative backdrop, a busy texture to composite behind text, or a base layer you feed into a generation to steer its structure. You set the grid dimensions and the two colors; the node scatters the pattern across the canvas.

    It sits in the same family as Comfyroll's other pattern generators (starburst, binary, checker, polygons) - cheap procedural graphics you build in-graph instead of importing.

    How it works

    It's PIL drawing a num_rows x num_cols grid of shapes onto a canvas of the size you set, colored from your two-color choice and randomized in arrangement. There's no seed input exposed here, so treat the randomness as "give me a pattern" rather than "give me this exact pattern every time" - re-queue for a different arrangement.

    The output is a flat graphic, which means you can use it three ways: straight as a decorative image, as a background you composite text or a subject onto (pair it with CR Overlay Transparent Image), or as a loose structural input to a generation. It costs nothing to produce, so it's cheap to iterate - queue a few times, keep the arrangement you like.

    The inputs that matter

    • width / height (INT, default 512) - canvas size.
    • num_rows / num_cols (INT, default 5, up to 128) - the grid density. Small numbers give big bold cells; large numbers give fine texture.
    • color1 / color2 - the two named-color dropdowns (30 options each including custom). Set a dropdown to custom to use the matching color1_hex / color2_hex field.

    Output is a single IMAGE (plus the show_help string, ignore it).

    Installing it

    Part of Comfyroll Studio (Suzie1 / RockOfFire), a large, long-running utility pack. Install via ComfyUI Manager (search "Comfyroll Studio," install, restart), or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git
    

    then restart. No models, no dependencies.

    Common issues

    Same color gotcha as the rest of the pack: the *_hex fields do nothing unless the corresponding color1/color2 dropdown is switched to custom. If your custom colors aren't appearing, that dropdown is still on a named color.

    Because there's no seed, you can't reproduce a specific arrangement - if you land on one you like, save the image, because re-running may reshuffle it. And if you're piping this into a generation as structural guidance, keep expectations grounded: it's a decorative pattern, so it'll influence composition loosely, not act like a precise control map. If Comfyroll fails to load on startup with a NameError traceback about Graphics nodes, that's a broken install - reinstall cleanly through Manager and restart.

    Category🧩 Comfyroll Studio/πŸ‘Ύ Graphics/🟣 Shape

    Inputs (8)

    NameTypeDefaultDescription
    widthINT51264–4096β€”
    heightINT51264–4096β€”
    num_rowsINT51–128β€”
    num_colsINT51–128β€”
    color1COMBO30 options: custom, white, black, red, green, blue, +24
    color2COMBO30 options: custom, white, black, red, green, blue, +24
    color1_hexoptSTRING#000000β€”
    color2_hexoptSTRING#000000β€”

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGEβ€”
    show_helpSTRINGβ€”