Skip to content

heyburns/PortraitUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Copy or clone PortraitUtils into ComfyUI/custom_nodes/.
  2. Restart ComfyUI (hard refresh from the manager works too).
  3. 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)
    Balance levels, tone, and colour. Mirrors Photoshop’s Auto Levels / Auto Tone / Auto Color. Guide

    Auto Adjust screenshot
  • AutoColor Config
    Shares the toggle settings for Auto Adjust across your workflow. Guide

    AutoColor Config screenshot
  • Auto White-Balance + Color Match
    Match white balance to a reference frame using quick presets. Guide

    AutoWBColorMatch screenshot
  • Flux Resolution Prepare
    Crop and resize to Flux-friendly dimensions with optional pre-upscale. Guide

    FluxResolutionPrepare screenshot

Cropping & Framing

  • Intelligent AutoCrop (GPU)
    Automatically snipe away ugly black letterboxing or solid borders using your graphics card. Guide

    Intelligent AutoCrop screenshot
  • Process Scanned Photo
    Automatically detect, straighten, and crop messy scanned photographs. Guide

    Process Scanned Photo screenshot
  • Crop by Margins (Image)
    Apply precise pixel padding to your RGB images. Guide

    Crop Image by Margins screenshot
  • Crop by Margins (Mask)
    Apply precise pixel padding to your masks. Guide

    Crop Mask by Margins screenshot
  • MQ BBox (MIN)
    Derive subject-aware crops based on noisy masks using smart quantiles. Guide

    MQ BBox screenshot
  • Fit Aspect (Head-Safe) - Closest AR + Tight Cover
    Snap to aspect ratios while protecting headroom and footroom. Guide

    Fit Aspect screenshot
  • Outpaint Padding Compute
    Translates your outpainting preferences into exact pixel padding values. Guide

    Outpaint Compute screenshot
  • Stitch Two Images by Mask
    Blend layers together using mask-guided falloffs for seamless composites. Guide

    Stitch by Mask screenshot

Prompting & Configuration

  • Universal Project Config
    The ultimate master control board. Replaces messy spaghetti wiring with a single settings bundle! Guide

    Universal Config screenshot
  • Extract Config Value
    The wireless receiver for your Universal Config bundle. Guide

    Extract Config screenshot
  • Outpaint Config
    Store outpaint gravity and percentage preferences securely. Guide

    Outpaint Config screenshot

I/O & Utilities

  • Load Image (Combined)
    A slick hybrid loader for grabbing single images or plowing through entire batches automatically. Guide

    Load Image Combined screenshot
  • Paired Image Loader
    Pull matched before/after pairs directly from your folders for quick comparison passes. Guide

    Paired Image Loader screenshot
  • Simple Image Saver
    Save your PNGs or JPGs quickly with custom suffixes and full metadata support. Guide

    Simple Image Saver screenshot
  • Filename: Append Suffix
    Add suffixes to your filenames safely without breaking tricky multi-part extensions. Guide

    Filename Append Suffix screenshot
  • Comparison Gate
    Pauses the workflow until two incoming images are ready, ensuring they pop out at the exact same time. Guide

    Comparison Gate screenshot

Tips Before You Wire

  • Shared toggles – drive multiple Auto Adjust blocks with one AutoColor Config when branches need the exact same look.
  • Debug strings – cropping utilities emit detailed notes; pipe them into log widgets while tuning.
  • JSON bundlesUniversal Project Config emits a single string you can unpack anywhere with Extract Config Value to sync settings everywhere.

License

GPLv3 – see LICENSE.

About

PortraitUtils

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages