ComfyUI Extension: comfyui_gr85
Nodes:Image Dimension Resizer, Image Sizer, Random Ratio, Show Text, Random Title Character, Random Wildcard Tag Picker, Random Show Atm Loc Outfit, Contains Word, Elements Concatenator, ...
Custom Nodes (37)
- Contains Word
- CTGPhrases
- CTGPhrasesSimple
- Filter And Combine Masks
- Florence2RunCTPG (GR85)
- Florence2toCoordinatesGR85
- Flux Attention Seeker 2
- Flux Attention Seeker 3
- Flux Attention Seeker Generator
- Flux Model Merge Parameters
- Image Dimension Resizer
- Image Sizer
- Image Sizer All
- Integer Sequence Modifier
- Int To String
- Island Mask Generator
- MaskBatchToSEGS
- Mask Connect MST
- Mask Splitter
- Next Seed
- Paste By Mask Gr85
- Random Float
- Random Int
- Randomized Mask Transform
- Random Ratio
- Sam2Segmentation (GR85)
- Save Image File
- Save Text File
- Seed Based Output Selector
- Show Text
- Simple Wildcard Picker
- String Safe
- Tag Injector
- Tag Injector Duo
- Tag Injector Large
- Tag Injector Single
- Vertical Wildcard Picker
README
comfyui_gr85 – Custom Nodes for ComfyUI
This repository provides a small collection of GR85-flavoured custom nodes for ComfyUI. It includes utilities for working with image dimensions, randomization, prompt manipulation, and seed utilities.
The implementation is being migrated from the legacy INPUT_TYPES / RETURN_TYPES API to the modern comfy_api.latest schema-based API (io.ComfyNode, define_schema, execute, and ComfyExtension).
Currently Simple Wildcard Picker has been migrated fully to the new API; other nodes still use the classic style.
Node overview
Resolution helpers
-
GR85_ImageDimensionResizer (
ImageDimensionResizer, categoryGR85/Resolution)- Computes new width/height based on a selected target resolution while preserving the original pixel count and aspect ratio.
-
GR85_ImageSizer (
ImageSizer, categoryGR85/Resolution)- Rescales to a target aspect ratio with orientation (
original/landscape/portrait) and snaps the result to a given tolerance (e.g. multiples of 16).
- Rescales to a target aspect ratio with orientation (
-
GR85_ImageSizerAll (
ImageSizerAll, categoryGR85/Resolution)- Takes a pixel budget and aspect ratio components and returns new dimensions that match the pixel count and orientation, adjusted to a given tolerance.
-
GR85_RandomRatio (
RandomRatio, categoryGR85/Resolution)- Given two width/height pairs, samples a random aspect ratio between their ratios and returns it as integer width/height components.
Prompt helpers
-
GR85_SeedBasedOutputSelector (
SeedBasedOutputSelector, categoryGR85/Prompt/Selection)- Selects one string from up to 10 inputs based on a seed. Only non-
Noneinputs are considered, and the seed is used with modulo to choose the index.
- Selects one string from up to 10 inputs based on a seed. Only non-
-
GR85_SimpleWildcardPicker (
SimpleWildcardPicker, categoryGR85/Prompt/Wildcards)- New implementation (v3 API):
- Implemented as an
io.ComfyNodeusingdefine_schemaandexecute. - Inputs:
prompt(multiline string)seed(integer)
- Behavior: expands
{a|b|c}-style wildcards (with support for nested braces) using a seeded RNG so results are reproducible.
- Implemented as an
- New implementation (v3 API):
-
Tag injector nodes (all classic API for now, category
GR85/Prompt/Tags)- TagInjectorSingle – injects a single tag into a template using placeholder names like
__elements__. - TagInjectorDuo – same idea, but for two tags (e.g.
elementsandstuff). - TagInjectorLarge – larger template that injects multiple semantic placeholders such as
__location__,__weather__,__style__, etc.
- TagInjectorSingle – injects a single tag into a template using placeholder names like
Random / utility nodes
-
GR85_NextSeed (
NextSeed, categoryGR85/Random/Seed)- Given a seed, produces a new random seed in the full 64‑bit range.
-
GR85_RandomFloat (
RandomFloat, categoryGR85/Random/Numbers)- Generates a random float in
[min_value, max_value], with configurable decimal precision, seeded for reproducibility.
- Generates a random float in
-
GR85_RandomInt (
RandomInt, categoryGR85/Random/Numbers)- Generates a random integer in
[min_value, max_value], seeded for reproducibility.
- Generates a random integer in
Architecture and loading
This extension supports both:
- Legacy discovery via
NODE_CLASS_MAPPINGS/NODE_DISPLAY_NAME_MAPPINGSin__init__.py(for most nodes). - Modern discovery via
comfy_api.latestand aComfyExtensionentrypoint (forSimpleWildcardPicker).
The root __init__.py provides:
NODE_CLASS_MAPPINGSandNODE_DISPLAY_NAME_MAPPINGSfor the classic nodes.GR85Extension(ComfyExtension)with:get_node_list()returning the list of newio.ComfyNodenodes.
async def comfy_entrypoint()which ComfyUI calls to load the extension.
Migration guide
1. Simple Wildcard Picker
What changed
- Previously,
SimpleWildcardPickerwas a classic custom node defined with:INPUT_TYPESRETURN_TYPES,RETURN_NAMES,FUNCTION,CATEGORY- Registration via
NODE_CLASS_MAPPINGS["GR85_SimpleWildcardPicker"]in__init__.py.
- That legacy implementation and registration have been removed.
- A new implementation now exists:
- Class:
SimpleWildcardPicker(io.ComfyNode)innodes/prompt/simple_wildcard_picker.py. - Schema:
define_schema()usingio.Schema,io.String.Input,io.Int.Input,io.String.Output. - Execution:
execute()returns anio.NodeOutput. - Registration: via
GR85Extension.get_node_list()andcomfy_entrypoint(). - Node ID: still
GR85_SimpleWildcardPicker(nov3suffix), display name"Simple Wildcard Picker".
- Class:
Behavior compatibility
- The wildcard expansion logic has been preserved:
- Same
{a|b|c}syntax. - Nested braces are supported.
- A seeded RNG (
Random(seed)) is used for reproducible choices.
- Same
- The internals were refactored into a helper function (
_process_wildcards) used by the newexecute()method.
Impact on existing workflows
-
Graphs that reference node ID
GR85_SimpleWildcardPickershould continue to work, but they now use the new schema-based node. -
Code or tooling that relied on:
NODE_CLASS_MAPPINGS["GR85_SimpleWildcardPicker"], or- the legacy
INPUT_TYPES/FUNCTIONshape ofSimpleWildcardPicker
will need to be updated to work with the new
io.ComfyNodeAPI and extension-based discovery.
How to update custom integrations
- Instead of importing and introspecting the legacy class, treat it as a standard
io.ComfyNode:- Use its schema via
SimpleWildcardPicker.define_schema(). - Expect
execute(prompt, seed)to be a classmethod returningio.NodeOutput.
- Use its schema via
- Do not rely on
NODE_CLASS_MAPPINGSfor this node anymore; it is no longer present there.
2. Other nodes (classic API)
- All other GR85 nodes still use the classic:
INPUT_TYPESRETURN_TYPES/RETURN_NAMESFUNCTION/ instance methodsNODE_CLASS_MAPPINGS/NODE_DISPLAY_NAME_MAPPINGS
- They will continue to behave as before.
Planned direction
- Over time, these nodes can be migrated in the same style as
SimpleWildcardPicker:- Introduce an
io.ComfyNodeimplementation withdefine_schema+execute. - Register it via
GR85Extension.get_node_list(). - Optionally remove the old mapping entry once you are comfortable with the migration.
- Introduce an
If you want to migrate another specific node (e.g. GR85_SeedBasedOutputSelector or one of the latent utilities), follow the same pattern as SimpleWildcardPicker and update the extension’s get_node_list() accordingly.