Nodes/ComfyUI_Burve_Tools/Burve Crop + Mask Load
ComfyUI Node

Burve Crop + Mask Load

Crop, paint a soft mask, and generate at the right aspect ratio — all in the loader

By Burve·Created 9 months ago·Updated 5 days ago· 5
Burve Crop + Mask Load
    • image
    • cut_image
    • image_mask
    • aspect_ratio
    • crop_region_pipe
    image
    aspect_ratio1:1
    editor_state_json

    Burve Crop + Mask Load is the front half of the pack's crop-and-mask edit loop, and it's the half you'll actually spend your time in. It loads an image from your ComfyUI input folder, then gives you a built-in editor: pick a fixed aspect ratio, drag the crop frame around, and paint a soft mask with brush, erase, bucket, and whole-crop fill tools. Everything you mark, and only that, is what gets replaced later.

    The workflow it's built for: you crop a region at an aspect ratio the Gemini image nodes actually accept, paint what should be regenerated, hand the ratio to the generator so it produces a matching replacement, then Burve Crop + Mask Apply pastes the result back through your mask. Compared to the classic mask-inpaint loop, the interesting twist is that the ratio and crop are first-class outputs instead of being implicit - the whole point is keeping the generated replacement compatible with the region you carved out.

    What it outputs

    • image - the original source as a standard IMAGE.
    • cut_image - just the cropped region. Preview this to see exactly what the generator will be asked to replace.
    • image_mask - a full-size soft MASK matching the original dimensions. 1.0 means painted/masked, 0.0 means clear.
    • aspect_ratio - the selected ratio string, designed to be plugged into aspect_ratio_override on the Burve Gemini generation nodes.
    • crop_region_pipe - the bundle of source size, ratio, and pixel crop rectangle that the Apply node consumes.

    The aspect ratio list is the same "Burve image-gen-safe" set as the generator: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.

    How the editor behaves

    This is where the node earns its keep. In the node's custom UI you get a List/Grid toggle for the image picker, crop mode with drag-to-move and corner handles that preserve the ratio, and paint/erase modes whose soft strokes are clipped to the crop area only. The bucket tool fills the connected unmasked area under your cursor, and it respects mask boundaries - four-connected filling won't cross diagonal walls. Drag and drop an image file anywhere in the editor to upload it straight into the input folder; Upload and Refresh do the same through a file picker. Mouse wheel zooms around the cursor, space-drag pans, Fit resets the viewport, Mask Check shows mask strength as grayscale without changing anything.

    The hidden editor_state_json widget is what persists all of that - crop box, viewport, brush settings, strokes, fills, bucket runs - so a saved workflow comes back exactly as you left it. The native image widget still stores the selected file too, which is why older workflows keep working. One honest limitation: this first release is loader-only. There's no upstream IMAGE input; you pick from the input folder or upload, not from another node.

    Install

    ComfyUI Manager, search ComfyUI_Burve_Tools (or "Burve"), install, restart. Or:

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

    No model downloads, no API key needed for this node (save the key for the Gemini generation side). You need ComfyUI 0.4.0+.

    Gotchas

    • Changing the selected image resets the editor state when the source file or its dimensions change. Pick your image first, then do the crop and mask work.
    • If you don't see the editor, only the plain widgets - the custom UI lives in the pack's web/js folder. Restart ComfyUI after install and hard-refresh the browser tab; a stale frontend is the usual culprit.
    • Keep the ratio fixed once you've generated, or the crop region won't line up on the Apply side.

    It's a small pack and you won't find a pile of community reviews, but the editor is genuinely well-built for what it does - the bucket, the ratio-locked crop, and the soft mask are the three things that make this loop tolerable.

    CategoryBurveTools/Image

    Inputs (3)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    aspect_ratioCOMBO1:110 options: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, +4
    editor_state_jsonoptSTRINGInternal editor state used by the custom crop/mask UI.

    Outputs (5)

    NameTypeDescription
    imageIMAGE
    cut_imageIMAGE
    image_maskMASK
    aspect_ratioSTRING
    crop_region_pipeCROP_REGION_PIPE