Extensions/ComfyUI_yanc
ComfyUI Extension

ComfyUI_yanc

Yet Another Node Collection. Adds some useful nodes, check out the GitHub page for more details.

By ALatentPlace·Created 2 years ago·Updated 2 years ago· 81
ALatentPlace/ComfyUI_yanc
Nodes42
On cloudLocal install
CategoryYANC/😼 Image/😼 Post Processing, YANC/😼 Text
Stars81
Updated2 years ago

Nodes (42)

😼> Bloom

A one-slider glow pass for your bright highlights

YANC/😼 Image/😼 Post Processing
😼> Blur

A simple, maskable blur for backgrounds, softening, or fake depth of field

YANC/😼 Image/😼 Post Processing
😼> Brightness

A quick exposure lever, with an optional mask for dodge-and-burn

YANC/😼 Image/😼 Post Processing
😼> Clear Text

Randomly wipe a prompt fragment, weighted by a probability you set

YANC/😼 Text
😼> Combine Channels

Rebuild an image from three separate R/G/B channel images

YANC/😼 Image/😼 Post Processing
😼> Contrast

Punch up a flat generation without a full color-grade graph

YANC/😼 Image/😼 Post Processing
😼> Divide Channels

Split an image into its red, green, and blue as separate images

YANC/😼 Image/😼 Post Processing
😼> Edge Enhance

A one-slider sharpen for when Impact Pack feels like overkill

YANC/😼 Image/😼 Post Processing
😼> Film Grain

The small imperfection that makes AI output stop looking airbrushed

YANC/😼 Image/😼 Post Processing
😼> Float to Int

Round, floor, or ceil, when a downstream node insists on a whole number

YANC/😼 Basics
😼> Fog

Atmospheric haze that respects depth, if you feed it a depth map

YANC/😼 Image/😼 Post Processing
😼> Get Mean Color

Read the average color out of an image or a masked region

YANC/😼 Utils
😼> HUE

Rotate the whole image's color wheel with one fine-grained slider

YANC/😼 Image/😼 Post Processing
😼> Int

A plain integer node with proper seed controls

YANC/😼 Basics
😼> Int to Text

Turn a number into a zero-padded string for frame numbers and filenames

YANC/😼 Basics
😼> Layer Weights (for IPAMS)

Sliders instead of hand-typing an IPAdapter layer string

YANC/😼 Experimental
😼> Lens Distortion

A quick fisheye/barrel warp, marked 'subject to change' by its own author

YANC/😼 Image/😼 Post Processing
😼> Light Source Mask

Turn an image's bright spots into a soft mask

YANC/😼 Masking
😼> Load Image

The vanilla loader, plus the filename output ComfyUI forgot to ship

YANC/😼 Image
😼> Load Image From Folder

Batch through a directory without a batch loader

YANC/😼 Image
😼> Mask Curves

A tone-curve tool for cleaning up masks, not images

YANC/😼 Masking
😼> NIKSampler

A KSampler with a second noise source stitched into it

YANC/😼 Noise Injection Sampler
😼> Noise From Image

The author's own noise-injection trick, turned into a node

YANC/😼 Noise Injection Sampler
😼> Normal Map Lighting

Relight an image with a virtual light source, game-engine style

YANC/😼 Image
😼> Resolution by Aspect Ratio

Stop guessing dimensions, let the model's training ratios do it

YANC/😼 Image
😼> RGB Color

Pick a color with sliders, get back the integer other nodes want

YANC/😼 Utils
😼> RGB Shift

Nudge one color channel for a VHS/chromatic-aberration look

YANC/😼 Image/😼 Post Processing
😼> Rotate Image

A rotate node that actually gives you a mask for the empty corners

YANC/😼 Image
😼> Saturation

Tame the oversaturated AI look, or push a subject to pop

YANC/😼 Image/😼 Post Processing
😼> Save Image

Subfolders, date placeholders, and a warning before you overwrite something

YANC/😼 Image
😼> Save Text

Write a string to disk, the same way Save Image writes a file

YANC/😼 Text
😼> Scale Image to Side

Resize by 'make the long edge 1024' instead of fighting width/height math

YANC/😼 Image
😼> Scanlines

An old-CRT overlay, horizontal or vertical

YANC/😼 Image/😼 Post Processing
😼> Sharpen

A maskable sharpening filter — note the floor is 1, not 0

YANC/😼 Image/😼 Post Processing
😼> Text

A multiline text box that also counts your characters

YANC/😼 Text
😼> Text Combine

Gluing two prompt strings together without fighting ComfyUI's string nodes

YANC/😼 Text
😼> Text Count

Chars, words, or lines from any string in your graph

YANC/😼 Text
😼> Text Pick Line by Index

Grab one specific line out of a multiline prompt list

YANC/😼 Text
😼> Text Pick Random Line

A node-based wildcard, no extension required

YANC/😼 Text
😼> Text Random Weights

Text Random Weights (YANC) — ComfyUI Node Guide

YANC/😼 Text
😼> Text Replace

Swap one word for another inside a prompt string, no scripting node needed

YANC/😼 Text
😼> Vignette

Vignette (YANC) — ComfyUI Node Guide

YANC/😼 Image/😼 Post Processing
Readme

:smirk_cat: YANC- Yet Another Node Collection

This is another node collection for ComfyUI. It includes some basic nodes that I find useful, and I've also created them to meet my personal needs.

Latest Updates

2024/08/18: Added a small post processing suite.

2024/06/10: Added RGBColor, GetMeanColor and NormalMapLighting.

2024/05/27: Added LightSourceMask and mask support for the rescale image node.

2024/05/17: Added NIKSampler and "Noise From Image"

2024/04/14: Added the "Resolution by Aspect Ratio" node.

2024/04/08: Added an option to warn the user if files will get overwritten. Added a "Scale to Image Side" node.

2024/04/04: Added nodes: "Int to Text", "Int", "Float to Int".

2024/04/03: First Commit.

Installation

Download or clone this repository into your ComfyUI/custom_nodes/ directory or use the ComfyUI Manager's "Install via Git URL" functionality. That's it!

Please keep your ComfyUI up to date to ensure that everything is working well.

Video Tutorial

Not yet done, but you can have a look at my German ComfyUI tutorial channel here: A Latent Place

You can also find me on Discord.

Nodes Overview

Image

Rotate Image: Rotates an image and outputs the rotated image and a mask. Use ImageCompositeMasked (ComfyUI vanilla node) to combine it with another image.

Scale Image to Side: Scales an image to the selected side (width, height, shortest, longest). Let's you apply a modulo if needed. When applying a mask the mask will also be resized.

Resolution By Aspect Ration: Based on the input image, the node calculates the aspect ratio of it and return the closest matching resolution for either SD 1.5 or SDXL.

Load Image: Basically the same like the ComfyUI vanilla node, but with a filename output. You can chose to strip or keep the file extension.

Save Image: For saving images you can additionally specify a target folder. This folder will be created inside your output directory. You also can decide to include the metadata (like the workflow) in your image. Placeholder:

| Placeholder | Replacement| |------|------| | %d | Day | | %m | Month | | %Y | Year long | | %y | Year short | | %H | Hour 00 - 23 | | %I | Hour 00 - 12 | | %p | AM/PM | | %M | Minute | | %S | Second |

IMPORTANT: When connecting the filename_opt input (which is optional) you need to know, that the filename is no longer dynamically generated. This means your images will be overwritten as long as the filename_opt does not change!

Load Image From Folder: Loads randomly or iterative an image from the specified folder. If "image_folder" is kept empty, the node will load a random image from the input directory. If a "image_folder" is specified, this folder must be present inside of the input directory. By connecting a primitive to the "index" input and setting it to value 0 and increment, the node will iterate through the images in the specified folder. In order to reset the index put the primitive then back to 0.

Noise From Image: Generates noise from an image. Can be used in combination with the NIKSampler. Parameter Description: | Parameter | Description | |-|-| | magnitude | The "waviness" of the noise. | | smoothness | The smoothness of the noise. Lower values give a more grainy result| | noise_intensity | Intensity of the additional noise. The "amount" of dots to be created. | | noise_resize_factor | The size of the noise dots. 2 is good for SD 1.5, while SDXL would take 3-4. | | noise_blend_rate | The blending rate of the noise dots on the base noise. 0.15 - 0.2 is a good value. If this is set to 0, the additional noise will not be applied. | | saturation_correction | To raise or lower the saturation of the noise. If colors seem to be washed out in the final image, try to set it higher. | | blend_mode | Used to blend over batched images. Switched to "off" the node will create noise for every batched image sent in. | | blend_rate | The blend intensity of batched images. Only works in combination with the blend_mode. Batched images are blended one after the other, so first image 2 on image 1, then image 3 on the result of the first blending (and so on). |

Normal Map Lighting: When providing a diffuse map, a normal map and a specular map you can change the lighting of an image. Tutorial available on my YouTube channel.

Text

Text: A simple multiline text node.

Text Combine: Combines two text inputs. The "delimiter" is optional. "add_empty_line" adds an empty line between "text" and "text_append".

Text Pick Random Line: Picks a random line from a multiline text input. Set the seed to fixed if you want to stop the random picking.

Clear Text: Empties the text by the given chance (0.0 = 0%, 1.0 = 100%)

Text Replace: From the given text input it replaces the "find" text with the "replace" text.

Text Random Weights: Takes text separated by a new line from a multiline text node and adds random weights to each of the lines. The output will be concatenated, delimited with ",". You can specify the min and max values of the weights which are randomly applied. To stop the random assignement you can set the seed to fixed.

Int to Text: Converts an integer to a text output. By enabling "leading_zero" you can specify with "length" the length of the ouput string. Example output: 00010.

Basic

Int: A simple integer output node.

Float to Int: Converts a float value into an integer value. Functions are: round, floor, ceil.

Sampling

NIKSampler: For a "how to" on the usage please see this video (German, English subtitles):

Noise Injection Sampler

Masking

Light Source Mask: A node which takes the brightest parts of an image (can be adjusted with a threshold) and creates a blurred mask.

Utils

Get Mean Color: Gets the mean color of the provided image. By applying a mask you can chose the area of which you want to get the mean color value.

RGB Color: A helper node to create RGB colors. Outputs an INT value for the color as well as for each channel. Also export the color in HEX format.

Post Processing

Brightness: Set the brightness of an image.

Contrast: Set the contrast of an image.

Saturation: Set the saturation of an image.

Sharpen: A simple image sharpening node.

Divide Channels: Divide the RGB channels of an image. Returns every channel as an image. Good if you want to manipulaute only one channel of the image.

Combine Channels: Combines the RGB channels back to one image.

Edge Enhance: A simple edge enhacing node.

Bloom: A bloom effect.

Blur: A simple image blur node.

Vignette: Creates either a black or a white vignette on the image.

Fog: Creates a foggy effect in the effect. You can use a depth mask to control the fog in the back and the front.

Scanlines: A simple node to create a scanline effect.

RGB Shift: Shifts the selected RGB channel by given pixels. Can be used, for example, to create the channel shift effect of old VHS movies.

Film Grain: A simple node which creates a film grain effect.

HUE: A simple HUE shifting node.

Lens Distorion: To create a fisheye effect. Subject to change.

Experimental

Layer Weights (for IPAMS): Made for the IPAdapter Mad Scientist. Input form for the layer weights.

Demo Workflows

Demo workflows can be found in the examples folder.

Credits