Skip to content

Documentation for the ComfyUI Nodes in this Node Pack

MokkaBoss1 edited this page May 16, 2024 · 73 revisions

Welcome to the ComfyUI-Mokkaboss1 wiki!

Node1: DoubleTextEncode (Workflow available in the workflow folder)

image

This node combines two ClipTextEncode nodes together and gives the option to use the text prompt for the purpose of saving this to a file if needed

Node2: HashText

image

This node allows you to include Comments separated by "#" that do not carry forward to the prompt.

Node3: IndoorBackgrounds

image

This node helps to create a text prompt describing the background of an image. The options available centre around indoor images. It provides options to select from to piece together the text. There are some special options available. For each characteristic you can select "Random" or "None" - no prizes to guess what these options mean. The seed also plays a role in how this node works. If you fix the seed, then the generated prompt can be re-used over and over again. If you select random or incremental seed, then new text is generated each time you queue the prompt. If you fix the seed on 999, it ensures the whole text is blank. There is also a pre-text and a post_text which allows you to add your own custom text before or after the generated text.

Node4: LandscapeBackgrounds

image

This node works in the same way as Node3 just for outdoor images.

Node5: NatureColours (deprecated)

image

This node provides the hex colour code for colours that are commonly present in nature.

Node 6: UrbanColours (deprecated)

image

This node works in the same way to Node 5 but with colours found in man made environments

Node 7:OptimalCrop

image

This node supports to calculate the maximum image size for the purpose of cropping that fits into another image whilst adhering to the target aspect ratio. In the example shown I have a 4K desktop background image (3840x2194) and want to crop it to ratio of 3:4. What are the dimensions of that image for passing to the Crop image node? By changing the aspect ratio and tweaking the x and y offsets, the desired final image can be cropped. The Optimal Crop node also allows the rounding value to be adjusted to ensure the dimensions of the final image are divisible by this amount. The node will automatically centre the crop around the middle of the image - so the offsets maintained will be relative to this point.

Node 8: seveninabox (deprecated) see Node 16

image

This node reads saved settings for steps, cfg, sampler, scheduler for a given model and passes them on for use in the workflow. The settings are saved in the file "model_data.py" in the folder "model_settings". This file can be updated individually by the user based on their settings. (...ComfyUI_MokkaBoss1\model_settings\model_data.py")

My settings are:

image

I have found this is a real time saver when changing models I don't need to refer back to the optimal settings for each model as they are automatically selected.

Node 9: X_In_a_Dress

image

This node works in the same manner to nodes 3 and 4 but has the focus on the subject. The options provided allow for fashion choices around 'female' clothing.

Node 10: X_In_a_Suit

image

This node works in the same manner to nodes 3,4 and 9 and helps to generate text for fashion choices around 'male' clothing.

Node 11: WrapText

image

this node is a simple word wrap node - I use it together with the comfyroll node CR Overlay Text node

Node12: AspectRatioCondition

This node is a simple check if the image aspect ratio is within a certain tolerance and only if this is the case will the image pass to the next step in the workflow. If it is not the workflow will abort and an error message will be generated.

image

Node13: SDXLAspectRatioDec

This node is similar to many currently available but includes the decimal value for the aspect ratio which I find quite helpful.

image

Node14: ZoomCrop

This node is similar to OptimalCrop but focusses on zooming into the image rather than changing the aspect ratio. Both nodes can be used in sequence if you want to change both the aspect ratio and the zoom. see the example below 👍

image

Firstly the aspect ratio is set to 2:3 via OptimalCrop and then the zoom factor is set to 1.5 indicating a 50% zoom. The y offset is adjusted to ensure the head of the statue is included in the frame.

Node15: IntFloatDict

image

This simple node takes an integer, looks up the integer in a dictionary (created based on a multi-line text field) and returns the value from the dictionary as a float. A practical example of how this can be used is included below (workflow available in the workflow folder)

image

Node 16: WorkflowSettings

image

This is replacement for node 8 "seveninabox". Now it is nolonger needed to modify a python file to set the model settings. This can be done directly in comfy.

The data structure to be updated in the multiline text is as follows:

0,devlishphotorealism_sdxl15.safetensors,30,4.0,dpmpp_2m_sde,karras 1,sdxlUnstableDiffusers_v8HEAVENSWRATH.safetensors,30,4.0,dpmpp_2m_sde,karras 2,lovexlAllInOneMega_v20.safetensors,30,4.0,dpmpp_2m_sde,karras 3,juggernautXL_v9Rdphoto2Lightning.safetensors,5,1.5,dpmpp_sde,karras 4,dreamshaperXL_v21TurboDPMSDE.safetensors,6,2.0,dpmpp_sde,karras 5,devlish LoveXL 050.safetensors,30,4.0,dpmpp_2m_sde,karras 6,sdxlUnstableDiffusers_v11.safetensors,30,4.0,dpmpp_2m_sde,karras 7,DEVLISH LIGHTNING.safetensors,5,1.5,dpmpp_sde,karras 8,sdxlUnstableDiffusers_nihilmania.safetensors,30,4.0,dpmpp_2m_sde,karras 9,realvisxlV40_v40Bakedvae.safetensors,30,4.0,dpmpp_2m,karras 10,realvisxlV40_v40LightningBakedvae.safetensors,5,1.5,dpmpp_sde,karras 11,juggernautXL_v8Rundiffusion.safetensors,30,4.0,dpmpp_2m,karras

i.e. a simple comma separated list. If the model selected in the model selection node is not present in the multiline text field then the first line will be assumed. Once you have maintained your settings once mark the node, then click in an empty space and save the single node with the maintained data as a template (via the context menu [right mouse click]. This safeguards having to update this somewhat tedious list each time a new workflow is created. The template can be retrieved by clicking in an empty space and select load template also via the context menu.

Node 17: IntStringDict

image

like Node 15 but outputs strings rather than floats

Nodes 18,19,20,21,22: ConnectImage, ConnectInteger, ConnectFloat, ConnectString, ConnectLatent

image

This is a variant of the reroute nodes. Why create a new node? I was creating a template and my first node in the template was the reroute. As this is a generic node that supports all data types, it seems when loading the template comfy got confused about which type it should be and some of the noodles were changed. So I thought I'll create a new version for each type separately and also include a text field to support documentation purposes for example can be used to doucment how to use the template. Of course you can also collapse these nodes and they look like a regular reroute node. Bear in mind when you add the node to a workflow you'll need to convert the i_#### to an input (I have not yet worked out how to set that per default)

Node 23: TimeStamp

image

kudos to jamesWalker55 for this one and his datetime node. Unfortunately it seemed to be creating some error messages so I created one similar with a slightly adjusted format.

Node 24: SaveWithMetaData

image

I can't really take the credit for this one as it is 99% down to https://github.com/giriss/comfy-image-saver

I used his node a lot but was frustrated that it took on my machine about 20s to save an image. After debugging I localized the root cause of the delay. The line which reads the modelhash was consuming all the time. This was suitably commented out and more or less any reference to modelhash removed from the node. It now runs within a couple of seconds which is a massive improvement.

NOdes 25,26: Colours, TricolorComposition

image

I made a new selection of colours and incorporated them into this node - I will set the other two mentioned earlier (urbancolours, nature colours to deprecated)

The TricolorComposition node allows the easy composition of backgrounds based on black, grey and white templates (found in the TricolorComposition folder as part of the repository). You can also create your own if you like. The threshold likely does not need to be changed. This only helps to classify pixels that are nearly white or nearly black correctly.

Node 27: HueSatLum

image

Promise this will be the last colour selector node. I wanted the flexibility of the Hue, Saturation, Luminosity sliders I know and love from various graphics programs. This node delivers hex codes that can feed various other nodes.

update: 18th April - I added a preview color box to this node (100 pixels x 100 pixels)

image

Node 28: EmbeddingLoader

Screenshot 2024-04-16 170941

ability to maintain a list of downloaded embeddings and their keywords and pull them into the text prompt for further processing.

Node 29: ImageDimensions

image

adding aspect ratio and megapixel count to the get Image Size node.

Node 30: IntEvaluate

some of you will be familiar with the Evaluate Integers Node from the Efficiency nodes suite. However I've had a few problems with this one dur to the dependency on importing simpleeval. So to avoid any future issues on this front I created my own version. If you want me to add any new formulae considering a,b and c let me know.

image

note: I added another formula to this (a*b) + c

Node 31: ImageResizeLong

This node helps when you want to superimpose a subject onto a background. Often you want to calculate the optimal dimensions to resize the subject to fit into the background without changing the aspect ratio of the subject or the background.

image

node 32: PhotomontageA

Screenshot 2024-04-23 204418

This node allows to create a photomontage of 8 pictures. Including 3 pictures in the first column, 2 in the second and 3 in the third. The images a are cropped and resized to fit into the grid which has a size determined by the 3 inputs (spacing, unit width and unit height). It was designed for spacing = 25 , unit_width = 1024 and unit_height = 1024 but you can change this as you need. The unit_width and unit_height refer to the size of the images in columns 1 and 3.

node 33: PhotomontageB image

similar design to PhotomontageA but with a different grid design.

node 34: PhotomontageC image

similar design to PhotomontageA but with a different grid design.

node 35: Post Sampler Crop

image

this image allows a more precise crop by any aspect ratio (not bound by the SDXL standard supported ones) with the assmption the node is used after the ksampler has been used. Also it incorporates Lanczos upscaling to reach a target number of megapixels

node 36: Overlay

image

This is pretty much the old Overlay node from the Efficiency pack (which now no longer seems to exist). I had a copy still and as I use it regularly I didn't want it to be dispanded. Only change I made is to reduce the positioning x-offset and y-offset step from 10 pixels down to 1 for more precise overlays.

node37: HueShift

pretty straight forward node:

image

The hue varies from 0 to 360. A hue shift of 180 selects an opposite colour on the colour wheel.

node 38: FuseImages, FuseImages2

image

These nodes allow you to join images together. Fairly self explanatory I think.

node39: StringJoin

image

The first 2 strings are required the rest optional. You may want to change from widget to input if you want to use the rest of the inputs

node40: SearchReplace

image

not too much to say about this one either...

Node41: SavePrompt

image

This saves a textfile with generation data including prompts and other data items shown in the screenshot. It will create a path as shown below:

image

Nodes 42,43 PresetSave, RandomString

image

ok so I'm linking these 2 together as I use them together. Starting with RandomString - there are various options included to generate random strings for filenames or unique identifiers. I tend to use random ascii and number with 4 digits this gives millions of unique strings with only 4 digits. The second node adds to a .json file which can be used to collect all your prompts that you make and together with the previous node can assign an identifier which can be used to load the prompts back into Comfyui with the next node I will describe.

Node 44 PresetLoad

image

This node allows you to load the prompts back into comfy from the .json used in presetsave.

Node 45 PromptSwitcher

image

This node allows you switch easily between 2 sets of positive and negative prompts

Node 46 Json Search

image

This node allows you to search the .json file used in the previous nodes to find prompts with certain key words. you can use multiple key words separated by a comma and then provide a cutoff integer in terms of the maximum number of results you want to see.

Clone this wiki locally