How yawiii/comfyui-prompt-assistant works
ComfyUI Prompt Assistant is a custom-node extension for prompt editing, translation, image/video captioning, and related workflow utilities. The main user journey is to interact with an assistant or node in ComfyUI, submit text or media for processing, and receive generated or translated content in the workflow. The README documents additional UI features including tags, history, Markdown and node-document translation. Connections below rely on sampled excerpts, SOURCE INDEX references, and README statements; unsampled subsystem internals are represented conservatively.
Main entry points: vlm.py Vision model service · PromptAssistant.js Prompt assistant · server.py Extension API · llm.py Language model service
Components 22
ComfyUI Interface
- Prompt assistant
js/modules/PromptAssistant.js - Assistant container
js/modules/AssistantContainer.js - Tag library
js/modules/tag.js - Prompt history
js/modules/history.js - Image caption UI
js/modules/imageCaption.js - Document translation
js/modules/nodeHelpTranslator.js - Markdown translation
js/utils/markdownNoteTranslate.js - API client
js/services/api.js
Workflow Nodes
- Prompt optimization
node/expand_node.py - Translation node
node/translate_node.py - Image caption node
node/image_caption_node.py - Video caption node
node/video_caption_node.py - Kontext presets
node/kontext_preset_node.py - Node foundations
node/base/base_node.py
Request Backend
- Extension API
server.py - Language model service
services/llm.py - Vision model service
services/vlm.py - Baidu translation
services/baidu.py - Thinking controls
services/thinking_control.py
Configuration
- Settings and presets
config_manager.py
Other components
- ComfyUI user
- Model provider
Connections 31
- ComfyUI user → Prompt assistant: edits prompts
README.md - Prompt assistant → Tag library: inserts tags
js/modules/PromptAssistant.js - Prompt assistant → Prompt history: uses history
js/modules/PromptAssistant.js - Prompt assistant → API client: sends requests
js/modules/PromptAssistant.js - Prompt assistant → Assistant container: uses container
js/modules/PromptAssistant.js - Image caption UI → API client: submits images
js/modules/imageCaption.js - Document translation → API client: requests translation
- Markdown translation → API client: requests translation
- ComfyUI user → Prompt optimization: runs node
README.md - ComfyUI user → Translation node: runs node
README.md - ComfyUI user → Image caption node: runs node
README.md - ComfyUI user → Video caption node: runs node
README.md - ComfyUI user → Kontext presets: uses preset
README.md - Prompt optimization → Node foundations: uses foundation
node/expand_node.py - Translation node → Node foundations: uses foundation
- Image caption node → Node foundations: uses foundation
node/image_caption_node.py - Video caption node → Node foundations: uses foundation
node/video_caption_node.py - API client → Extension API: calls backend
js/services/api.js - Extension API → Language model service: dispatches requests
server.py - Extension API → Vision model service: dispatches requests
server.py - Extension API → Baidu translation: dispatches translation
server.py - Prompt optimization → Language model service: requests generation
node/expand_node.py - Image caption node → Vision model service: requests analysis
node/image_caption_node.py - Video caption node → Vision model service: requests analysis
node/video_caption_node.py - Language model service → Settings and presets: loads settings
services/llm.py - Vision model service → Settings and presets: loads settings
services/vlm.py - Extension API → Settings and presets: updates configuration
server.py - Language model service → Thinking controls: selects controls
services/llm.py - Vision model service → Thinking controls: selects controls
services/vlm.py - Language model service → Model provider: sends model request
- Vision model service → Model provider: sends model request