6 Commits
Author SHA1 Message Date
f2027a89f8 feat(config)!: trim Configuration inputs and rewrite tooltips (#150)
Remove settings the user should not have to touch, and make every tooltip
plain-language:

- knowledge_base path: removed; the Knowledge Base ships in the package, so the
  path is fixed rather than a prompted input.
- prompt_target: removed (reserved; to be replaced in V3).
- prompt_separator: removed; always ',' this version. Both keep their compiler
  defaults, just no longer exposed as node inputs.
- analyzer_system_prompt (Configuration) and system_prompt (Scene Analyzer):
  removed. A user-authored system prompt is not UX-friendly; the built-in analyzer
  prompt is always used.
- Rewrite all node tooltips in plain language reflecting the current nodes.

Example workflow and node tests updated; docs/nodes.md refreshed.

BREAKING CHANGE: the Configuration node's knowledge_base, prompt_target,
prompt_separator, and analyzer_system_prompt inputs and the Scene Analyzer's
system_prompt input are removed.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 17:37:28 +02:00
bc0edb1827 feat(nodes)!: fold Knowledge Base Loader into the Configuration node (#149)
The Knowledge Base directory was entered in two places — the Configuration node's
knowledge_base path and the Knowledge Base Loader node's path — a duplication with
no benefit. Remove the Knowledge Base Loader node and have the Configuration node
load the Knowledge Base itself, emitting it on a new knowledge_base output wired
into the Resolver.

- New nodes/kb_loading.py holds the shared, process-wide load-once cache and
  package-relative path resolution (extracted from the deleted loader node).
- Configuration node: gains a knowledge_base_reload input and a KNOWLEDGE_BASE
  output; RETURN is now (config, knowledge_base, warnings, errors). A KB load
  failure surfaces on errors while the config is still emitted (the Analyzer and
  Validator do not need the KB).
- Remove SceneCompilerKnowledgeBaseLoader from the node registrations.
- Rebuild the example workflow to wire Configuration.knowledge_base -> Resolver.
- Docs (README, docs/nodes.md) updated; tests moved to test_kb_loading.py.

BREAKING CHANGE: the Knowledge Base Loader node is removed. Workflows that used it
must load the Knowledge Base via the Configuration node's knowledge_base output.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 17:05:53 +02:00
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