{"id":34948742,"url":"https://github.com/martin98-afk/canvasmind","last_synced_at":"2026-04-19T08:03:44.580Z","repository":{"id":316883631,"uuid":"1065172693","full_name":"martin98-afk/CanvasMind","owner":"martin98-afk","description":"A modern low-code visual programming IDE built on NodeGraphQt and qfluentwidgets, supporting drag-and-drop component orchestration, asynchronous execution, file operations, loop control, and one-click export of workflows into standalone runnable projects—enabling seamless transition from development to deployment.","archived":false,"fork":false,"pushed_at":"2026-01-31T18:32:56.000Z","size":659786,"stargazers_count":67,"open_issues_count":5,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-31T22:59:45.751Z","etag":null,"topics":["nodegraphqt","pyqt-fluent-widgets"],"latest_commit_sha":null,"homepage":"https://canvasmind-sphinx-build.readthedocs.io/zh-cn/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martin98-afk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T07:34:23.000Z","updated_at":"2026-01-31T18:33:02.000Z","dependencies_parsed_at":"2025-12-17T17:04:57.983Z","dependency_job_id":null,"html_url":"https://github.com/martin98-afk/CanvasMind","commit_stats":null,"previous_names":["martin98-afk/workflowgui","martin98-afk/canvasmind"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/martin98-afk/CanvasMind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martin98-afk%2FCanvasMind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martin98-afk%2FCanvasMind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martin98-afk%2FCanvasMind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martin98-afk%2FCanvasMind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martin98-afk","download_url":"https://codeload.github.com/martin98-afk/CanvasMind/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martin98-afk%2FCanvasMind/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29194007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodegraphqt","pyqt-fluent-widgets"],"created_at":"2025-12-26T20:57:42.330Z","updated_at":"2026-04-19T08:03:44.555Z","avatar_url":"https://github.com/martin98-afk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- README.md --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"50%\" align=\"center\" src=\"icons/logo.png\" alt=\"logo\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eVisual Programming Platform for Algorithm \u0026 AI Workflow Development\u003c/h1\u003e\n\n  [🇨🇳 中文](README_zh.md) | [🇬🇧 English](README.md) | [📘 Documentation](https://canvasmind-sphinx-build.readthedocs.io/zh-cn/latest/) | [b站相关介绍视频](https://www.bilibili.com/video/BV153zCBGEU2?spm_id_from=333.788.videopod.sections\u0026vd_source=730f7f3382f460e22f17a3b2c58f0256)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Low-Code Platform](https://img.shields.io/badge/Python-3.8%2B-blue)\n![NodeGraphQt](https://img.shields.io/badge/NodeGraphQt-v0.3%2B-orange)\n![qfluentwidgets](https://img.shields.io/badge/qfluentwidgets-v1.0%2B-green)\n\n\n\u003c/div\u003e\n\nA modern low-code visual programming platform built on **NodeGraphQt** and **qfluentwidgets**, supporting drag-and-drop component orchestration, asynchronous execution, file operations, control flow logic, and one-click export of workflows into standalone, executable projects—enabling seamless transition from development to deployment.\n\n\u003cimg src=\"images/宣传图.png\" width=\"100%\" height=\"100%\"\u003e\u003cbr\u003e\n\n\u003cimg src=\"images/宣传图2.png\" width=\"100%\" height=\"100%\"\u003e\u003cbr\u003e\n\n\u003cimg src=\"images/宣传图3.png\" width=\"100%\" height=\"100%\"\u003e\u003cbr\u003e\n\n\u003cimg src=\"images/大模型对话框.png\" width=\"100%\" height=\"100%\"\u003e\u003cbr\u003e\n\n---\n\n## 🌟 Why Choose CanvasMind?\n\n| Traditional Low-Code Tools                    | CanvasMind |\n|-----------------------------------------------|-----------|\n| Static component assembly                     | **Dynamic expressions + global variables** drive parameters |\n| Only serial execution                         | Full **conditional branching, iteration, and loops** |\n| No custom logic                               | **Embedded code editor** for writing Python components freely |\n| Execution = endpoint                          | **One-click export** to standalone projects (API, CLI, Docker) |\n| AI disconnected from canvas                   | **Deep LLM integration**: yellow jump / purple create buttons for canvas-aware intelligent completion |\n| Fixed Runtime Environment                     | Supports remote execution via SSH: Features integrated Python environment management for SSH servers and supports dispatching nodes to the server-side for execution. |\n| No Trigger Node or Hard-coded Trigger Options | Extensible Plugin Trigger System: Decoupled architecture allowing dynamic loading of Cron, Webhook, and File-watchers; UI auto-syncs with backend logic |\n\n---\n\n## 🌟 Key Features\n\n### 📋 Complex Form \u0026 Tree Control Widget 🌳\n*   **Dynamic Property Grid** – Render adaptive UI controls (text fields, numeric inputs, file selectors, toggles, sliders) based on parameter data types and validation rules\n*   **Hierarchical Property Tree** – Organize nested configurations into expandable/collapsible tree structures with drag-and-drop reordering for complex workflows\n*   **Context-Aware Validation** – Apply real-time validation logic based on parameter dependencies (e.g., enabling/disabling fields based on toggle states)\n*   **Interactive Tree Navigation** – Context menus and visual indicators for managing parent-child relationships in hierarchical data structures\n\n\u003cimg src=\"images/复杂节点控件1.png\" width=\"100%\" height=\"100%\"\u003e\u003cbr\u003e\n\n### 🪟 Multi-View Splitting 🛰️\n*   **Recursive Viewport Splitting** – Split the canvas horizontally or vertically to monitor distant parts of a large-scale graph simultaneously.\n*   **Synchronized Scene State** – All viewports share the same live scene. Editing a node in one view reflects instantly across all others, enabling high-efficiency cross-node referencing.\n*   **Distant Node Tracking** – Ideal for complex pipelines where you need to watch the \"Source Node\" parameters in one view while observing the \"Terminal Output\" behavior in another.\n\n\u003cimg src=\"images/视角拆分.png\" width=\"100%\" height=\"100%\"\u003e\u003cbr\u003e\n\n### ⚡ Distributed \u0026 Hybrid Execution Engine\n*   **Parallel DAG Execution** – Independent branches are executed concurrently via a high-performance task scheduler, maximizing CPU/GPU utilization across the workflow.\n*   **Hybrid Runtime Orchestration** – Supports seamless mixing of execution environments:\n    *   **Interactive IPython Kernel**: Leveraging local persistent sessions for rapid debugging and state retention.\n    *   **Remote SSH Workers**: Transparently dispatching heavy-compute nodes (e.g., Model Training/Inference) to high-performance servers with automated environment syncing.\n*   **Selective In-Memory Persistence (Caching)** – Users can toggle \"Pin to Memory\" for specific nodes; results are cached in the active process RAM to eliminate redundant re-computation and I/O overhead during iterative tuning.\n*   **Intelligent Topological Dispatch** – Automatically resolves dependencies and routes tasks to the optimal target (Local/Remote/IPython) based on node configuration.\n*   **Unified State Management** – Real-time visualization of node status (Queued / Running / Success / Failed) across all distributed workers on a single canvas.\n*   **High-Speed Data Serialization** – Utilizes `pyarrow` and `pickle` for low-latency data transfer between local and remote environments.\n\n### 🧠 Intelligent Node Recommendation ✨\n- **Type-Aware Suggestions** – Automatically match compatible downstream components based on output port types  \n- **Multi-Port Grouping** – Recommendations grouped by source port for clarity  \n- **Visual Differentiation** – Color-coded suggestions per port type  \n- **Cross-Canvas Learning** – Tracks component connection frequency to improve recommendations over time  \n\n### 🤖 LLM-Canvas Context Integration (✅ Implemented)\n- **Yellow Jump Buttons**: When the LLM references an existing node, a yellow `[Node Name](jump)` button appears—click to instantly navigate to that node on the canvas.  \n- **Purple Create Buttons**: When recommending a new capability, a purple `[Component Name](create)` button is generated—click to instantiate the component from your library and auto-connect it.  \n- **Multimodal Context Injection**: Automatically passes node JSON, variable states, and base64-encoded images to the LLM for precise, actionable suggestions.  \n- **Canvas-Aware Completion**: Supports simultaneous references to multiple existing nodes (yellow) and recommendations for missing components (purple), enabling end-to-end workflow completion.\n\n### 🔁 Advanced Control Flow ✨\n- **Conditional Branching** – Enable/disable branches based on `$...$` expressions (`if/else` logic)  \n- **Iteration** – Loop over lists or arrays, executing subgraphs per element  \n- **Loop Control** – Fixed-count or condition-driven loops  \n- **Dynamic Subgraph Skipping** – Entire downstream subgraphs of inactive branches are skipped for efficiency  \n- **Expression-Driven Logic** – Branch conditions, loop counts, etc., support dynamic expressions  \n\n### 🌐 Global Variables \u0026 Expression System ✨\n- **Structured Scopes** – Three variable scopes: `env` (environment), `custom` (user-defined), and `node_vars` (node outputs)  \n- **Dynamic Expressions** – Use `$env_user_id$` or `$custom_threshold * 2$` in any parameter field  \n- **Runtime Evaluation** – Expressions resolved before execution, with support for nested dicts/lists  \n- **Secure Sandbox** – Powered by `asteval`; prevents unsafe operations and isolates environments via `contextmanager`  \n- **UI Integration** – Select variables or type expressions directly in component property panels  \n\n### ✅ Dynamic Code Components\n- **Full Python Logic** – Write complete `run()` methods and helper functions inside nodes  \n- **Dynamic Ports** – Add/remove input/output ports via UI; bind global variables as defaults  \n- **Full Feature Integration** – Leverages global variables, expressions, auto-dependency install, logging, and status visualization  \n- **Safe Execution** – Runs in isolated subprocesses with timeout control, error capture, and retry support  \n- **Developer-Friendly Editor** – Professional code editor with dark theme, syntax highlighting, intelligent autocomplete, folding, and error diagnostics  \n\n### ⚡ Plugin-based Trigger System\n\n* **Dynamic Plugin Loading** – Decoupled architecture that automatically discovers and registers new trigger types (Cron, Webhook, File Watcher) from the plugin directory without restarting.\n* **Auto-Adaptive UI** – Node property panels dynamically reconstruct their input widgets based on the selected plugin, ensuring a clean, context-aware interface.\n* **Event-Driven Execution** – Transition from manual execution to automated workflows by reacting to external HTTP requests, schedule patterns, or file system changes.\n* **Lifecycle Management** – Built-in safety logic that automatically unregisters backend listeners when a canvas is closed or a node is deleted to prevent resource leaks.\n\n### 📊 Node Management\n- **Dynamic Loading** – Auto-scans `components/` directory and loads new components  \n- **Pydantic Schemas** – Define inputs, outputs, and properties using Pydantic models  \n- **Per-Node Logging** – Each node maintains its own execution log  \n- **State Persistence** – Save/load entire workflows  \n- **Auto Dependency Resolution** – Components declare `requirements`; missing packages are auto-installed at runtime  \n\n### 📦 Model Export \u0026 Standalone Deployment ✨\n- **Subgraph Export** – Select any group of nodes and export as a self-contained project  \n- **Train/Inference Separation** – Export only inference logic with trained models bundled  \n- **Zero-Dependency Runtime** – Generated project runs independently—no CanvasMind required  \n- **Multi-Environment Support** – Auto-generated `requirements.txt` enables deployment to servers, Docker, or CLI environments  \n\n### 🛠️ Exported Project Tool Integration\n- **Direct Invocation** – Canvas can call exported project scripts by name and retrieve results  \n- **Parameter Passing** – Node properties define tool-call parameters, passed automatically at runtime  \n- **Full Logging** – Detailed logs of tool execution are captured and returned for debugging  \n- **LLM Function Calling Ready** – Standardized tool name, input/output schema, and examples for seamless LLM integration  \n\n---\n\n## 🚀 Quick Start\n\n### Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n### Run the Application\n```bash\npython main.py\n```\n\n### Package with PyInstaller\n```bash\npython build.py\n```\n\n---\n\n## 🧪 Component Development\n\n### Supported Port Types\n\n| Type              | Description         | Example                   |\n|-------------------|---------------------|---------------------------|\n| `TEXT`            | Text input          | String parameters         |\n| `LONGTEXT`        | Long text input     | Multi-line strings        |\n| `INT`             | Integer             | Numeric values            |\n| `FLOAT`           | Floating point      | Decimal numbers           |\n| `BOOL`            | Boolean             | Toggle switches           |\n| `CSV`             | CSV list data       | Column selections         |\n| `JSON`            | JSON structure      | Dynamic nested data       |\n| `EXCEL`           | Excel data          | Cell ranges               |\n| `FILE`            | File path           | Local file reference      |\n| `UPLOAD`          | Document upload     | User-uploaded files       |\n| `SKLEARNMODEL`    | Scikit-learn model  | Trained `.pkl` models     |\n| `TORCHMODEL`      | PyTorch model       | `.pt` or `.pth` models    |\n| `IMAGE`           | Image data          | Base64 or file paths      |\n\n### Supported Property Types\n\n| Type            | Description     | Example                |\n|-----------------|-----------------|------------------------|\n| `TEXT`          | Text input      | Short strings          |\n| `LONGTEXT`      | Long text input | Code snippets, prompts |\n| `INT` / `FLOAT` | Numeric input   | Thresholds, counts     |\n| `BOOL`          | Toggle          | Enable/disable flags   |\n| `CHOICE`        | Dropdown        | Predefined options     |\n| `DYNAMICFORM`   | Dynamic form    | Variable-length lists  |\n| `RANGE`         | Numeric range   | Min/max sliders        |\n| `VARIABLE`      | variable selector | global_variable        | \n| `FILE SELECT`   | Select file     | canvas_files/model.pth    |\n---\n\n## 🎮 Canvas Usage Guide\n\n### Basic Operations\n1. **Create Node** – Drag from left panel to canvas  \n2. **Connect Nodes** – Drag from output port to input port  \n3. **Run Node** – Right-click → “Run This Node”  \n4. **View Logs** – Right-click → “View Node Logs”  \n\n### Advanced Features\n- **Loops** – Use Loop/Iterate nodes with Backdrop for structured iteration  \n- **File Handling** – Click file picker in property panel  \n- **Workflow Management** – Save/load via top-left buttons  \n- **Node Grouping** – Select multiple nodes → right-click → “Create Backdrop”  \n- **Dependency Management** – Failed components auto-install missing `requirements`  \n\n### Keyboard Shortcuts\n- `Ctrl+R` – Run workflow  \n- `Ctrl+S` – Save workflow  \n- `Ctrl+O` – Load workflow  \n- `Ctrl+A` – Select all nodes  \n- `Del` – Delete selected nodes  \n\n---\n\n## 🛠️ Development Notes\n\n### Node Status Colors\n- **Idle** – Gray border  \n- **Running** – Blue border  \n- **Success** – Green border  \n- **Failed** – Red border  \n\n### Connection Line Colors\n- **Idle** – Yellow  \n- **Input Active** – Blue  \n- **Output Active** – Green  \n\n### Logging System\n- Each node has independent logs with timestamps  \n- Powered by **Loguru** – use `self.logger` in components  \n- All `print()` output is automatically captured  \n\n### Dataflow\n- Inputs auto-populated from upstream outputs  \n- Outputs stored by port name  \n- Full multi-input/multi-output support  \n\n---\n\n## 📥 Model Export (Standalone Deployment)\n\n### Core Value\nExport **any subgraph as a self-contained project** that runs in any Python environment—no CanvasMind required.\n\n### Use Cases\n- **Train/Inference Split** – Export only inference logic with models bundled  \n- **Team Sharing** – Share full workflows as runnable projects  \n- **Production Deployment** – Run on servers or in Docker  \n- **Offline Execution** – CLI-only environments  \n\n### Export Features\n✅ **Smart Dependency Analysis** – Copies only necessary component code  \n✅ **Path Rewriting** – Model/data files copied and converted to relative paths  \n✅ **Column Selection Preserved** – CSV column config fully retained  \n✅ **Environment Isolation** – Auto-generated `requirements.txt`  \n✅ **Ready-to-Run** – Includes `run.py` and `api_server.py`  \n\n### Export Steps\n1. **Select Nodes** – Choose any nodes on canvas (multi-select supported)  \n2. **Click Export** – Top-left **“Export Model”** button (📤 icon)  \n3. **Choose Directory** – Project folder auto-generated  \n4. **Run Externally**:\n\n```bash\n# Install dependencies\npip install -r requirements.txt\n\n# Run model\npython run.py\n```\n\n### Exported Project Structure\n```\nmodel_xxxxxxxx/\n├── model.workflow.json    # Full workflow definition (nodes, connections, column selections)\n├── project_spec.json      # Input/output schema\n├── preview.png            # Canvas preview snapshot\n├── README.md              # Project overview\n├── requirements.txt       # Auto-analyzed dependencies\n├── run.py                 # CLI entrypoint\n├── api_server.py          # FastAPI microservice\n├── scan_components.py     # Component loader\n├── runner/\n│   ├── component_executor.py\n│   └── workflow_runner.py\n├── components/            # Original component code (preserved structure)\n│   ├── base.py\n│   └── your_components/\n└── inputs/                # Bundled models/data files\n```\n\n---\n\n## 📊 Feature Status (✅ Implemented | ⏳ Planned)\n\n- ✅ Visual canvas (NodeGraphQt)  \n- ✅ Control flow: conditionals, loops, iteration  \n- ✅ Global variables + expression system  \n- ✅ Dynamic code components (embedded editor)  \n- ✅ Intelligent node recommendations  \n- ✅ One-click export (CLI + API)  \n- ✅ Multi-environment management  \n- ✅ **LLM context integration (yellow jump / purple create buttons)**\n- ✅ Parallel \u0026 remote execution  \n- ⏳ Code-to-canvas auto-creation (from editor → new node)  \n\n---\n\n## 🤝 Contributing\n\n1. Fork the repository  \n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)  \n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)  \n4. Push to the branch (`git push origin feature/AmazingFeature`)  \n5. Open a Pull Request  \n\n---\n\n## 📄 License\n\nThis project is licensed under the [GPLv3 License](LICENSE).\n\n---\n\n## 🙏 Acknowledgements\n\n- [NodeGraphQt](https://github.com/jchanvfx/NodeGraphQt) – Node graph framework  \n- [PyQt-Fluent-Widgets](https://github.com/zhiyiYo/PyQt-Fluent-Widgets) – Fluent Design UI library  \n- [Loguru](https://github.com/Delgan/loguru) – Elegant Python logging\n\n\n## Star History\n\n\u003ca href=\"https://www.star-history.com/#martin98-afk/CanvasMind\u0026type=date\u0026legend=top-left\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=martin98-afk/CanvasMind\u0026type=date\u0026theme=dark\u0026legend=top-left\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=martin98-afk/CanvasMind\u0026type=date\u0026legend=top-left\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=martin98-afk/CanvasMind\u0026type=date\u0026legend=top-left\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartin98-afk%2Fcanvasmind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartin98-afk%2Fcanvasmind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartin98-afk%2Fcanvasmind/lists"}