A small set of nodes I created for various numerical and text inputs. Features image saver with ability to have JSON saved to separate folder, parameter collection nodes, two aesthetic scoring models, switches for text and numbers, and conversion of string to numeric and vice versa.
Some basic custom nodes for the ComfyUI user interface for Stable Diffusion. Features:
When using the ComfyUI interface for Stable Diffusion, I sometimes find that the standard nodes and the many, many, many custom nodes out there don't work the way I want them to, or how I think they do.
Rightly or wrongly, I am pretending to teach myself a bit of Python to get some nodes up and running to do what I'd like. Yes, I am using ChatGPT, and yes I am a glutton for punishment. There are no promises that these nodes will work for you or that I will maintain them. Feel free to do with them as you wish, according to the license model.
UPDATE: Aug 19 2024
UPDATE: Oct 16 2023
UPDATE: Oct 14, 2023
UPDATE: Oct 8, 2023
UPDATE: Oct 7, 2023
UPDATE: Oct 4, 2023
UPDATE: Oct 3, 2023
UPDATE: Sep 24, 2023
UPDATE: Sep 20, 2023
UPDATE: Sep 18, 2023
UPDATE: Sep 17, 2023
Navigate to your /ComfyUI/custom_nodes/ folder
In Windows, you can then right-click to start a command prompt and type:
git clone https://github.com/tusharbhutt/Endless-Nodes
You can also get the nodes via the ComfyUI Manager
NOTE: Requires CLIP and Pytorch-Lightning for the Aesthetic Scorer and ImageReward for my take on the Image Reward node scorer. Also require colorama for error messages to console. I've added them in the requirement file but if it doesn't work, you will need to download manually
Some people are reporting having issues with installing Clip from OpenAI, especially if using ComfyUI Manager. I can tell you in looking at the issues on OpenAI's GitHub, it's not an uncommon complaint. So, I started from scratch on a new PC that had no software on it other than Windows and tested to see if I could get CLIP installed. After some minor issues, I was able to get the Python module loaded and working. If I can do this, I'm sure you can as well, but it will take a bit of effort and you need to have some basic skill in installing software in Windows. For users of other platforms or if you installed the other Windows version, I'm assuming you have Python and GIT installed already, so the first few instructions will not apply, but the remainder could.
This is what I did:
TL;DR: Install GIT and Python, ensure the location of Python and Pip are in your PATH, and then use GIT to install Endless-Nodes
python -m pip install -r requirements.txt
You can try to install Clip directly via the following commands (still within the Endless-Nodes folder):
pip install git+https://github.com/openai/CLIP.git
If that does not work, then it likely some configuration on your machine is preventing the install. Ask me nicely for a specific module if you're looking for one and I'll see if I can separate it out for you. Your tone matters, I'm too old to pay attention to people who think I blew up their machines and I will be as short and presumptuous with you as you are with me. If that bothers you, some self-reflection may be in order.
Allows you to connect six float values to any other float input. What is the use case here? It works well for allowing the same settings to be used for the base and refiner encoders or FreeU inputs
UPDATED to allow the user to save JSON data to the image (default is OFF); the previous versions automatically saved the JSON data but if you have other nodes doing it, this is redundant. Warning: turning this off will not allow you to drag and drop an image into ComfyUI to rework it unless you had some other mechanism to save the JSON to metadata.
This is why I tried my hand at Python in the first place! There are many, many, many, good image saver nodes out there, so why one more? Well:
So⦠this node will allow you to save your image file wherever you want, with full support for standard Python date and time conventions and you can save the JSON file somewhere else.
I have more plans for this, but itβs ready for release now.
Does it work... ?
JSONs to the left of me, images to the right of me, and here I am stuck in the middle with you! It works!
** NOTE: this module is available separately here, just toss it in the ComfyUI custom_nodes folder if you don't want the remaining nodes
This module uses the standard Python date and time stamp formats, it does not use the date and time format popular in the WAS Suite. See below for equivalency examples:
[time(%Y-%m-%d__%I-%M%p)]
%Y_%m_%d__%I-%M%p
Note that there is no need to use "[time(your string here)]"
This node will output a predicted aesthetic score as a number and display it with the appropriate node (e.g., rgthree's "Any" node). I took the node from https://github.com/strimmlarn that does aesthetic scoring and repurposed it so that it is simpler and outputs the score as a number. I combined the model loader and score calculator into one, and removed the Aesthetic Score Sorter.
You can load a number of scoring models, I use the "chadscorer" model found here:
https://github.com/grexzen/SD-Chad/blob/main/chadscorer.pth
As for the original node from strimmlarn, please refer to this GitHub if you would like to examine it:
https://github.com/strimmlarn/ComfyUI-Strimmlarns-Aesthetic-Score
The scorer adds about 7-10 seconds to a workflow on my Nvidia 3060 12 GB card, your mileage may vary
This node will output a predicted aesthetic score as a number and display it with the appropriate node (e.g., rgthree's "Any" node). I took the node from https://github.com/ZaneA/ComfyUI-ImageReward that in turn scores images using ImageReward. I combined the model loader and score calculator into one and added output nodes for both the standard deviation calculation (which is what Zane's node does) and the score on a scale of one to ten based on some simple statistic calculations.
The difference between this node and the Aesthetics Scorer is that the underlying ImageReward is based on Reward Feedback Learning (ReFL) and uses 137K input samples that were scored by humans. It often scores much lower than the Aesthetics Scorer, but not always!
As with the Aesthetics Scorer, the Image Reward node adds about 7-10 seconds to a workflow on my Nvidia 3060 12 GB card, your mileage may vary.
For added GPU cycle time consumption, put them both in and watch how often they vehemently disagree with the scoring :)
This node has a collection of inputs for the CLIP text Encoder and Refiners for SDXL based workflows
Inputs include:
You can set up two of these one for the positive and one for the negative prompt
As above, but with TEXT_G and TEXT_L outputs
After making the Parameterizer, I realized having two separate ones for both the positive and negative CLIP encoders is not optimal, because almost everyone will use the same resolution for both the positive and negative base and refiners. However, you may (well, you shouldβ¦) want separate aesthetic scorers for the positive and negative CLIPs, so I came up with one that does this for you. Also comes in a variant that has the prompt boxes for you.
Allows the user to select between six text inputs and uses a slider to make the selection. Useful for multiple inputs for prompt creation
NOT SHOWN: There is an eight input variant now too, as of Sep 20, 2023
I've seen a fair number of 3-, 4-, or more X-way text input and outputs, I wanted to do something for numbers as well. Use it as you wish.
As above, but with widgets for entry instead of connectors
You've seen them elsewhere too, but there are few that do X to float or vice versa, so I threw them in. Still in beta, sometimes they work, other times the downstream node complains.
See GPL Licensing V3 for usage. You may modify this code as long as you keep the credits for this repository and for those noted in the credit section below. YOU ARE EXPRESSLY FORBIDDEN FROM USING THIS NODE TO CREATE ANY IMAGES OR ARTWORK THAT VIOLATES THE STABLE DIFFUSION USAGE NOTES HERE AND HERE.
For example, don't be a mouth-breather who creates fake celebrity nudes or sexual content of anyone, even if you have their consent. JUST. DONβT. BE. A. DICK/BITCH.
The author expressly disclaims any liability for any images you create using these nodes.
These nodes may or may not be maintained. They work on my system but may not on yours. Feel free to send in a bug report if you find one!
Comfyroll Custom Nodes for the overall node code layout, coding snippets, and inspiration for the text input and number switches.
WLSH Nodes for some coding for the Integer Widget.
ComfyUI Interface for the basic ideas of what nodes I wanted.
ComfyUI-Strimmlarns-Aesthetic-Score for the original coding for the Aesthetic Scorer. The original scorer, and therefore my derivative too, use the MLP class code from Christoph Schuhmann
Zane A's ComfyUI-ImageReward for the original coding for the Image Reward node. Zane's node in turn uses ImageReward
Mikey nodes to grab code snippet to pass scoring metadata to image
Took some base code from the WAS save image node to repurpose it
Thanks to chrisgoringe for some vital insight into correcting messy commas in the tuples for the converter nodes, much appreciated!