Nodes/Allor Plugin/ImageDrawPiesliceByContainer
ComfyUI Node

ImageDrawPiesliceByContainer

A pie slice sized to an existing image

By Nourepide·Created 3 years ago·Updated 2 years ago· 295
ImageDrawPiesliceByContainer
  • container
  • IMAGE
start_x0.00
start_y0.00
end_x1.00
end_y1.00
start0
end240
outline_size1
outline_red0
outline_green0
outline_blue0
outline_alpha1.00
fill_red255
fill_green255
fill_blue255
fill_alpha1.00
SSAA4
method

ImageDrawPiesliceByContainer is the ImageDrawPieslice you don't have to size yourself: hand it an image and it draws the filled wedge at that image's exact dimensions. Same bounding box, same start/end angles, same outline and fill controls, same anti-aliasing - the canvas size just comes from a container instead of width/height boxes.

How it works

It reads the width and height of the first frame of the container input and forwards them into ImageDrawPieslice, which does the drawing: RGBA canvas, PIL ImageDraw.pieslice inside a normalized bounding box, supersample by SSAA, downscale with method. As with all ByContainer draw nodes, the container sets the size only - the wedge is drawn on a fresh transparent canvas and the container's pixels don't appear in the output. Composite the two if you want the slice over the container's content.

Inputs that matter:

  • container - any IMAGE; its size becomes the canvas.
  • start_x / start_y, end_x / end_y - the wedge's bounding box as 0–1 fractions; defaults 0,0 → 1,1 span the whole canvas.
  • start / end - angle range in degrees (0–360), PIL-style (3 o'clock, clockwise). Default 0 → 240 is a three-quarter wedge; set end to 360 for a full disc.
  • outline_size - outline stroke width, default 1.
  • outline_red / green / blue / alpha - outline color, default black.
  • fill_red / green / blue / alpha - fill color, default white.
  • SSAA (default 4) and method (default lanczos).

Why you'd use it

The container-tracking pattern: one container drives the size of both your drawn slices and your compositing, so a progress-ring or chart segment always matches the image it sits under without you rechecking dimensions. Swap the container, everything scales together.

The gotcha

Output is RGBA with a transparent background - the wedge floats on a checkerboard in Preview, which is ideal for compositing but surprising if you expected a backdrop. And the default wedge is 240°; remember to push end to 360 for a complete disc.

Installing Allor

Part of the Allor Plugin (Nourepide/ComfyUI-Allor), ~90 nodes from early 2024:

cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt

Restart, or search "Allor Plugin" in ComfyUI Manager - the more reliable route given the pack's history of manual-install import errors (reinstall via Manager was the repeated community fix). Dependencies are rembg + onnx; drawing needs no models.

Gotchas that apply to the whole pack

The repo was rebased to strip images from history (shrank ~344×), so git pull/auto-update can occasionally break - the README's update-troubleshooting docs cover it; delete-and-reclone is the blunt fix. [Allor] console lines at startup are the pack writing config.json and checking updates, not an error.

Categoryimage/draw

Inputs (18)

NameTypeDefaultDescription
containerIMAGE
start_xFLOAT0.00
start_yFLOAT0.00
end_xFLOAT1.00
end_yFLOAT1.00
startINT0
endINT240
outline_sizeINT1
outline_redINT0
outline_greenINT0
outline_blueINT0
outline_alphaFLOAT1.00
fill_redINT255
fill_greenINT255
fill_blueINT255
fill_alphaFLOAT1.00
SSAAINT41–16
methodCOMBO6 options: lanczos, bicubic, hamming, bilinear, box, nearest

Outputs (1)

NameTypeDescription
IMAGEIMAGE