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.

All nodes use ComfyUI’s stable V3 API (comfy_api.v0_0_2): io.ComfyNode, define_schema, classmethod execute, io.NodeOutput, and a ComfyExtension entrypoint.


Node overview

Resolution helpers

  • GR85_ImageDimensionResizer (ImageDimensionResizer, category GR85/Resolution)

    • Computes new width/height based on a selected target resolution while preserving the original pixel count and aspect ratio.
  • GR85_ImageSizer (ImageSizer, category GR85/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).
  • GR85_ImageSizerAll (ImageSizerAll, category GR85/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, category GR85/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, category GR85/Prompt/Selection)

    • Selects one string from up to 10 inputs based on a seed. Only non-None inputs are considered, and the seed is used with modulo to choose the index.
  • GR85_SimpleWildcardPicker (SimpleWildcardPicker, category GR85/Prompt/Wildcards)

    • Expands {a|b|c}-style wildcards (including nested braces) using a seeded RNG.
  • Tag injector nodes (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. elements and stuff).
    • TagInjectorLarge – larger template that injects multiple semantic placeholders such as __location__, __weather__, __style__, etc.

Random / utility nodes

  • GR85_NextSeed (NextSeed, category GR85/Random/Seed)

    • Given a seed, produces a new random seed in the full 64‑bit range.
  • GR85_RandomFloat (RandomFloat, category GR85/Random/Numbers)

    • Generates a random float in [min_value, max_value], with configurable decimal precision, seeded for reproducibility.
  • GR85_RandomInt (RandomInt, category GR85/Random/Numbers)

    • Generates a random integer in [min_value, max_value], seeded for reproducibility.

Architecture and loading

comfy_entrypoint() returns GR85Extension, whose asynchronous get_node_list() exposes all 13 nodes. It intentionally does not export legacy node mappings, so the current ComfyUI loader takes the V3 entrypoint path.

Requirements

  • ComfyUI 0.33.0 or newer
  • Python 3.12 or newer (Python 3.13 recommended by ComfyUI)
  • No additional Python packages
S
Description
No description provided
Readme
140 KiB
Languages
Python 100%