Code Reference
Welcome to the NodeBox technical reference. Here you'll find a high-level overview, module documentation, and API details to help you extend or debug the project.
Architecture Overview
Main Application
File: main.py
Purpose: Launches UI, loads fonts, applies styles, starts Ollama
Automation Engine
Purpose: Handles workflow execution, node management, Ollama integration
Node System
Files: canvasmanager/, ui/node.py
Purpose: Python node objects with inputs/outputs, visually connected on canvas
UI Components
Files: ui/main_window.py, node_editor_window.py
Purpose: PyQt6-based main window, node editor, model browser, automation manager
Ollama Integration
Files: main.py, models_data.py
Purpose: Manage local AI models, download, metadata
Key Modules
automation_manager
Files: connection.py, node.py, node_editor_window.py, node_pallette.py, nodeeditor_dialog.py, ports.py
Purpose: Workflow automation, node management and UI editing
browsemodels_manager
Files: browsemodel_window.py, download_manager.py, downloaded_models_window.py, filter_window.py, model_card.py
Purpose: Model browsing, downloading, filtering and display
canvasmanager
Files: __init__.py, canvas_nodemethods.py, canvas_widget.py, ports_handler.py, saveload_methods.py
Purpose: Canvas UI, node logic and port handling, save/load workflows
features
Files: debug_console.py, export_import.py, node_templates.py, performance_monitor.py, workflow_scheduler.py
Purpose: Additional developer and workflow features
qss
Files: dark.qss
Purpose: UI styling
ui
Files: enhanced_main_window.py, newautomation_window.py, placeholder_widget.py
Purpose: UI windows and widgets
utils
Purpose: Utility functions (various helpers)
Class & Function Reference
main.py
Function: main()
Purpose: Launches the app and UI, starts Ollama
Returns: None
Example: python main.py
canvasmanager.canvas_nodemethods
Function: add_node(type, position)
Purpose: Add a new node to the canvas
Parameters: type (string), position (tuple)
Returns: Node object
Example: add_node("Input", (100, 200))
canvasmanager.canvas_nodemethods
Function: remove_node(node_id)
Purpose: Remove a node by its id
Parameters: node_id (string)
Returns: None
ui.enhanced_main_window
Class: EnhancedMainWindow
Purpose: Main UI window for NodeBox
Methods: show(), close(), load_automations()
features.debug_console
Class: DebugConsole
Purpose: Developer debug console widget
Methods: log(message), clear()
utils.node_runner
Function: run_node(node)
Purpose: Execute workflow node logic
Parameters: node (Node object)
Returns: Output data
models_data.py
Function: get_model_info(model_name)
Purpose: Get metadata for models
Parameters: model_name (string)
Returns: dict
Cross-links
Contributing & Docstrings
Improve Documentation
Add or update docstrings in the codebase. Use pdoc or Sphinx for auto-generation. See How to Contribute for details.