Extensions/wlsh_nodes
ComfyUI Extension

wlsh_nodes

Nodes: Checkpoint Loader with Name, Save Prompt Info, Outpaint to Image, CLIP Positive-Negative, SDXL Quick Empty Latent, Empty Latent by Ratio, Time String, SDXL Steps,…

By wallish77·Created 3 years ago·Updated 2 years ago· 144
wallish77/wlsh_nodes
Nodes39
On cloudLocal install
CategoryWLSH Nodes/text, WLSH Nodes/loaders
Stars144
Updated2 years ago

Nodes (39)

Build Filename String (WLSH)

Build Filename String (WLSH)

WLSH Nodes/text
Checkpoint Loader w/Name (WLSH)

Checkpoint Loader w/Name (WLSH)

WLSH Nodes/loaders
CLIP Positive-Negative (WLSH)

CLIP Positive-Negative (WLSH)

WLSH Nodes/conditioning
CLIP Positive-Negative w/Text (WLSH)

CLIP Positive-Negative w/Text (WLSH)

WLSH Nodes/conditioning
CLIP Positive-Negative XL (WLSH)

One box for both your SDXL prompts

WLSH Nodes/conditioning
CLIP Positive-Negative XL w/Text (WLSH)

CLIP Positive-Negative XL w/Text (WLSH)

WLSH Nodes/conditioning
CLIP +/- w/Text Unified (WLSH)

One prompt node that works on SD1.5 and SDXL

WLSH Nodes/conditioning
Empty Latent by Pixels (WLSH)

Empty Latent by Pixels (WLSH)

WLSH Nodes/latent
Empty Latent by Ratio (WLSH)

Empty Latent by Ratio (WLSH)

WLSH Nodes/latent
Empty Latent by Size (WLSH)

Empty Latent by Size (WLSH)

WLSH Nodes/latent
Generate Border Mask (WLSH)

The second-pass fix for outpainting seams

WLSH Nodes/inpainting
Grayscale Image (WLSH)

Grayscale Image (WLSH)

WLSH Nodes/image
Image Load with Metadata (WLSH)

Pull the prompt back out of a PNG

WLSH Nodes/image
Image Save with Prompt File (WLSH)

Image Save with Prompt File (WLSH)

WLSH Nodes/IO
Image Save with Prompt/Info File (WLSH)

Save the PNG and a matching text file

WLSH Nodes/IO
Image Save with Prompt/Info (WLSH)

Image Save with Prompt/Info (WLSH)

WLSH Nodes/IO
Image Save with Prompt (WLSH)

Image Save with Prompt (WLSH)

WLSH Nodes/IO
Image Scale By Factor (WLSH)

Resize by a multiplier, no model involved

WLSH Nodes/upscaling
Image Scale by Shortside (WLSH)

Image Scale by Shortside (WLSH)

WLSH Nodes/upscaling
KSamplerAdvanced (WLSH)

KSamplerAdvanced (WLSH)

WLSH Nodes/sampling
Multiply Integer (WLSH)

Multiply Integer (WLSH)

WLSH Nodes/number
Outpaint to Image (WLSH)

Extend a canvas and get a ready-to-use mask

WLSH Nodes/inpainting
Prompt Weight (WLSH)

Prompt Weight (WLSH)

WLSH Nodes/text
Quick Resolution Multiply (WLSH)

Stop doing SDXL target-size math by hand

WLSH Nodes/number
Resolutions by Ratio (WLSH)

Aspect ratio and short-side length, out come the pixels

WLSH Nodes/number
Save Positive Prompt(WLSH)

The no-frills prompt logger

WLSH Nodes/IO
Save Prompt/Info (WLSH)

The KSamplerAdvanced-aware prompt logger

WLSH Nodes/IO
Save Prompt (WLSH)

Log your prompt, model, and seed to a text file

WLSH Nodes/IO
SDXL Quick Empty Latent (WLSH)

SDXL Quick Empty Latent (WLSH)

WLSH Nodes/latent
SDXL Quick Image Scale (WLSH)

Resize onto SDXL's actual trained resolutions

WLSH Nodes/upscaling
SDXL Resolutions (WLSH)

SDXL Resolutions (WLSH)

WLSH Nodes/number
SDXL Steps (WLSH)

Three step counts from one node, for base/refiner-style splits

WLSH Nodes/number
Seed and Int (WLSH)

One seed value, two output types

WLSH Nodes/number
Seed to Number (WLSH)

The one-line adapter for a SEED-typed input

WLSH Nodes/number
Simple Pattern Replace (WLSH)

Lightweight wildcards for your prompt text

WLSH Nodes/text
Simple String Combine (WLSH)

Glue two strings together without a code node

WLSH Nodes/text
Time String (WLSH)

Time String (WLSH)

WLSH Nodes/text
Upscale by Factor with Model (WLSH)

Upscale by Factor with Model (WLSH)

WLSH Nodes/upscaling
VAE Encode for Inpaint w/Padding (WLSH)

One padding dial instead of a settings puzzle

WLSH Nodes/inpainting
Readme

WLSH ComfyUI Nodes

A set of custom nodes for ComfyUI created for personal use to solve minor annoyances or implement various features. Includes nodes to read or write metadata to saved images in a similar way to Automatic1111 and nodes to quickly generate latent images at resolutions by pixel count and aspect ratio.

Node descriptions

Loaders

| Node Name | Description | |-----------|-------------| | Checkpoint Loader with Name | The regular checkpoint loader with an output that provides the name of the loaded model as a string for use in saving filenames

Samplers

| Node Name | Description | |-----------|-------------| |KSamplerAdvanced (WLSH) | Modified version of the advanced KSampler to return the denoising option for experimentation. Also provides the INFO output that provides sampler settings for use in other nodes.

Conditioning

| Node Name | Description | |-----------|-------------| |CLIP Positive-Negative| Simple CLIP box containing positive and negative prompt boxes. Mostly a space saver. Also available as an SDXL version.| |CLIP Postive-Negative w/Text| Same as the above, but with two output ndoes to provide the positive and negative inputs to other nodes. Also available as an SDXL version| |CLIP +/- w/Text Unified (WLSH)| Combined prompt/conditioning that lets you toggle between SD1.5 and SDXL (just make sure to change your inputs). Sacrifices some features of SDXL, namely by assuming POS_G and POS_L are the same (as well as the negative), assuming zero crop, and assuming target size is 2x input size. Width and height inputs are option, will assume 1024x1024.|

Latent

| Node Name | Description | |-----------|-------------| |Empty Latent by Pixels|Quickly generate an empty latent by selecting an aspect ratio, an orientation (landscape or portrait) and the number of megapixels (1MP = 1024 * 1024 in this case). Also provides the height and width as integers for plugging in elsewhere. | |Empty Latent by Ratio|Quickly generate an empty latent by selecting an aspect ratio, an orientation (landscape or portrait) and the length of the 'shorter' side. Also provides the height and width as integers for plugging in elsewhere. | |Empty Latent by Size |Nearly identical to the default empty latent node, but also provides the width and height as integer outputs for plugging in elsewhere. | |SDXL Quick Empty Latent| Quickly generate an empty latent of a size from a list of ideal SDXL image sizes. Also provides the height and width as integers for plugging in elsewhere.|

Image

| Node Name | Description | |-----------|-------------| |Image Load with Metadata| Extract image metadata from Auto1111-sourced images or from images saved with the nodes in this pack. Can then connect these outputs to other nodes. Requires comfyUI commit d7b3b0f8c11c6261d0d8b859ea98f2d818b7e67d or newer to show preview of selected image| |Grayscale Image| Takes an input image and returns the image in grayscale. Useful for some controlnet actions|

Inpainting

| Node Name | Description | |-----------|-------------| |Generate Border Mask| Used to generate a 'stripe' of mask with blurred edges that overlaps an original iamge with the outpainted new space. Use on a second pass of an image to 'redo' the masked stripe region and help smooth out the edges of an outpainted image. Pass output to a Convert Image to Mask node using the green channel.| |Outpaint to Image|Extends an image in a selected direction by a number of pixels and outputs the expanded image and a mask of the outpainted region with some blurred border padding.| |VAE Encode for Inpaint Padding|A combined node that takes an image and mask and encodes for the sampler. Can apply some padding/blur to improve inpainting behavior.|

Upscaling

| Node Name | Description | |-----------|-------------| |Image Scale by Factor|Scale an image by a predefined factor without a model| |Image Scale by Shortside| Scale an image by specifying what the shorter side of the image should become. The resulting image should be approximately the same aspect ratio as the original, just scaled down (or up) to a target scale.| |SDXL Quick Image Scale|Take an input image and do a quick simple scale (or scale & crop) to one of the ideal SDXL resolutions| |Upscale by Factor with Model|Does what it says on the tin. Scales using an upscale model, but lets you define the multiplier factor rather than take from the model.|

Numbers

| Node Name | Description | |-----------|-------------| |Mulitply Integer | Simple math node to multiple an integer by an integer| |Quick Resolution Multiplier|Takes in an integer width and height and returns width and height times the multiplier. Useful for SDXL height (multiplied) vs. target_height (actual resolution)| |Resolutions by Ratio|Similar to Empty Latent by Ratio, but returns integer width and height for use with other nodes. Possibly deprecated now that the latent equivalent node returns width and height as well| |Seed to Number| Converts a SEED type to an INT, which was needed for some third party nodes| |Seed and Int | Generates a seed and outputs as an INT and SEED type to allow the number to be used with nodes looking for varying inputs| |SDXL Steps|A single node that outputs three different integers for use as step count in SDXL workflows.| |SDXL Resolutions| Outputs height and width integers from a list of SDXL optimal resolutions|

Text

| Node Name | Description | |-----------|-------------| |Build Filename String|Takes inputs similar to the Image Save node, used to build a filename which can be passed to multiple other nodes| |Time String|Returns a formatted string of the current time in the selected format. Useful for filenames or debugging| |Simple Pattern Replace|Takes in an input string and a list string and does a simple find/replace and returns a new string. Can choose a custom delimiter for the list string in case you want to use commas in the list. If multiple entries of the pattern are in the input, each will get their own random entry.| |Simple String Combine|Takes in an input string lets you enter a second string to append (or prepend). Offers selection of separators. Outputs combined string.| |Prompt Weight|Takes in an input string (ideally a prompt or string that will go into a prompt) and uses a multiplier to add weight to the incoming string. e.g. "foo" and 1.25 -> "(foo:1.25)"|

IO

Various nodes for file saving. Most of these come with an "info" variant that reads in the INFO output from the KSamplerAdvanced (WLSH) node, which contains additional metadata such as sampler. The nodes are separate due to compatibility issues found with some other third party node suites such as TTN.

| Node Name | Description | |-----------|-------------| |Image Save with Prompt | Save an image with prompt information embedded as a comment or exif data similar to how Auto1111 does it. Need to feed it various pieces of information and then specify the filename syntax for replacement if desired. Filename options include %time for timestamp, %model for model name (via input node or text box), %seed for the seed (via input node), and %counter for the integer counter (via primitive node with 'increment' option ideally). As far as I can tell, does not remove the ComfyUI 'embed workflow' feature for PNG.| |Image Save with Prompt File| Save an image with embedded metadata along with a text file containing the metadata. Text file will have a matching filename| |Save Prompt| Saves the prompts to a text file, along with info on model name and seed| |Save Positive Prompt| Same as the previous one, but only the positive prompt is saved|

Disabled or Non-Functional Nodes

| Node Name | Description | |-----------|-------------| |Alternating KSampler| Work in progress. Attempting to recreate the alternating prompts of Auto1111. Provide a prompt with the syntax "<foo|bar>" for it to alternate between "foo" and "bar" (and any number of others) before looping back around to the first entry. Currently not functional due to sampling issues, but the prompt alternating logic works.|

Example Workflows

Here's an example hi-res workflow using various WLSH nodes. | Workflow | Image | |----------|-------| | Hi-res SD 1.5 Workflow| <img src="./img/hires-workflow-example.png" width="256" height="256"> | | Simple SDXL Workflow | <img src="./img/sdxl-basic-example.png" width="256" height="256">| | IP-Adapter Workflow w/Prompt Feed| <img src="./img/ip-adapter-example.png" width="256" height="256">|