ComfyUI Node
Smart Photo Prepare
Prepare a photo for the selected editor with a native source crop and one typed diagnostics output.
Smart Photo Prepare
- image
- editor_target
- crop_config
- mask
- protected_region_mask
- prepared_image
- native_crop
- prepared_mask
- prepare_info
◄resize_methodbicubic►
◄invert_maskauto►
◄q_left0.005►
◄q_right0.995►
◄q_top0.005►
◄q_bottom0.995►
◄min_span_px8►
◄headroom_ratio0.12►
◄footroom_ratio0.06►
◄side_margin_ratio0.08►
◄bottom_priority0.75►
◄horiz_gravitycenter►
◄framing_tolerance_percent0.5►
◄crop_tolerance_px4►
◄profilefalse►
CategoryPortraitUtils/Photo Edit V2
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| editor_target | PORTRAIT_EDITOR_TARGET | — | |
| crop_config | PORTRAIT_CROP_CONFIG_V2 | — | |
| resize_method | COMBO | bicubic | 4 options: bicubic, lanczos, area, bilinear |
| invert_mask | COMBO | auto | 3 options: auto, false, true |
| q_left | FLOAT | 0.0050–0.2 | — |
| q_right | FLOAT | 0.9950.8–1 | — |
| q_top | FLOAT | 0.0050–0.2 | — |
| q_bottom | FLOAT | 0.9950.8–1 | — |
| min_span_px | INT | 81–2048 | — |
| headroom_ratio | FLOAT | 0.120–0.45 | — |
| footroom_ratio | FLOAT | 0.060–0.45 | — |
| side_margin_ratio | FLOAT | 0.080–0.45 | — |
| bottom_priority | FLOAT | 0.750–1 | — |
| horiz_gravity | COMBO | center | 3 options: center, left, right |
| framing_tolerance_percent | FLOAT | 0.50–10 | Allows similarly framed safe crops to compete on resize quality; fallback pixel counts take priority. |
| crop_tolerance_pxopt | INT | 40–64 | When no safe crop fits, allow at most this many source pixels per edge into available safety margins. 0 always preserves them. The protected-region mask stays intact. |
| maskopt | MASK | — | |
| protected_region_maskopt | MASK | Connected critical-region masks are protected in every crop mode, including Auto aspect with Smart Crop off. | |
| profileopt | BOOLEAN | false | Record host stage timings in info. No CUDA synchronization or model-memory changes. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| prepared_image | IMAGE | — |
| native_crop | IMAGE | — |
| prepared_mask | MASK | — |
| prepare_info | PORTRAIT_PREPARATION_INFO_V2 | — |