Extensions/Mikey Nodes
ComfyUI Extension

Mikey Nodes

Nodes: Prompt With Style, Prompt With SDXL, Resize Image for SDXL, Save Image With Prompt Data, HaldCLUT, Empty Latent Ratio Select/Custom SDXL

By bash-j·Created 3 years ago·Updated 11 months ago· 188
bash-j/mikey_nodes
Nodes73
On cloudLocal install
CategoryMikey/Meta, Mikey/Image
Stars188
Updated11 months ago

Nodes (73)

AddMetaData (Mikey)

Stamp custom key/value metadata onto your saved images

Mikey/Meta
Batch Crop Image (Mikey)

Trim an edge percentage off an entire folder at once

Mikey/Image
Batch Crop Resize Inplace (Mikey)

Clean up a whole dataset folder on disk, no image outputs

Mikey/Image
Batch Load Images (Mikey)

Batch Load Images (Mikey Nodes) — pull a whole folder into your workflow

Mikey/Image
Batch Resize Image for SDXL (Mikey)

Batch Resize Image for SDXL (Mikey Nodes) — resize a whole folder in one node

Mikey/Image
Checkpoint Hash (Mikey)

Trace an image back to the exact checkpoint that made it

Mikey/Loaders
Checkpoint Loader Simple (Mikey)

Checkpoint Loader Simple (Mikey Nodes) — the stock loader, plus the hash you actually want

Mikey/Loaders
Save Model Only (Mikey)

Save a merge without dragging a mismatched CLIP along

Mikey/Model Merging
Cinematic Look (Mikey)

Six preset color grades, no LUT files needed

Mikey/Image
Empty Latent Ratio Custom SDXL (Mikey)

Any aspect ratio, fitted to SDXL's pixel budget

Mikey/Latent
Empty Latent Ratio Select SDXL (Mikey)

Empty Latent Ratio Select SDXL (Mikey Nodes) — pick SDXL's actual trained aspect ratios

Mikey/Latent
Eval Floats (Mikey)

A formula box for two numbers, instead of a chain of math nodes

Mikey/Math
Face Fixer OpenCV (Mikey)

Face Fixer OpenCV (Mikey Nodes) — a self-contained face fix without a YOLO model

Mikey/Utils
File Name Prefix (Mikey)

File Name Prefix (Mikey Nodes) — build a smart prefix for ComfyUI's Save Image

Mikey/Meta
File Name Prefix Date Dir First (Mikey)

File Name Prefix Date Dir First (Mikey Nodes) — FileNamePrefix's sibling, date folder first

Mikey/Meta
Float to String (Mikey)

Turn a numeric widget into text you can save or stamp

Mikey/Utils
Get Subdirectories (Mikey)

List a folder's subfolders for batch/per-folder pipelines

Mikey/Utils
HaldCLUT

Film-emulation color grading without a diffusion pass

Mikey/Image
Image Border (Mikey)

Add a clean frame around an image

Mikey/Image
Image Caption (Mikey)

Burn a text caption into your image

Mikey/Image
Image Overlay (Mikey)

Blend two images together with an opacity slider

Mikey/Image
Image Paste (Mikey)

Paste one image onto another at exact coordinates

Mikey/Image
Int to String (Mikey)

The small converter that unblocks filenames and captions

Mikey/Utils
LM Studio Prompt (Mikey)

LM Studio Prompt (Mikey Nodes) — let a local LLM write your prompt for you

Mikey/AI
Load Image Based on Number (Mikey)

Pick one file from a folder, deterministically

Mikey/Image
Lora Syntax Processor (Mikey)

Name:weight> right in your prompt

Mikey/Lora
Latent Tile Sampler (Mikey)

Latent Tile Sampler (Mikey Nodes) — a tiled detail pass that stays in latent space

Mikey/Sampling
Latent Tile Sampler Custom (Mikey)

Tiled denoising for people building a custom sampler graph

Mikey/Sampling
Mikey Sampler

SDXL's base-refiner-upscale pipeline as one node

Mikey/Sampling
Mikey Sampler Base Only

The SDXL hires pipeline for checkpoints without a refiner

Mikey/Sampling
Mikey Sampler Base Only Advanced

The manual-transmission version of the Mikey pipeline

Mikey/Sampling
Mikey Sampler Tiled

Base, refiner, upscale and detail pass in one node

Mikey/Sampling
Mikey Sampler Tiled Advanced

The one-node hi-res fix people actually recommend

Mikey/Sampling
Mikey Sampler Tiled Advanced Base Only

Swap your VAE Decode for a built-in hires pass

Mikey/Sampling
Mikey Sampler Tiled Base Only

The auto-settings tiled hires pass

Mikey/Sampling
Model Merge PixArtSigmaXL2_1024MS (Mikey)

Block-by-block merging for PixArt Sigma

Mikey/Model Merging/Model Specific
Train Diff (Mikey)

Apply one model's training as a delta onto another

Mikey/Model Merging
Train Diff PixArtSigmaXL2_1024MS (Mikey)

Add-difference merging, block by block

Mikey/Model Merging/Model Specific
Mosaic Expand Image (Mikey)

Grow the canvas and get an outpaint mask for free

Mikey/Image
OobaPrompt (Mikey)

OobaPrompt (Mikey Nodes) — prompt generation through Oobabooga's text-generation-webui

Mikey/AI
Preset Ratio Selector (Mikey)

Pick an SDXL resolution and get all 8 numbers you actually need

Mikey/Utils
Prompt With SDXL (Mikey)

Prompt With SDXL (Mikey Nodes) — one node for prompt, style, ratio, and both text encoders

Mikey
Prompt With Style V1 (Mikey)

A1111-style prompting, LoRA syntax and all, inside ComfyUI

Mikey
Prompt With Style V2 (Mikey)

A dropdown-driven prompt-to-latent starting node for SDXL

Mikey
Prompt With Style (Mikey)

Inline styles, LoRAs, and wildcards from one text box

Mikey
Range Float (Mikey)

Step through a float range using the seed control

Mikey/Utils
Range Integer (Mikey)

Step through a range of whole numbers using the seed control

Mikey/Utils
Ratio Advanced (Mikey)

Every SDXL sizing number CLIP wants, from one node

Mikey/Utils
Remove Text Between (Mikey)

Remove Text Between (Mikey Nodes) — strip out a reasoning model's <think> block

Mikey/Text
Resize Image for SDXL (Mikey)

Fit any image into SDXL's 1024² budget for img2img

Mikey/Image
Save Image If True (Mikey)

Save Image If True (Mikey Nodes) — a save node with a gate on it

Mikey/Image
Save Images Mikey (Mikey)

Save Images Mikey — the pack's flagship save node, with filename templating built in

Mikey/Image
Save Images No Display (Mikey)

Save Images No Display (Mikey Nodes) — save without clogging your preview panel

Mikey/Image
Save Image With Prompt Data

Save Image With Prompt Data (Mikey Nodes) — filenames that tell you what you actually typed

Mikey/Image
SaveMetaData (Mikey)

Dump your workflow's prompt and metadata to a text file

Mikey/Meta
SD3 Text Conditioning With Options. One Prompt (Mikey)

SD3 Text Conditioning With Options. One Prompt (Mikey) — ComfyUI Node

Mikey/SD3/Conditioning
Search And Replace (Mikey)

Search And Replace (Mikey) — ComfyUI Node

Mikey/Utils
Seed String (Mikey)

Seed String (Mikey Nodes) — get your seed as text, not just a number

Mikey/Utils
SR Float Prompt Input (Mikey)

SR Float Prompt Input (Mikey) — ComfyUI Node

Mikey/Meta
SR Int Prompt Input (Mikey)

SR Int Prompt Input (Mikey) — ComfyUI Node

Mikey/Meta
SR String Prompt Input (Mikey)

SR String Prompt Input (Mikey) — ComfyUI Node

Mikey/Meta
Style Conditioner (Mikey)

Style Conditioner (Mikey) — ComfyUI Node

Mikey/Conditioning
Style Conditioner Base Only (Mikey)

Style Conditioner Base Only (Mikey) — ComfyUI Node

Mikey/Conditioning
Text 2 Inputs Or 3rd Option Instead (Mikey)

Text 2 Inputs Or 3rd Option Instead (Mikey) — ComfyUI Node

Mikey/Text
Text Combinations 2 (Mikey)

Text Combinations 2 (Mikey) — ComfyUI Node

Mikey/Text
Text Combinations 3 (Mikey)

Text Combinations 3 (Mikey) — ComfyUI Node

Mikey/Text
Text Concat (Mikey)

Join up to five text strings with one delimiter

Mikey/Text
Text Padder (Mikey)

Text Padder (Mikey) — ComfyUI Node

Mikey/Text
Text Preserve (Mikey)

Text Preserve (Mikey) — ComfyUI Node

Mikey/Text
Upscale Tile Calculator (Mikey)

The math node behind clean Ultimate SD Upscale tiles

Mikey/Image
Wildcard And Lora Syntax Processor (Mikey)

Wildcard And Lora Syntax Processor (Mikey Nodes) — both text tricks, resolved in one node

Mikey/Lora
Wildcard OobaPrompt (Mikey)

Wildcard OobaPrompt (Mikey) — ComfyUI Node

Mikey/AI
Wildcard Processor (Mikey)

Wildcard Processor (Mikey Nodes) — turn __filename__ tags into real prompt text

Mikey/Text
Readme

Mikey Nodes

This repository contains custom nodes for ComfyUI.

Prompt With Style

image

Example workflow in the prompt_with_styles.json file and mikey_node_workflow.json

This node allows you to prompt with a style and loras. You can add a lora with <lora:lora_name> or <lora:lora_name:0.8> syntax for a weight of 0.8 as an example.

You can add styles by using the <style:style_name> syntax.

Some of the styles built in are: SAI-Enhance, SAI-Anime, SAI-Photographic, SAI-Digital art, SAI-Comic book, SAI-Fantasy art, SAI-Analog film, SAI-Neonpunk, SAI-Isometric, SAI-Lowpoly, SAI-Origami, SAI-Line art, SAI-Craft clay, SAI-Cinematic, SAI-3d-model, SAI-pixel art, SAI-Texture, photographic, deep-field, analog-film, cinematic, red, documentary, nature-photography, editorial, polaroid, 3d-model, low-poly, modeling-compound, diorama, miniatures, abstract, anime, comic-book, digital-art, fantasy-art, dark-fantasy, oil-painting, watercolor, charcoal, color-pencil, crayon, cross-stitch, felt, origami, scrapbook, isometric, line-art, vector-art, neon-punk, pixel-art, tile-texture, lithography, mosaic, woodblock-print, sticker, stained-glass, tattoo, statue, album-art, wes-anderson, vaporwave, clarendon, gingham, juno, lark, nonagon, kaleidoscope, haunting, glam, mecha, padam, collage, paper-mache, macrame, quilling, pottery, batik, felting, marquetry, wildstyle-graffiti, bubble-graffiti, stencil-graffiti, throw-up-graffiti, tag-graffiti

There is a V1 and V2 Prompt with Style node with different functionality, style selection instead of style syntax, no clip conditioning. Check them out if you like to break your workflow up into more nodes. image

Wildcards

Wildcards are supported using the __word__ syntax. Folder location is comfyui/wildcards You can select more than 1 line from the wildcard by using the syntax 2$$__wildcard__ for 2 lines in this example. You can also add a word to search for in the wildcard file e.g. __wildcard|word__

You can also make sure it selects the same line from the wildcard by using the __!wildcard__ syntax, not the ! before the filename. You can also use __+wildcard__ __-wildcard__ and __*wildcard__ to use the offset + 1 or - 1, or randomly select a different line.

Styles

You can add your own styles to a file named user_styles.json in the root ComfyUI folder. You have to create this file yourself.

The format needs to look like the following example:

{
    "styles": {
        "newspaper": {
        "positive": "newspaper comic strip, panels, black and white",
        "negative": "photograph, color"
        }
    }
}

Image Size Ratios

You can also add your own custom ratios to a file named user_ratios.json in the root ComfyUI folder. You have to create this file yourself.

The format needs to look like the following example:

{
    "ratios": {
        "test": {"width": 1024, "height":  1024}
    }
}

Mikey Sampler and Mikey Sampler Base Only

image image

Example workflow: mikey_node_workflow.json

This is a sampler node as a companion to the Prompt with Style node, to allow for very straightforward image generation with SDXL.

The node uses a base -> refiner -> upscale with model -> base to produce the final image. It has an inbuilt image complexity detection function to make sure there aren't too many steps run on the final base sampler which can scramble faces and other simple areas on a large image.

The Base Only version of the sampler uses a slightly different approach. It uses a base -> base -> upscale with model -> base to produce the final image. The other key difference with the Base Only version is it skips a step in the middle and adds it to the end. This is a trick which adds extra detail to the image. The smooth step number will add even more extra steps to the end. This might be required if you have an image with a plain background and are seeing some spotty effects created by the skip step method. Usually only 1 extra step is required to clean up the spots. You can also go -1 for very busy images for even more detail.

model_name is for the image uspcale model. These can be found at OpenModelDB and place them in the ComfyUI\models\upscale_models directory. I recommend lollipop as it provides a good balanced image that is not too sharp. If you want lots of sharp details, then try the NMKD Superscale or 4x-UltraSharp.

The seed is used by the samplers.

The upscale_by setting is how large you want the final image to be before it runs the last base sampler over the image. A value of 1 will output the original image size. 2 will be 2x the size of the original.

The highres_strength setting allows you to control this last stage and how much detail it adds. Setting of 1 is the sweet spot I found didn't scramble faces in a few test images. Dial it down if you are still getting scrambled images, or turn it up if you want to add more detail.

Mikey Sampler Tiled and Mikey Sampler Tiled Base Only

image

These samplers use a tiled approach to resample the image after the upscale model has upscaled the image, to help enhance the image with more details.

Style Conditioner

image

This chonky node is for injecting the style prompt into your conditioner by averaging the conditioner passed through the node.

A strength value of 0.5 would be even split between the conditioner passed in and the style selected.

Empty Latent Ratio Select SDXL

image

This node allows you to select from a range of different aspect ratios.

Empty Latent Ratio Custom SDXL

image

This node allows you to enter your own aspect ratio or image size from wherever, and it will make it fit under 1024x1024 resolution.

Preset Ratio Selector

image

This node will read an optional user_ratio_presets.json file in the root directory of ComfyUI. This is an example of a preset:

{
    "ratio_presets": {
        "1024x1024 (AR 1:1 / DEC 1.0:1)": {
            "custom_latent_w": 1024,
            "custom_latent_h": 1024,
            "cte_w": 1024,
            "cte_h": 1024,
            "target_w": 4096,
            "target_h": 4096,
            "crop_w": 0,
            "crop_h": 0
        },
}

There is a file created by masslevel included in mikey_nodes directory called ratio_presets.json. It contains all of the recommended resolutions from SAI and the correct clipt text encoder and target sizes. This file will automatically be read and populated into the selection widget.

It is a really powerful and convenient ratio selector, because you can create all sorts of combinations for the latent image size, clip text encoder image size, target size and crop coordinates.

The swap axis option will rotate the dimensions by 90 degrees if set to true.

If use preset seed is set to true, it will use the seed number to select one of the available presets. This can be used to cycle or randomly select presets, which is super convenient.

Ratio Advanced

image

This node is the big brother to Preset Ratio Selector. It let's you select a preset like with Preset Ratio Selector, but there is also lots of options for customisation.

When creating a latent image you need to set the width and height. But the Clip Text Encoder for SDXL Base Model also requires width and height, target width and height, and crop width and height.

This node has options to setup the dimensions for each of these using different methods:

  • Select a ratio from the select widget, or choose custom to enter your own dimensions.
  • If you select custom, you need to fill in the width and height options.
  • If you enter a number into the mult input e.g. cte_mult (clip text encoder) it will multiply the latent width and height to create the width and height for that dimension.
  • If you enter a number into the res input, it will create a width and height that fits into the res^2 image size while maintining the same ratio as the latent width and height.
  • If you enter a number into the fit_size input, it will create a width and height that has the largest dimension equal to fit_size while maintaining the same ratio as the latent width and height.

Resize Image for SDXL

image

This node allows you to resize an image to fit into 1024x1024 resolution. Good for Img2Img workflows.

Batch Resize Image for SDXL

image

Given a path to a folder containing images, it will resize all images in the folder to fit the 1024^2 resolution and feed into the workflow. Careful of folders with lots of images!

Save Image With Prompt Data

This node allows you to save an image with the prompt data in the filename.

The filename will start with a datestamp, then part of the positive prompt.

It will also save the positive prompt and negative prompt to the png data.

Upscale Tile Calculator

image

Made for the Ultimate SD Upscaler to help calcuate tile size to evenly fit inside the larger image and not get weird edges.

The resolution is what is suitable for the model you are using, 1.5: 512, 2.1: 768, SDXL Base: 1024, SDXL Refiner: 768

Wildcard Processor

image

This node is for building a string using your wildcard files.

Add Metadata

image

I want to give a shout-out to masslevel on discord for the great idea to have nodes for metadata.

This node lets you add more metadata to the image that is passed through this node in your workflow. The metadata should be written to the image file in the Save Image node.

The label is the key or label you want to give to the metadata, and the text box is for entering a value. Convert these to inputs if you want to pipe in string values from other nodes.

Save Metadata

This node should pick up the info stored in the prompt and extra_pnginfo data and save it to a txt file

HaldCLUT

This will apply a HaldCLUT to an image to change the colors, which tend to imitate the look of the film or filter. I have included some in this package, but you can find more png files at rawtherapee.com

Image Caption

This node will add a caption bar to the bottom of the image. Useful for adding a prompt or the name of the checkpoint to the image.

If you create a font folder in the base directory of comfyui e.g. C:\ComfyUI\fonts and place ttf files in that folder, the widget will automatically be a drop down selection with the files in that directory. Otherwise it will be a text input for you to put the full path to the font file.

image

Seed String

image

This node creates a random number or Seed. It outputs the seed as a Integer and also a String version which can be used to add to metadata or wherever you want.

Int to String

Converts an integer to a string.

Float to String

Converts a float to a string.

Additional Nodes

The following nodes are newly added and not yet fully documented above:

  • Range Float / Range Integer – Generate numbers from a given range using the seed offset.
  • Save Image If True – Saves the image only when a given save condition is met.
  • Batch Crop Image / Batch Crop Resize Inplace – Process images in batches with cropping (and optional resizing).
  • Batch Load Images / Load Image Based on Number – Load images from a directory either as a batch or based on a seed index.
  • LoraSyntaxProcessor / WildcardAndLoraSyntaxProcessor – Process LoRA and wildcard syntax in prompts.
  • Prompt With SDXL – An alternative prompt node tailored for SDXL using style and prompt adjustments.
  • Style Conditioner Base Only – Injects style prompt conditioning into the base clip only.
  • Mikey Sampler Tiled Advanced / Mikey Sampler Tiled Advanced Base Only / Mikey Sampler Base Only Advanced – Advanced variations of the sampler nodes with refined control.
  • MikeyLatentTileSampler / MikeyLatentTileSamplerCustom – Perform tiling in latent space for upscaling.
  • FaceFixerOpenCV – Detect and fix faces using OpenCV.
  • SearchAndReplace – Searches a text for placeholders and replaces them.
  • FileNamePrefix / FileNamePrefixDateDirFirst – Generate filename prefixes for saving images with metadata.
  • ImageBorder / ImagePaste – Add borders to or paste images together.
  • TextCombinations2 / TextCombinations3 / Text2InputOr3rdOption – Combine multiple text inputs in various ways.
  • Checkpoint Loader Simple Mikey / CheckpointHash – Load checkpoints and compute their file hashes.
  • SRStringPromptInput / SRIntPromptInput / SRFloatPromptInput – Add prompt-related inputs with different data types.
  • TextPreserve / TextConcat / RemoveTextBetween – Manipulate and combine text strings.
  • OobaPrompt / WildcardOobaPrompt / LMStudioPrompt – Prompt processing nodes that integrate with external LLM services.
  • EvalFloats – Evaluate mathematical expressions given two floats.
  • ImageOverlay / CinematicLook / MosaicExpandImage – Various nodes for merging and stylizing images.
  • GetSubdirectories – Retrieve subdirectories from a given directory.
  • TextPadderMikey – Pad text to a fixed length.
  • SD3TextConditioningWithOptionsOnePrompt – Text conditioning with additional configurable options.
  • ModelMergePixArtSigmaXL2_1024MS / ModelMergeTrainDiff / ModelMergeTrainDiffPixartSigmaXL2_1024MS – Nodes for merging models.
  • CheckpointSaveModelOnly – Save checkpoints without additional output.

Feel free to expand the descriptions as you update each node.

Installation

To use these nodes, simply open a terminal in ComfyUI/custom_nodes/ and run:

git clone https://github.com/bash-j/mikey_nodes

License

This project is licensed under the MIT License - see the LICENSE file for details.