ComfyUI Extension: PortraitUtils

Authored by heyburns

Created

Updated

0 stars

A focused node collection designed for pipelines using real photographic images where resolutions are not standardized like they are in text-to-image generation.

Custom Nodes (0)

    README

    PortraitUtils Node Suite

    PortraitUtils is a focused collection of ComfyUI nodes designed for pipelines using real potographic images of people, where image sizes are not standardized as they are in text-to-image generation. The suite streamlines prep work such as cropping, resolution targeting, metadata management, and side-by-side QA so you can concentrate on creative iteration instead of utility wiring. These nodes should work well on any type of image, but some of them are designed for and tested on images of humans, particularly the smart cropping nodes.

    Node Index

    Each entry links to a short, task-oriented reference page (coming soon) for deeper usage notes and parameter breakdowns.

    Image Adjustments & Preparation

    • AutoAdjustNode – One-click levels, tone, and color balancing. Docs
    • AutoWBColorMatch – White-balances and colour matches against a reference image using several algorithms. Docs
    • AutoColorConfigNode – Lightweight toggle bundle for sharing Auto Adjust presets. Docs
    • FluxResolutionPrepare – Crops and resizes to the nearest Flux-friendly resolution, with optional pre-upscale. Docs
    • ImageMegapixelSelector – Chooses image sizes by target megapixels to match downstream model limits. Docs

    Cropping, Framing, and Stitching

    • AutoCropBorders – Removes uniform borders using adaptive fuzzy detection. GPU acceleration is currently broken, so leave that off for now. Docs
    • CropImageByMargins – Manual margin-based cropper for RGB images. Docs
    • CropMaskByMargins – Margin cropper designed for MASK tensors. Docs
    • FitAspectHeadSafe – Rescales and pads while preserving face-safe regions for portrait framing. Docs
    • MQBBoxMin – Utility for merging bounding boxes while enforcing minimum sizes. Docs
    • StitchByMask – Composites foreground and background images using mask-driven blending. Docs

    Prompting & Workflow Configuration

    • MultiPromptNode – Cycles through prompt variants with per-slot weights. Docs
    • WorkflowConfig – Centralized key/value store for workflow-wide settings. Docs
    • OutpaintConfigNode – Packs outpainting preferences (steps, padding, sampler choices). Docs
    • OutpaintPaddingComputeNode – Calculates padding offsets to feed outpaint chains as either percentage or absolute pixels, with gravity. Docs

    I/O & Utility Helpers

    • LoadImageCombined – Hybrid single/batch image loader with auto-advance support. Docs
    • PortraitUtils_PairedImageLoader – Loads synchronized source/output pairs for A/B comparison workflows. Docs
    • FilenameAppendSuffix – Adds suffixes to filenames while respecting multi-extension cases. Docs
    • GpuSyncCacheClear – Forces a CUDA sync and empties selected caches to avoid VRAM buildup. Docs
    • SeedVR2Prep – Convenience helper for SeedVR2/VRAM-heavy pipelines (cache priming & cleanup). Docs

    License

    This project is released under the MIT License.