Skip to content

ymgenesis/NodeUtilities

Repository files navigation

NodeUtilities

A nodes extension for use with InvokeAI.

NodeUtilities is a collection of utility nodes written by me over time.

Installation

To install, place the desired .py files into your InvokeAI invocations folder located here:

Windows - invokeai\.venv\Lib\site-packages\invokeai\app\invocations\
Mac/Linux - invokeai/.venv/lib/python3.10/site-packages/invokeai/app/invocations/

Nodes

Remove Background

Outputs an image with the background removed behind the subject using rembg.

Remove Background requires the rembg Python package.

To install rembg, first activate InvokeAI's virtual environment. From your InvokeAI root folder execute: source .venv/bin/activate. Then execute: pip install rembg.

Remove Background will pass through the unaltered original image if rembg isn't installed in InvokeAI's virtual environment.

Note: rembg installs its onnx models to a hidden u2net directory in your user home folder.

rembg rembgresult

Remove Transparencies

Outputs an image with some pixels made transparent. Uses a transparency threshold to identify pixels to be made transparent. Optionally crop to remaining pixels (subject) with a transparent border (px). Mask is form-fit to the subject in black by default. Rectangle mask draws a black bounding box around the subject to give painting more room to work with (when altering the subject). Invert the mask to alter the background. Rectangle mask is off when cropping to subject's bounding box (whole mask would be black). Cropped H&W are multiples of 8, and border is >=0 & a multiple of 8.

removetransparencies
before:
before
after:
result

Adaptive EQ

Adaptive Histogram Equalization using skimage.

eq eqresult

Center Pad Crop

Pad or crop an image's sides from the center by specified pixels. Positive values are outside of the image. Checkerboard added to background of result for demonstration. Also takes negative numbers for inward cropping.

cpc cpcresultcheckerboard

Value To Value

Outputs a given value as a string, float, or integer. Rounds in the case of float to integer. Value input types include string, float, and integer.

v2v

Sleep

Sleeps for a given interval in seconds. Optionally clears VRAM cache.

sleep

Insert Channel Image

Overwrite a channel in the input image with a channel image (channel image is any image).

Face Swapper

Blend/place a face into/onto an existing face. Downloads non-commercial research models to invokeai/models/any/faceswapper. NOTE: requires insightface library. Activate invokeai's venv. From the invokeai folder: source .venv/bin/activate Next, do: pip install insightface

CodeFormer

Face restoration using CodeFormer. Downloads non-commercial research models to invokeai/models/any/face_restoration/.

GFPGAN

Face restoration using GFPGAN. Downloads models to invokeai/models/any/face_restoration/.


Source Image

orig

About

Node utilities for InvokeAI's workflow editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages