# Both of these dependencies are for llm nodes. Sage Utils will check if they were imported, and # will not show nodes that require them if they are not installed. # If you want to use LLM nodes, you must install one of these, depending on your preference. # LLM support is a work in progress, and subject to revision. ollama>=0.5.1 lmstudio dynamicprompts
Sage Utils is a comprehensive suite of custom nodes and integrated UI features for ComfyUI. It provides:
The node suite supports A1111/Civitai metadata formats, while the UI features provide modern, accessible interfaces for AI-assisted workflow creation.
Model information downloaded from Civitai is cached locally in sage_cache_hash.json and sage_cache_info.json for fast access and reporting. These are located in comfyui/user/default/SageUtils/.
Access AI language models directly within ComfyUI for prompt generation, refinement, and creative assistance:
Wildcard and tag-based system for constructing complex prompts with LLM enhancement:
__category__ syntax for dynamic, randomized prompt generation📖 Complete Prompt Builder Guide
Seamless data flow between all components:
An enhanced Save Image node with extra inputs for param_metadata and extra_metadata, allowing you to embed custom metadata under parameters (A1111 style) and extra. Includes switches to control inclusion of standard ComfyUI metadata.
Nodes for assembling metadata strings from various workflow inputs. The “Lite” version writes a more minimal set of metadata.
Loads a checkpoint and outputs model_info, including hash and Civitai data. Model info is cached for quick access and reporting.
For loading UNET models with metadata support.
Build and manage Lora stacks with toggles and weights. Chain these together for multiple LoRAs.
Same as above, except with spots for three loras instead of one, and switches to toggle them on and off.
Loads all Loras in a stack for use in your workflow.
Loads both a checkpoint and a LoRA stack in one node.
Extracts Civitai keywords from a LoRA stack.
Retrieves Civitai info, URLs, and sample images for the last LoRA in a stack.
Outputs sampler settings for use in metadata or workflow logic.
A KSampler with a good deal of the settings broken off into a separate node, both for streamlining and so that you can hook the Sampler Info node up to one of the metadata nodes. You can also hook Sampler Info to more than one KSampler.
Same as above, with two differences. First off, it has a VAE Decode node built in, and outputs both a latent and an image. Second, if you hook up a Tiling Info node to it, it will do a tiled vae decode instead. This input is optional.
KSampler with an audio decoder varient of the above nodes.
Accepts a CLIP model and positive/negative prompts, returning both conditionings and the input text. Automatically zeros conditioning if no text is provided. Can also clean up the prompts.
Outputs zeroed conditioning for advanced prompt control.
Loads an image and outputs its size and embedded metadata.
Like an Empty Latent Image node, but passes width/height for easier wiring. Includes a switch for SD3 compatibility.
Simple logic node to select between two inputs based on a boolean.
Computes the SHA256 hash of a file or input.
Checks for missing or duplicate entries in the model cache, with options to clean up ghost entries and identify duplicates.
Scans and hashes all Loras and checkpoints, queries Civitai, and generates sorted model and LoRA lists for reporting and organization.
ollama pull llama3.2See the LLM Tab Guide for detailed setup instructions for each provider.
See the Prompt Builder Guide for advanced usage and best practices.
Use Load Checkpoint w/ Metadata (or Load Diffusion Model w/ Metadata) to load your model and output model_info.
The model_info output can be connected to Construct Metadata or Model + LoRA Stack Loader.
Build your LoRA stack by chaining Simple LoRA Stack nodes.
Connect the output to LoRA Stack Loader (to load LoRAs) and/or to Construct Metadata (to include LoRA info in metadata).
Use Sampler Info to output sampler settings.
Connect Sampler Info to both your sampler node (e.g., KSampler w/ Sampler Info or KSampler + Tiled Decoder) and to Construct Metadata for metadata inclusion.
Use Empty Latent Passthrough to generate and pass image dimensions.
Connect all relevant metadata outputs (model info, LoRA stack, sampler info, image size, etc.) to Construct Metadata or Construct Metadata Lite.
Feed the resulting metadata string into the param_metadata input of Save Image w/ Added Metadata, and any other text you want in the metadata can be hooked up to extra_metadata.
Use Load Image w/ Size & Metadata to inspect images.
Use LoRA Stack → Keywords and Last LoRA Info for keyword extraction and LoRA details.
Use Cache Maintenance and Model Scan & Report for cache management and reporting.
Example workflows are available in the example_workflows/ folder. In ComfyUI, you can also access these directly: open the workflow menu, choose Browse Templates, and select comfyui_sageutils on the left. All the example workflows are there and can be easily used as templates for your own workflows.
“`bash
cd ComfyUI/custom_nodes/
“`
“`bash
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
“`
“`bash
cd ComfyUI_SageUtils
pip install -r requirements.txt
“`
The sidebar tabs (LLM Chat, Prompt Builder) will appear automatically in the ComfyUI interface.
SageUtils uses a dedicated logging system that is separate from ComfyUI’s logging. You can control log verbosity using the SAGEUTILS_LOG_LEVEL environment variable:
# Show detailed debug information
SAGEUTILS_LOG_LEVEL=DEBUG python main.py
# Show only warnings and errors (quieter)
SAGEUTILS_LOG_LEVEL=WARNING python main.py
# Default level is INFO (normal operation messages)
python main.py
Available log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL
All SageUtils logs are prefixed with [SageUtils.*] for easy identification.
For developers, see the Logging Guide for information on using the logger in your code.
If you have ideas, find bugs, or want to contribute, feel free to open issues or pull requests. If you find this project useful, consider supporting via Ko-fi.