ComfyUI Node

ImageCropCircle

The zero-config circle crop — just don't expect transparency

By jstit·Created 2 years ago·Updated 2 years ago· 1
ImageCropCircle
  • image
  • IMAGE

Need a circular version of an image - an avatar, a profile pic, a badge, a disc-style icon - and don't want to leave ComfyUI or hand-paint a mask? ImageCropCircle from jstit's comfyui_custom_node_image pack does exactly one thing: it turns any image into a centered circle crop. That's the whole feature list. No settings, no radius slider, no feather. One input, one output, done. If that's all you need, it's arguably the fastest way to a round image in the whole graph.

What it actually does (and the corner it cuts). The node looks at the tensor's width and height, takes the smaller one, center-crops to a square, then builds a circular mask and multiplies the image by it. Internally it's a classic distance check - a binary 0/1 mask where the distance from the center is within the radius, broadcast across the RGB channels. So the output is a square image with a circle inscribed in it and the corners zeroed out. Zeroed out means black, not transparent.

That's the trap, and it's the thing worth knowing before you wire this anywhere. ComfyUI's IMAGE tensors are RGB - there's no alpha channel here, and this node doesn't add one. Save the output as a PNG and you get literal black corners. Composite it onto a bright page or a colored background (the whole point of a circular crop, right?) and you'll see them instantly. On a dark UI theme it looks fine; as a sticker on white, it won't. If you genuinely need transparent edges, you're in background-removal territory - the BiRefNet-class cutouts that output real alpha - or you convert this node's dark corners into a MASK and do alpha compositing yourself. Just don't assume round == transparent.

Two more honest quirks from the source: the mask is a hard 0/1 boundary with no anti-aliasing, so the circle edge is a little jagged - invisible at avatar sizes, noticeable if you blow it up. And the circle is always centered and sized to the smaller dimension; there's no offset, no radius, no way to choose which part of the image survives. If you need control, grab a real image-editing suite instead.

The inputs and outputs, for real. One input, image - any IMAGE tensor, so a Load Image output, a generation, an upscale, whatever. One output, IMAGE, which wires straight into Save Image or anything else downstream that takes an IMAGE. It handles batches fine (the mask gets expanded across the whole batch), so you can run a folder of portraits through it in one go.

Install. The pack is a single node in a one-commit repo with an essentially empty README, so don't expect hand-holding. Easiest is ComfyUI Manager - search "comfyui_custom_node_image" and hit install. If Manager doesn't list it (tiny packs sometimes lag the registry), the manual route is the same as always:

cd ComfyUI/custom_nodes
git clone https://github.com/jstit/comfyui_custom_node_image

Then restart ComfyUI. No model downloads, no weights, nothing heavy. One side note: the repo's requirements.txt lists diffusers, tqdm, and boto3, but the node never imports any of them - it only uses numpy and torch, both already in ComfyUI. That's leftover template boilerplate, so install the pack and ignore it.

Bottom line: ImageCropCircle is a one-trick utility, not a toolbox. You reach for it when you want a round image and you want it in two clicks. Just remember the corners are black, not see-through - or you'll spend twenty minutes wondering why your "transparent" avatar has a square shadow.

Categoryimage/crop

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE