Nodes/ComfyUI_RaykoStudio/๐ŸฆŠ RS Load Image
ComfyUI Node

๐ŸฆŠ RS Load Image

Load Image, but with a proper lasso tool instead of a brush

By RaykosanยทCreated about a year agoยทUpdated 5 days agoยท 79
๐ŸฆŠ RS Load Image
    • image
    • mask
    โ—„imageโ–บ
    โ—„coordinates[]โ–บ

    ComfyUI's native Load Image has a mask editor, but it's a freehand brush - and freehand masking around a crisp object is how you get jagged, leaky edges that bleed into your inpaint. ๐ŸฆŠ RS Load Image (RaykoSplineMask) replaces that editor with a spline-based lasso: click points around the object, the node fits a smooth curve through them, and you get a much cleaner selection. The README's description is exactly right - it's the Lasso tool from Photoshop, inside ComfyUI.

    How it works

    Where the native Load Image hands you a paintbrush, this gives you a polygon editor. Click on the image preview to drop points; the mask is built from the spline that runs through them. Ctrl+click a point to delete it, or hit ๐Ÿ”ด CLEAR POINTS to wipe the whole selection and start over. You can scale the node bigger on the canvas to place points more precisely. Images come from two buttons: "๐ŸŽจ IMAGE" (files in your ComfyUI/input folder) and "๐Ÿ–ผ๏ธ UPLOAD IMAGE" (anywhere on your PC).

    Under the hood it's a Load Image: the IMAGE output returns the original image untouched, and the MASK output is a black-and-white tensor where white is your drawn polygon. It's ready to use the moment you add it - no queue needed for the drawing itself.

    Inputs and output

    • image - a STRING widget that names the file (the loaders in this pack use the standard ComfyUI input-folder dropdown).
    • coordinates (optional) - serialized polygon state, so the mask you draw survives workflow save/load.

    Outputs: image (the loaded image) and mask (your spline selection as a MASK).

    How to install

    Part of ComfyUI_RaykoStudio:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Raykosan/ComfyUI_RaykoStudio.git
    

    Restart ComfyUI, or install via ComfyUI Manager (search "ComfyUI_RaykoStudio"). No extra dependencies.

    Common issues

    • Mask edges are smooth but the wrong shape. Splines are smooth by design - if the object has hard corners, drop extra points near them so the curve follows. That's the same tradeoff you'd hit in Photoshop.
    • Point won't delete. Ctrl+click is the gesture; a plain click adds a new point.
    • Which node do I want, this or the Intermediate one? This one loads the image and you mask up front, before the pipeline runs. RaykoIntermediateSplineMask pauses mid-pipeline so you can mask an upstream result. Different jobs, same spline editor.

    The honest verdict: this is a strictly better Load Image for anyone doing mask work - the native editor's brush is fine for soft, fuzzy regions, but the spline wins for hard-edged selections (faces, products, cars). If you're already comfortable with the native brush, you might not switch. If you've ever sworn at a jagged mask edge, you'll get why this exists.

    Category๐ŸฆŠ RaykoStudio

    Inputs (2)

    NameTypeDefaultDescription
    imageSTRINGโ€”
    coordinatesoptSTRING[]โ€”

    Outputs (2)

    NameTypeDescription
    imageIMAGEโ€”
    maskMASKโ€”