PortraitUtils
A focused node collection designed for pipelines using real photographic images where resolutions are not standardized like they are in text-to-image generation.
Nodes (20)
PortraitUtils Node Suite
PortraitUtils is a suite of helper nodes for ComfyUI workflows that start with real photographs where resolutions are not standardized like they are in text-to-image generation. Nonstandard or odd resolutions may cause problems with inpainting or other workflow functions, and there may be borders or other dead space in photographs that needs to be trimmed. The suite covers cropping, fit logic, megapixel targeting, colour matching, batch I/O, and comparison QA so you can spend less time wiring utilities and more time iterating.
What You Get
- Human-aware framing – turn noisy masks into reliable subject boxes and aspect-friendly crops.
- Resolution helpers – snap images to Flux whitelist sizes or match a megapixel budget without manual math.
- Colour and tone tools – mimic Photoshop-style auto adjustments across entire branches.
- Workflow glue – loaders, savers, filename utilities, and comparison gates that keep larger graphs tidy.
Every node has a matching guide under docs/ with plain-language control explanations, quick examples, and troubleshooting tips.
Install / Update
- Copy or clone
PortraitUtilsintoComfyUI/custom_nodes/. - Restart ComfyUI (hard refresh from the manager works too).
- Keep your existing workflows—node settings live inside the graphs you already saved.
Updating is as simple as replacing this folder and restarting.
Node Guide
Image Adjustments & Preparation
-
Auto Adjust (Levels/Tone/Color)
<div align="center"><img src="docs/screenshots/auto_adjust_node.png" alt="Auto Adjust screenshot" width="500" /></div>
Balance levels, tone, and colour. Mirrors Photoshop’s Auto Levels / Auto Tone / Auto Color. Guide -
AutoColor Config
<div align="center"><img src="docs/screenshots/auto_color_config_node.png" alt="AutoColor Config screenshot" width="500" /></div>
Shares the toggle settings for Auto Adjust across your workflow. Guide -
Auto White-Balance + Color Match
<div align="center"><img src="docs/screenshots/auto_wb_color_match.png" alt="AutoWBColorMatch screenshot" width="500" /></div>
Match white balance to a reference frame using quick presets. Guide -
Flux Resolution Prepare
<div align="center"><img src="docs/screenshots/flux_resolution_prepare.png" alt="FluxResolutionPrepare screenshot" width="500" /></div>
Crop and resize to Flux-friendly dimensions with optional pre-upscale. Guide
Cropping & Framing
-
Intelligent AutoCrop (GPU)
<div align="center"><img src="docs/screenshots/PLACEHOLDER_INTELLIGENT_AUTOCROP.png" alt="Intelligent AutoCrop screenshot" width="500" /></div>
Automatically snipe away ugly black letterboxing or solid borders using your graphics card. Guide -
Process Scanned Photo
<div align="center"><img src="docs/screenshots/PLACEHOLDER_PROCESS_SCANNED.png" alt="Process Scanned Photo screenshot" width="500" /></div>
Automatically detect, straighten, and crop messy scanned photographs. Guide -
Crop by Margins (Image)
<div align="center"><img src="docs/screenshots/crop_image_by_margins.png" alt="Crop Image by Margins screenshot" width="500" /></div>
Apply precise pixel padding to your RGB images. Guide -
Crop by Margins (Mask)
<div align="center"><img src="docs/screenshots/crop_image_by_margins.png" alt="Crop Mask by Margins screenshot" width="500" /></div>
Apply precise pixel padding to your masks. Guide -
MQ BBox (MIN)
<div align="center"><img src="docs/screenshots/mq_bbox_min.png" alt="MQ BBox screenshot" width="500" /></div>
Derive subject-aware crops based on noisy masks using smart quantiles. Guide -
Fit Aspect (Head-Safe) - Closest AR + Tight Cover
<div align="center"><img src="docs/screenshots/fit_aspect_head_safe.png" alt="Fit Aspect screenshot" width="500" /></div>
Snap to aspect ratios while protecting headroom and footroom. Guide -
Outpaint Padding Compute
<div align="center"><img src="docs/screenshots/outpaint_padding_compute_node.png" alt="Outpaint Compute screenshot" width="500" /></div>
Translates your outpainting preferences into exact pixel padding values. Guide -
Stitch Two Images by Mask
<div align="center"><img src="docs/screenshots/stitch_by_mask.png" alt="Stitch by Mask screenshot" width="500" /></div>
Blend layers together using mask-guided falloffs for seamless composites. Guide
Prompting & Configuration
-
Universal Project Config
<div align="center"><img src="docs/screenshots/PLACEHOLDER_UNIVERSAL_CONFIG.png" alt="Universal Config screenshot" width="500" /></div>
The ultimate master control board. Replaces messy spaghetti wiring with a single settings bundle! Guide -
Extract Config Value
<div align="center"><img src="docs/screenshots/PLACEHOLDER_EXTRACT_CONFIG.png" alt="Extract Config screenshot" width="500" /></div>
The wireless receiver for your Universal Config bundle. Guide -
Outpaint Config
<div align="center"><img src="docs/screenshots/outpaint_config_node.png" alt="Outpaint Config screenshot" width="500" /></div>
Store outpaint gravity and percentage preferences securely. Guide
I/O & Utilities
-
Load Image (Combined)
<div align="center"><img src="docs/screenshots/load_image_combined.png" alt="Load Image Combined screenshot" width="500" /></div>
A slick hybrid loader for grabbing single images or plowing through entire batches automatically. Guide -
Paired Image Loader
<div align="center"><img src="docs/screenshots/portraitutils_paired_image_loader.png" alt="Paired Image Loader screenshot" width="500" /></div>
Pull matched before/after pairs directly from your folders for quick comparison passes. Guide -
Simple Image Saver
<div align="center"><img src="docs/screenshots/simple_image_saver.png" alt="Simple Image Saver screenshot" width="500" /></div>
Save your PNGs or JPGs quickly with custom suffixes and full metadata support. Guide -
Filename: Append Suffix
<div align="center"><img src="docs/screenshots/filename_append_suffix.png" alt="Filename Append Suffix screenshot" width="500" /></div>
Add suffixes to your filenames safely without breaking tricky multi-part extensions. Guide -
Comparison Gate
<div align="center"><img src="docs/screenshots/comparison_gate.png" alt="Comparison Gate screenshot" width="500" /></div>
Pauses the workflow until two incoming images are ready, ensuring they pop out at the exact same time. Guide
Tips Before You Wire
- Shared toggles – drive multiple
Auto Adjustblocks with oneAutoColor Configwhen branches need the exact same look. - Debug strings – cropping utilities emit detailed notes; pipe them into log widgets while tuning.
- JSON bundles –
Universal Project Configemits a single string you can unpack anywhere withExtract Config Valueto sync settings everywhere.
License
GPLv3 – see LICENSE.