-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
33 lines (28 loc) · 1.3 KB
/
Copy path__init__.py
File metadata and controls
33 lines (28 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""ComfyUI-JSONPrompt — generate guaranteed-valid JSON image prompts with a tiny local LLM.
A small GGUF model (e.g. Qwen2.5-0.5B-Instruct) is run through llama-cpp-python with a
JSON-schema-derived grammar, so the output can never be malformed JSON. The model is loaded
once and cached, so per-generation cost is inference only.
"""
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
# Groq (cloud) backend — optional. Registered in a guard so a failure here can never stop the
# local node from loading.
try:
from .groq_nodes import (
NODE_CLASS_MAPPINGS as _GROQ_CLASSES,
NODE_DISPLAY_NAME_MAPPINGS as _GROQ_NAMES,
)
NODE_CLASS_MAPPINGS.update(_GROQ_CLASSES)
NODE_DISPLAY_NAME_MAPPINGS.update(_GROQ_NAMES)
except Exception as e: # pragma: no cover
print(f"[ComfyUI-JSONPrompt] Groq node not loaded: {e}")
# DeepSeek (cloud) backend — optional, same guard pattern.
try:
from .deepseek_nodes import (
NODE_CLASS_MAPPINGS as _DS_CLASSES,
NODE_DISPLAY_NAME_MAPPINGS as _DS_NAMES,
)
NODE_CLASS_MAPPINGS.update(_DS_CLASSES)
NODE_DISPLAY_NAME_MAPPINGS.update(_DS_NAMES)
except Exception as e: # pragma: no cover
print(f"[ComfyUI-JSONPrompt] DeepSeek node not loaded: {e}")
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]