Nodes/Allor Plugin/ImageDrawChord
ComfyUI Node

ImageDrawChord

Draw a chord — a curved segment with its ends joined

By Nourepide·Created 3 years ago·Updated 2 years ago· 295
ImageDrawChord
    • IMAGE
    width256
    height256
    size1
    start_x0.00
    start_y0.00
    end_x1.00
    end_y1.00
    start0
    end180
    red255
    green255
    blue255
    alpha1.00
    SSAA4
    method

    An arc is an open curve. A chord is that same curve with its two endpoints connected by a straight line - a filled-ish shape with a flat bottom, like a crescent moon or a segment cut out of a pie. ImageDrawChord draws exactly that on a transparent RGBA canvas. If you've ever wanted a moon phase, a bracket, or a "cut slice" shape in ComfyUI without wrestling with masks, this is the node.

    How it works

    Same pipeline as every Allor draw node: RGBA canvas, PIL ImageDraw.chord (arc + straight line between the endpoints), supersample by SSAA, downscale with method, output a single IMAGE tensor. The chord is traced within a bounding box you define with normalized coordinates.

    Inputs that matter:

    • width / height - canvas size, default 256×256.
    • start_x / start_y, end_x / end_y - the bounding box of the chord as 0–1 fractions of the canvas. Defaults 0,0 → 1,1 span the whole canvas.
    • start / end - angle range in degrees (0–360), PIL-style: measured from 3 o'clock, increasing clockwise. Default 0 → 180 draws a half-chord.
    • size - stroke width, default 1. Note there's no fill color - a chord is outline-only, unlike ImageDrawPieslice which fills the wedge.
    • red / green / blue / alpha - stroke color, alpha defaulting to 1 (opaque).
    • SSAA (default 4) and method (default lanczos) - the anti-aliasing quality controls shared across the draw family.

    The gotcha

    The output has a transparent background - every draw node starts from RGBA (0,0,0,0), so the chord floats on a checkerboard in Preview. That's ideal for compositing (it pastes cleanly over anything), but if you want a solid backdrop, composite the result onto an ImageContainer rather than expecting one baked in.

    Why you'd use it

    Geometric UI elements, diagrams, moon/phase graphics, or decorative arcs with a flat base. It's also worth pairing with ImageContainerInheritance* + the ByContainer composite nodes to build layered graphics entirely in the graph.

    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. 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 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 (15)

    NameTypeDefaultDescription
    widthINT256
    heightINT256
    sizeINT1
    start_xFLOAT0.00
    start_yFLOAT0.00
    end_xFLOAT1.00
    end_yFLOAT1.00
    startINT0
    endINT180
    redINT255
    greenINT255
    blueINT255
    alphaFLOAT1.00
    SSAAINT41–16
    methodCOMBO6 options: lanczos, bicubic, hamming, bilinear, box, nearest

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE