Commit Graph
4 Commits
Author SHA1 Message Date
87d9525176 feat(resolver): opt-in semantic nearest-neighbour fallback (#34) (#140)
Closes #114, #115, #116, #117.

- Deterministic, offline, dependency-free char-ngram embedding backend + config
  section (semantic.enabled default false, min_similarity, backend).
- Committed embedding index (data/kb_embedding_index.json) mapping vectors to real
  KB entry ids only; built by scripts/build_embedding_index.py, loaded once/cached.
- Resolver falls back to the nearest entry on a deterministic miss when enabled,
  accepting >= min_similarity and emitting SC0020; NSFW-gated neighbours are
  skipped. Disabled => byte-identical to before.
- Guarantee tests: deterministic lookup always wins (exact hit never queries the
  index), fallback emits only KB tags (no invention), identical input => identical
  output. SC0020 registered.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 18:23:38 +02:00
092f23661c chore(config): wire remove_duplicate_tags, drop inert trim_empty_outputs (#135) (#136)
remove_duplicate_tags now gates the Resolver's post-expansion dedup (SC0007);
trim_empty_outputs was inert since the V1.1 category removal and is dropped
from config, schema, node, and default_config.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 15:47:32 +02:00
a5dd06043f fix(nodes)+docs: expose include_nsfw in Config node, align timeout, sync README (#83)
Audit follow-ups touching shipped code:
- Configuration node now exposes resolver_include_nsfw (the NSFW gate we added
  was unreachable from ComfyUI) and its analyzer_timeout default is aligned to
  300s to match the Scene Analyzer node.
- README: note the large Danbooru-derived KB, clarify the determinism scope
  (compiler core deterministic; LLM analysis is the one non-deterministic step),
  add the V4 (consolidation) roadmap entry, and an AI-assistance disclaimer.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 22:22:27 +02:00
8b26c1e67f feat(nodes): add the Configuration ComfyUI node (#26) (#70)
Add nodes/configuration_node.py: ConfigurationNode, a thin adapter that
centralizes compiler configuration (MASTER_SPEC §20, §23).

- Exposes all §23.2 options as node inputs (analyzer model/temperature/
  max_retries/timeout + optional system_prompt; resolver knowledge_base/
  strict_mode/allow_aliases/expansion_enabled/max_expansion_depth; validator
  allow_unknown_fields; prompt_builder target/separator/trim_empty_outputs/
  remove_duplicate_tags; debug enabled/level).
- Builds a Config via Config.from_json and outputs (config, errors) as a
  COMPILER_CONFIG. The Validator, Resolver, and Prompt Builder nodes already
  accept this via their optional config input, so behaviour changes without
  editing the workflow. No compiler logic in the node.
- Registered as SceneCompilerConfiguration ("Configuration").

Tests: metadata/inputs, defaults reproduce Config(), inputs flow into the config,
system-prompt override + omission, all debug levels valid, and registration.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 13:34:27 +02:00