Nodes/ComfyUI-WJNodes/crop data edit
ComfyUI Node

crop data edit

Swap in replacement images and control paste-back feathering

By 807502278·Created 2 years ago·Updated 11 months ago· 21
crop data edit
  • crop_data
  • images
  • masks
  • crop_data
  • images
  • masks
edge_blend0.00

crop_data_edit is the mid-pipeline node in ComfyUI-WJNodes' mask-crop family: it takes a crop_data bundle - the coordinates (and source content) of a crop you made earlier - and lets you edit it before it goes on to whatever composites it back into the full frame. The headline use is swapping in different images or masks than the ones the crop was originally made from, and setting how softly the edges blend when the crop eventually gets pasted back.

It sits inside a bigger family of crop_data-based nodes from ComfyUI-WJNodes, a sprawling personal utility pack - the author (807502278) describes it plainly as "a simple node package that I use myself," which is a fair description of a pack that covers crop pipelines, video slicing, color filtering, and file operations all in one repo.

How it works

The node reads in a crop_data bundle and, if you've connected replacement images or masks, substitutes them in place of whatever the crop data was originally carrying. This is the move for a detect-crop-edit-restore loop: crop a region out, run some other process on it externally or through a different branch of your graph, then feed the result back into this node before it's pasted into the full image later. Independently of any replacement, edge_blend controls how the eventual paste-back handles the seam between the crop and the surrounding image - a hard cut at 0, a fully feathered blend at 1.

The inputs and outputs that matter

  • crop_data (required) - the crop bundle you're editing, from an upstream crop-producing node in this pack.
  • edge_blend (default 0, range 0–1) - the edge feather ratio used when this crop data is eventually composited back onto the full image. 0 is a hard edge, 1 blends the entire crop region.
  • images / masks (both optional) - connect these to override the image or mask content stored in the crop data with something else.

Outputs mirror the inputs: an updated crop_data to pass down the chain, plus images and masks echoing the (possibly replaced) content, so you can inspect or reuse them without breaking the chain into crop_data.

How to install it

Via ComfyUI Manager, search "ComfyUI-WJNodes." Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git

Restart ComfyUI. This node needs nothing beyond the base pack - no extra models, no optional plugin dependency. The README's mention of installing requirements.txt is a fallback for edge cases; most of what the pack needs already ships with a stock ComfyUI install.

Common issues & troubleshooting

Replacement image/mask doesn't seem to take. Double-check you actually wired something into the optional images/masks inputs - if they're left disconnected, the node presumably passes the original crop data content through unchanged rather than clearing it.

Seam is visible after paste-back. That's edge_blend sitting at or near 0, its default. Push it up toward 1 if you want the crop to fade into the surrounding image rather than sit as a hard rectangle.

Type errors on crop_data. This input only accepts the pack's own crop_data type - it has to come from an upstream node in the same family (a mask-crop node), not something assembled by hand elsewhere in the graph.

No outside documentation to lean on. This is a small link in a personal pack's internal pipeline rather than a standalone feature people write about - if behavior is unclear, the fastest way to understand it is wiring up a minimal test graph and watching what the outputs actually do, rather than searching for a writeup.

CategoryWJNode/ImageEdit/mask_crop

Inputs (4)

NameTypeDefaultDescription
crop_datacrop_data
edge_blendFLOAT0.000–1
imagesoptIMAGE
masksoptMASK

Outputs (3)

NameTypeDescription
crop_datacrop_data
imagesIMAGE
masksMASK