Nodes/MTB Nodes/Batch Shape (mtb)
ComfyUI Node Runs on cloud

Batch Shape (mtb)

Procedurally generate a batch of simple 2D shapes

By melMass·Created 3 years ago·Updated about a month ago· 721
Batch Shape (mtb)
  • color
  • bg_color
  • shade_color
  • IMAGE
count1
shapeCircle
image_width512
image_height512
shape_size100
thickness5
shadex0.00
shadey0.00

Sometimes you don't need a diffusion model at all - you just need a circle, a box, or a tube rendered cleanly to a fixed size, and you need a batch of them. Batch Shape is MTB Nodes' procedural shape generator: no sampling, no checkpoint, just geometry drawn directly to a tensor. The pack itself flags the shading option as experimental, so treat the fancier end of this node as a bonus, not the reliable core.

What it's actually good for

Test patterns for a pipeline you're debugging (a known, simple shape is easier to eyeball-check after a crop, resize, or color operation than a photo is). Placeholder or mask geometry - a circle or box mask is a two-second job here instead of a manual paint. Motion-graphics elements for compositing - a batch of shrinking circles, say, layered under generated content. And because it outputs a count-sized batch rather than a single image, it's a fast way to build test batches of a known, controlled size for exercising other batch nodes in this pack.

The inputs and output that matter

  • shape - Box, Circle, Diamond, or Tube.
  • count - how many frames in the output batch (all identical unless you're driving other parameters per-frame from outside this node, since none of its numeric fields accept a FLOATS list directly).
  • image_width / image_height (default 512 each) and shape_size (default 100) - canvas size and the shape's own size within it.
  • color, bg_color, shade_color - hex-coded color pickers (default white shape on black background) for the shape fill, the canvas background, and the shading tint.
  • thickness - outline/stroke thickness.
  • shadex / shadey - shading offset on each axis; this is the part the pack marks experimental, so don't be surprised if it behaves a little rough around the edges.

Output is a single IMAGE batch.

Installing it

ComfyUI Manager: search MTB Nodes, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb

then restart ComfyUI. No models - this is drawn geometry, computed locally with no downloads.

Common issues

If you're building a mask rather than decoration, keep bg_color and color at pure black and pure white (the defaults) and skip the shading entirely - shading only matters for a visual/compositing use, and it complicates a clean binary mask if you're piping the output into something that expects one.

For anything odder - a shape that renders but looks wrong, or shadex/shadey producing an unexpected result - remember the pack itself calls that part experimental, so it's worth trying a simpler config before assuming your graph is misconfigured.

And the standing pack-wide note: MTB logs [comfy_mtb] Some nodes (N) could not be loaded at startup rather than failing outright, pointing you at http://127.0.0.1:8188/mtb for the real reason - a behavior other users have hit and confirmed. If Batch Shape isn't in your node list after installing, check that line first.

Categorymtb/batch

Inputs (11)

NameTypeDefaultDescription
countINT1
shapeCOMBOCircle4 options: Box, Circle, Diamond, Tube
image_widthINT512
image_heightINT512
shape_sizeINT100
colorCOLOR#ffffff
bg_colorCOLOR#000000
shade_colorCOLOR#000000
thicknessINT5
shadexFLOAT0.00
shadeyFLOAT0.00

Outputs (1)

NameTypeDescription
IMAGEIMAGE