ComfyUI_hus_utils Introduction
ComfyUI_hus_utils is a collection of ComfyUI nodes the author created to make certain workflow tasks easier and to recreate some behaviors familiar from A1111. The nodes help you reuse prompt styles, pull settings from other nodes, create descriptive image filenames, and compare changes to a workflow across a repeatable sequence of seeds.
You can use the nodes individually. For example, 3way Prompt Styler helps organize SDXL prompts, while Batch State helps you compare the effect of changing a prompt, CFG value, or step count without losing track of the seed sequence.
How ComfyUI_hus_utils Works
A ComfyUI workflow passes information between connected nodes. ComfyUI_hus_utils adds small tools that read, transform, or describe that information:
- Read a setting: Fetch widget value takes a value shown in another node, such as a setting you want to include elsewhere in your workflow.
- Apply a reusable prompt style: 3way Prompt Styler reads a style from a CSV file and combines it with your prompt inputs.
- Create a short identifier: Text Hash turns text into a consistent short string that can help distinguish one prompt from another.
- Track workflow changes: Batch State checks whether workflow inputs or links have changed. It can restart a seed-counting sequence when you make an adjustment.
Think of these nodes as helpers around your image-making process. They do not replace your sampler or model; they make prompts, settings, comparisons, and output names easier to manage.
ComfyUI_hus_utils Features
Fetch widget value
Fetch widget value retrieves the value of a widget named widget_name from a node named node_name. You can identify the source node by its type, title, or S&R name.
The multiple setting controls what happens when more than one node matches:
- Set it to
noto use the first matching node. - Set it to
yesto return all matching values as one string, separated by,.
This is useful when you want to reuse a setting or include it in descriptive output text without entering it again. The node was extracted from Math Expression in ComfyUI-Custom-Scripts.
3way Prompt Styler
3way Prompt Styler loads reusable styles from a file named styles.csv in the extension’s source directory, usually ComfyUI/custom_nodes/ComfyUI_hus_utils/. It was adapted from Load Styles CSV.
Each style has four columns:
| Column | Purpose |
|---|---|
| Style name | Identifies the style you want to use. |
| Prompt G | Supplies text for the SDXL G prompt. Any {prompt} placeholder is replaced with your G input. |
| Prompt L | Is appended to your L input. |
| Negative prompt | Is appended to your negative-prompt input. |
For example, a Prompt G style containing {prompt} can place your subject inside a longer, reusable instruction. Prompt L and the negative prompt work differently: their style text is appended to the corresponding inputs. Keep that distinction in mind when writing styles, because it affects the resulting prompt.
The extension includes an _example styles.csv_ file showing the expected format. The G and L split is intended for SDXL prompting.
Text Hash
Text Hash produces a SHA-256 hash of its input and returns the first length characters. In everyday use, it gives you a compact identifier for a piece of text.
For instance, including a prompt hash in an image filename can help you tell outputs from different prompts apart. The length setting determines how many characters of the hash you keep: a shorter value makes a shorter identifier, while a longer value keeps more of it.
Date Time Format
Date Time Format returns the current date, time, or both. Its format input uses strftime formatting, so you can choose how the result is displayed. This can help you label or organize outputs by when they were created.
Batch State
Batch State checks whether a workflow’s inputs or links have changed. It provides three outputs:
changedis1when a change is detected and0otherwise.hashrepresents the current workflow state.countincreases each time the state remains unchanged and resets to0when it changes.
One practical use is to add count to a seed input whose seed node is set to fixed. Each click of Queue Prompt then advances through consecutive seeds. If you change an input, the count resets, letting you run the same seed sequence again with the new setting. This makes it easier to compare, for example, how a CFG or step-count change affects the same set of images.
The author notes that a seed node set to randomize, or to another setting besides fixed, changes its input value on every run. Batch State then sees a change each time, so count remains at 0. Use a fixed seed when you want the repeatable comparison described above.
Debug Extra
Debug Extra exposes some internal information for developing custom nodes. It is primarily a development aid rather than a prompt-styling or image-comparison tool.
Example workflow
The author describes an example workflow based on Sytan SDXL ComfyUI. It demonstrates two ways to use the utility nodes together:
- Build filename prefixes from a prompt hash, prompt style, seed, model name, and base and refiner sampler, scheduler, steps, and CFG settings.
- Generate a fixed sequence of seeds that restarts whenever an input changes.
The example workflow uses nodes from WAS Node Suite, ComfyUI-Custom-Scripts, and tinyterraNodes. The author indicates there may be other dependencies that are not listed.
Troubleshooting ComfyUI_hus_utils
Batch State’s count stays at 0
- Check the seed node used by your workflow.
- For a repeatable seed sequence, set it to fixed.
- Queue the unchanged workflow again and check whether
countincreases.
If the seed node randomizes its value on every run, Batch State detects a changed input and resets the count each time.
My seed sequence starts over unexpectedly
Batch State resets count when it detects a change to the workflow’s inputs or links. Check whether you edited a setting, changed a connection, or have an input that changes on each run. A restart is expected after an intentional change and is what allows you to compare the new settings against the earlier seed sequence.
A prompt style does not combine with my text as expected
Check the style’s four columns in styles.csv. In Prompt G, {prompt} marks where your G input will be inserted. Prompt L and Negative prompt are appended to their respective inputs instead. Compare your entry with the included _example styles.csv_ file.
Fetch widget value returns more or fewer values than expected
Check node_name and widget_name, then review the multiple setting. Use no for the first matching node or yes to combine values from all matching nodes into a comma-separated string.
Frequently asked questions
Does the extension include image-generation models?
The provided documentation describes utility nodes, not additional image-generation models. The example workflow uses a model name in its filename prefix, but no models supplied by this extension are listed.
Which node should I use to compare the same seeds after changing a setting?
Use Batch State with a fixed seed, adding its count output to the seed input as described above. Changing an input resets the count so the sequence can begin again.
Can I use a style without SDXL’s separate G and L prompts?
The documented 3way Prompt Styler specifically separates positive prompting into G and L for SDXL. The provided information does not describe behavior for other prompt arrangements.
Learn More about ComfyUI_hus_utils
- Sytan SDXL ComfyUI is the basis for the example workflow described by the author.
- ComfyUI-Styles_CSV_Loader is the source from which 3way Prompt Styler was adapted.
- ComfyUI-Custom-Scripts contains the Math Expression node from which Fetch widget value was extracted and is also listed as an example-workflow dependency.
- WAS Node Suite and tinyterraNodes are additional node collections named as dependencies of the example workflow.
