Skip to content

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.

License

Notifications You must be signed in to change notification settings

martin98-afk/CanvasMind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

logo

Visual Programming Platform for Algorithm & AI Workflow Development

๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ | ๐Ÿ‡ฌ๐Ÿ‡ง English | ๐Ÿ“˜ Documentation

Low-Code Platform NodeGraphQt qfluentwidgets

A 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.




๐ŸŒŸ Why Choose CanvasMind?

Traditional Low-Code Tools CanvasMind
Static component assembly Dynamic expressions + global variables drive parameters
Only serial execution Full conditional branching, iteration, and loops
No custom logic Embedded code editor for writing Python components freely
Execution = endpoint One-click export to standalone projects (API, CLI, Docker)
AI disconnected from canvas Deep LLM integration: yellow jump / purple create buttons for canvas-aware intelligent completion

๐ŸŒŸ Key Features

๐ŸŽจ Modern UI

  • Fluent Design โ€“ Built with qfluentwidgets for a polished, native look
  • Dark Theme โ€“ Eye-friendly dark mode by default
  • Responsive Layout โ€“ Adapts to various screen sizes

๐Ÿงฉ Visual Programming

  • Drag-and-Drop Nodes โ€“ Drag components from the panel onto the canvas
  • Dataflow Connections โ€“ Connect output and input ports to define dependencies
  • Backdrop Grouping โ€“ Visually group related nodes using Backdrop nodes
  • Context Menus โ€“ Full right-click menu for node operations

๐Ÿง  Intelligent Node Recommendation โœจ

  • Type-Aware Suggestions โ€“ Automatically match compatible downstream components based on output port types
  • Multi-Port Grouping โ€“ Recommendations grouped by source port for clarity
  • Visual Differentiation โ€“ Color-coded suggestions per port type
  • Cross-Canvas Learning โ€“ Tracks component connection frequency to improve recommendations over time

๐Ÿค– LLM-Canvas Context Integration (โœ… Implemented)

  • 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.
  • 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.
  • Multimodal Context Injection: Automatically passes node JSON, variable states, and base64-encoded images to the LLM for precise, actionable suggestions.
  • Canvas-Aware Completion: Supports simultaneous references to multiple existing nodes (yellow) and recommendations for missing components (purple), enabling end-to-end workflow completion.

โšก Asynchronous Execution Engine

  • Non-Blocking Execution โ€“ Uses QThreadPool to keep the UI responsive
  • Real-Time Status Visualization โ€“ Node states shown via color (idle / running / success / failure)
  • Topological Scheduling โ€“ Automatically resolves dependencies and executes in correct order
  • Efficient Serialization โ€“ Uses pickle and pyarrow for fast data passing and storage

๐Ÿ” Advanced Control Flow โœจ

  • Conditional Branching โ€“ Enable/disable branches based on $...$ expressions (if/else logic)
  • Iteration โ€“ Loop over lists or arrays, executing subgraphs per element
  • Loop Control โ€“ Fixed-count or condition-driven loops
  • Dynamic Subgraph Skipping โ€“ Entire downstream subgraphs of inactive branches are skipped for efficiency
  • Expression-Driven Logic โ€“ Branch conditions, loop counts, etc., support dynamic expressions

๐ŸŒ Global Variables & Expression System โœจ

  • Structured Scopes โ€“ Three variable scopes: env (environment), custom (user-defined), and node_vars (node outputs)
  • Dynamic Expressions โ€“ Use $env_user_id$ or $custom_threshold * 2$ in any parameter field
  • Runtime Evaluation โ€“ Expressions resolved before execution, with support for nested dicts/lists
  • Secure Sandbox โ€“ Powered by asteval; prevents unsafe operations and isolates environments via contextmanager
  • UI Integration โ€“ Select variables or type expressions directly in component property panels

โœ… Dynamic Code Components

  • Full Python Logic โ€“ Write complete run() methods and helper functions inside nodes
  • Dynamic Ports โ€“ Add/remove input/output ports via UI; bind global variables as defaults
  • Full Feature Integration โ€“ Leverages global variables, expressions, auto-dependency install, logging, and status visualization
  • Safe Execution โ€“ Runs in isolated subprocesses with timeout control, error capture, and retry support
  • Developer-Friendly Editor โ€“ Professional code editor with dark theme, syntax highlighting, intelligent autocomplete, folding, and error diagnostics

๐Ÿ“Š Node Management

  • Dynamic Loading โ€“ Auto-scans components/ directory and loads new components
  • Pydantic Schemas โ€“ Define inputs, outputs, and properties using Pydantic models
  • Per-Node Logging โ€“ Each node maintains its own execution log
  • State Persistence โ€“ Save/load entire workflows
  • Auto Dependency Resolution โ€“ Components declare requirements; missing packages are auto-installed at runtime

๐Ÿ“ฆ Model Export & Standalone Deployment โœจ

  • Subgraph Export โ€“ Select any group of nodes and export as a self-contained project
  • Train/Inference Separation โ€“ Export only inference logic with trained models bundled
  • Zero-Dependency Runtime โ€“ Generated project runs independentlyโ€”no CanvasMind required
  • Multi-Environment Support โ€“ Auto-generated requirements.txt enables deployment to servers, Docker, or CLI environments

๐Ÿ› ๏ธ Exported Project Tool Integration

  • Direct Invocation โ€“ Canvas can call exported project scripts by name and retrieve results
  • Parameter Passing โ€“ Node properties define tool-call parameters, passed automatically at runtime
  • Full Logging โ€“ Detailed logs of tool execution are captured and returned for debugging
  • LLM Function Calling Ready โ€“ Standardized tool name, input/output schema, and examples for seamless LLM integration

๐Ÿš€ Quick Start

Requirements

  • Python 3.8+
  • PyQt5 or PySide2

Install Dependencies

pip install -r requirements.txt

Run the Application

python main.py

Package with PyInstaller

pyinstaller --onedir --windowed --add-data "app;app" --add-data "icons;icons" -i icons/logo3.png main.py

๐Ÿงช Component Development

Create a New Component

  1. Create a file in components/
# components/data/my_component.py
class MyComponent(BaseComponent):
    name = "My Processor"
    category = "Data"
    description = "Example component"
    requirements = "pandas>=1.3.0"
    inputs = [{"name": "input_data", "type": "TEXT"}]
    outputs = [{"name": "output_data", "type": "TEXT"}]
    properties = {"param1": {"type": "TEXT", "default": "hello"}}

    def run(self, params, inputs=None):
        """
        params: node properties from UI
        inputs: upstream data (key = input port name)
        return: output data (key = output port name)
        """
        input_data = inputs.get("input_data") if inputs else None
        param1 = params.get("param1", "default_value")
        result = f"Processed: {input_data} + {param1}"
        return {"output_data": result}
  1. Auto-Loading โ€“ Components are automatically scanned and added to the panel
  2. Auto Dependency Install โ€“ If a component fails due to missing packages, CanvasMind installs them from the requirements field and retries

Supported Port Types

Type Description Example
TEXT Text input String parameters
LONGTEXT Long text input Multi-line strings
INT Integer Numeric values
FLOAT Floating point Decimal numbers
BOOL Boolean Toggle switches
CSV CSV list data Column selections
JSON JSON structure Dynamic nested data
EXCEL Excel data Cell ranges
FILE File path Local file reference
UPLOAD Document upload User-uploaded files
SKLEARNMODEL Scikit-learn model Trained .pkl models
TORCHMODEL PyTorch model .pt or .pth models
IMAGE Image data Base64 or file paths

Supported Property Types

Type Description Example
TEXT Text input Short strings
LONGTEXT Long text input Code snippets, prompts
INT / FLOAT Numeric input Thresholds, counts
BOOL Toggle Enable/disable flags
CHOICE Dropdown Predefined options
DYNAMICFORM Dynamic form Variable-length lists
RANGE Numeric range Min/max sliders

๐ŸŽฎ Canvas Usage Guide

Basic Operations

  1. Create Node โ€“ Drag from left panel to canvas
  2. Connect Nodes โ€“ Drag from output port to input port
  3. Run Node โ€“ Right-click โ†’ โ€œRun This Nodeโ€
  4. View Logs โ€“ Right-click โ†’ โ€œView Node Logsโ€

Advanced Features

  • Loops โ€“ Use Loop/Iterate nodes with Backdrop for structured iteration
  • File Handling โ€“ Click file picker in property panel
  • Workflow Management โ€“ Save/load via top-left buttons
  • Node Grouping โ€“ Select multiple nodes โ†’ right-click โ†’ โ€œCreate Backdropโ€
  • Dependency Management โ€“ Failed components auto-install missing requirements

Keyboard Shortcuts

  • Ctrl+R โ€“ Run workflow
  • Ctrl+S โ€“ Save workflow
  • Ctrl+O โ€“ Load workflow
  • Ctrl+A โ€“ Select all nodes
  • Del โ€“ Delete selected nodes

๐Ÿ› ๏ธ Development Notes

Node Status Colors

  • Idle โ€“ Gray border
  • Running โ€“ Blue border
  • Success โ€“ Green border
  • Failed โ€“ Red border

Connection Line Colors

  • Idle โ€“ Yellow
  • Input Active โ€“ Blue
  • Output Active โ€“ Green

Logging System

  • Each node has independent logs with timestamps
  • Powered by Loguru โ€“ use self.logger in components
  • All print() output is automatically captured

Dataflow

  • Inputs auto-populated from upstream outputs
  • Outputs stored by port name
  • Full multi-input/multi-output support

๐Ÿ“ฅ Model Export (Standalone Deployment)

Core Value

Export any subgraph as a self-contained project that runs in any Python environmentโ€”no CanvasMind required.

Use Cases

  • Train/Inference Split โ€“ Export only inference logic with models bundled
  • Team Sharing โ€“ Share full workflows as runnable projects
  • Production Deployment โ€“ Run on servers or in Docker
  • Offline Execution โ€“ CLI-only environments

Export Features

โœ… Smart Dependency Analysis โ€“ Copies only necessary component code
โœ… Path Rewriting โ€“ Model/data files copied and converted to relative paths
โœ… Column Selection Preserved โ€“ CSV column config fully retained
โœ… Environment Isolation โ€“ Auto-generated requirements.txt
โœ… Ready-to-Run โ€“ Includes run.py and api_server.py

Export Steps

  1. Select Nodes โ€“ Choose any nodes on canvas (multi-select supported)
  2. Click Export โ€“ Top-left โ€œExport Modelโ€ button (๐Ÿ“ค icon)
  3. Choose Directory โ€“ Project folder auto-generated
  4. Run Externally:
# Install dependencies
pip install -r requirements.txt

# Run model
python run.py

Exported Project Structure

model_xxxxxxxx/
โ”œโ”€โ”€ model.workflow.json    # Full workflow definition (nodes, connections, column selections)
โ”œโ”€โ”€ project_spec.json      # Input/output schema
โ”œโ”€โ”€ preview.png            # Canvas preview snapshot
โ”œโ”€โ”€ README.md              # Project overview
โ”œโ”€โ”€ requirements.txt       # Auto-analyzed dependencies
โ”œโ”€โ”€ run.py                 # CLI entrypoint
โ”œโ”€โ”€ api_server.py          # FastAPI microservice
โ”œโ”€โ”€ scan_components.py     # Component loader
โ”œโ”€โ”€ runner/
โ”‚   โ”œโ”€โ”€ component_executor.py
โ”‚   โ””โ”€โ”€ workflow_runner.py
โ”œโ”€โ”€ components/            # Original component code (preserved structure)
โ”‚   โ”œโ”€โ”€ base.py
โ”‚   โ””โ”€โ”€ your_components/
โ””โ”€โ”€ inputs/                # Bundled models/data files

๐Ÿ”ฎ Roadmap

1. Enhanced Code Editor

  • Integrate LSP (Language Server Protocol) to replace Jedi-based static completion

2. Remote Execution

  • Submit workflows to remote servers / Kubernetes / Ray clusters
  • Local = orchestration only; execution = distributed
  • Ideal for LLMs and big data workloads

3. Parallel Execution

  • Problem: Current execution is serial โ†’ underutilizes CPU/GPU
  • Solution:
    • Parallel execution of independent nodes
    • GPU-aware scheduling (e.g., assign PyTorch models to specific devices)

๐Ÿ“Š Feature Status (โœ… Implemented | โณ Planned)

  • โœ… Visual canvas (NodeGraphQt)
  • โœ… Control flow: conditionals, loops, iteration
  • โœ… Global variables + expression system
  • โœ… Dynamic code components (embedded editor)
  • โœ… Intelligent node recommendations
  • โœ… One-click export (CLI + API)
  • โœ… Multi-environment management
  • โœ… LLM context integration (yellow jump / purple create buttons)
  • โณ Code-to-canvas auto-creation (from editor โ†’ new node)
  • โณ Parallel & remote execution

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the GPLv3 License.


๐Ÿ™ Acknowledgements

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages