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)
Photoshop's Auto Levels, Tone, and Color — recreated as a ComfyUI node
One switchboard, every Auto Adjust node on the same page
White-balance and color-match one photo to another, in one node
Make before/after images arrive at the same moment, every run
Pixel-perfect margin crops with a snap-to-multiple knob
Trim a mask by pixels without losing alignment with the image
Unpack a config bundle anywhere in your graph, wirelessly
Suffix filenames without breaking multi-part extensions
Snap your crop to a real aspect ratio without decapitating anyone
Feed Flux the resolution it actually wants
Snipe off the letterboxing and banners with your GPU
Load one image or plow through a folder, same node
Turn a noisy mask into a reliable subject box
Store your outpainting preferences once, hand them out everywhere
Turn '20% horizontal' into actual pixels, gravity-aware
Load before/after pairs from two folders, in sync
Straighten and crop your grandparents' scans without leaving ComfyUI
Save PNGs and JPGs with metadata, suffixes, and no overwrites
Blend two images together along a mask without a seam
The master control board that replaces spaghetti wiring
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.