3.4 KiB
3.4 KiB
PromptStyler Maintainer Notes
This document is for maintainers. It tracks architecture, pack behavior, and the rules that matter when changing runtime style resolution.
Architecture
Runtime surface:
nodes.py: ComfyUI node definition and input/output wiringstyle_library.py: shared style loading, indexing, search, filtering, prompt composition, and legacy snapshot generation
Maintainer tooling:
tools/validate_styles.py: strict schema and uniqueness validationtools/audit_styles.py: consistency audit and quality checkstools/add_styles.py: user/custom pack helpertools/generate_style_packs.py: curated pack generation plus legacy snapshot refreshtools/sync_legacy_styles.py: regeneratestyles/styles_v1.jsonfrom merged packstools/version_sync.py: check or write release metadata derived fromVERSIONSTYLE_TAXONOMY.md: pack purpose, target size, and routing rules for future style additions
Data sources:
styles/packs/*.json: primary runtime sourcestyles/styles_v1.json: generated compatibility snapshot
Load Policies
style_library.py exposes two load modes:
strict: fail on malformed files or required-field issueslenient: warn and skip unusable files so the runtime node can stay available
Use strict in maintainer tooling and CI.
Use lenient in the ComfyUI runtime node.
Runtime Resolution Model
The node resolves one base style and optionally one overlay style.
Base style resolution modes:
dropdownidsearch
Search ranking order:
- exact id match
- exact name match
- token matches across id, name, category, and tags
Search filters are applied before scoring:
category_hinttag_hint
If multiple candidates tie for the best score, resolution fails with the top candidates listed.
Prompt Composition Rules
Recommended composition model:
- base style
- optional color-grade overlay
- optional search-driven style lookup
Default phrase-based variant:
style_strength=subtle: first 3 prefix phrases and first 3 suffix phrasesstyle_strength=normal: first 6 prefix phrases and first 6 suffix phrasesstyle_strength=strong: all phrasesdedupe_mode=smart: remove only style-added duplicates, never collapse the raw user promptdedupe_mode=off: preserve all style phrases in original order
Overlay rule:
overlay_style_idmust resolve to a category starting withColor Grade- the overlay contributes suffix-only styling
Variant rule:
template_variant=defaultuses phrase-based composition- model-specific variants use the style's model entry when available and fall back to
defaultotherwise
Pack Authoring Rules
Required fields per style:
idnamedefault.prefixdefault.suffix
Conventions:
idmust be unique andsnake_case- phrase-based text should use comma+space separators
- keep style text subject-agnostic unless the style itself is explicitly subject-specific
- avoid photo/cinema gear terms in curated styles
Release Metadata
Version metadata flow:
- edit
VERSION - run
python tools/version_sync.py write - CI enforces that
VERSION,__init__.py, and.release-please-manifest.jsonare aligned
Maintenance Checklist
When changing curated style packs:
- regenerate or update the packs
- run
python tools/validate_styles.py - run
python tools/audit_styles.py - run
python tools/sync_legacy_styles.pyif needed - update
README.mdwhen user-visible behavior changed - update
CHANGELOG.md