Image Crop by Mask Params JK๐
Image Crop by Mask Params JK
- inpaint_crop_and_stitch
- padding
- use_image_res
- use_target_res
- target_res
- use_target_mega_pixel
- target_mega_pixel
Crop-by-mask workflows have a lot of settings - and JakeUpgrade's group nodes expect those settings on discrete typed wires, not as UI widgets you can bury. Image Crop by Mask Params JK is the parameter hub for that system: you set seven values once, and it passes all seven straight through as named outputs. It computes nothing. It's a junction box, and it exists because group nodes and subgraphs in ComfyUI can't expose every internal setting to the outside - so Jake fans them out here instead.
The seven parameters mirror exactly what the crop/stitch group nodes consume:
inpaint_crop_and_stitch- master toggle for the crop โ inpaint โ stitch loop.padding- pixels of margin added around the mask's bounding box (0โ512).use_image_res/use_target_res/use_target_mega_pixel- the three resolution strategies; exactly one should be on.target_res- the target resolution (default 1024) when that strategy is active.target_mega_pixel- megapixel target (default 1.0) for the megapixel strategy.
Outputs are the same seven values with the same names, so you wire this node straight into the "Crop by Mask and Resize" or "Latent Crop by Mask" group nodes and every setting lands in the right slot. Since this node and the resolution-calculating sibling share identical option names, the two work as a pair: one decides what the settings are, the other decides how the mask resolves into crop dimensions.
When you'd actually use it: you're hand-building a crop-by-mask pipeline and want the settings visible and editable in one place, or you're editing one of Jake's imgen/refine workflows that ships with this hub and you want to change crop behavior without hunting through a collapsed group node. If you only need crop dimensions computed from a mask (no stitch toggle), the Resolution Grp sibling is the one you want instead.
Install. It's in ComfyUI-JakeUpgrade:
cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
cd ComfyUI-JakeUpgrade
pip install -r requirements.txt
Or ComfyUI Manager โ "JakeUpgrade". Windows portable: install.bat or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt. Restart. No models.
Gotchas: the resolution strategies are flags, and nothing stops you enabling two at once - the consuming node has to prioritize (in the pack's group nodes, resolution beats megapixel). Keep it to one on. And remember this node is purely a parameter router: it won't crop anything by itself; wire its outputs into an actual crop node or group node or you'll get the eternal "nothing happened" mystery. Pack rules: LOAD_DEPRECATED_NODES = True if JK nodes report missing, disable ComfyUI MultiGPU per the README.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| inpaint_crop_and_stitch | BOOLEAN | false | โ |
| padding | INT | 00โ512 | โ |
| use_image_res | BOOLEAN | false | โ |
| use_target_res | BOOLEAN | false | โ |
| target_res | INT | 10240โ16384 | โ |
| use_target_mega_pixel | BOOLEAN | false | โ |
| target_mega_pixel | FLOAT | 1.000.01โ16 | โ |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| inpaint_crop_and_stitch | BOOLEAN | โ |
| padding | INT | โ |
| use_image_res | BOOLEAN | โ |
| use_target_res | BOOLEAN | โ |
| target_res | INT | โ |
| use_target_mega_pixel | BOOLEAN | โ |
| target_mega_pixel | FLOAT | โ |