Git Product home page Git Product logo

graphexec's Introduction

GraphExec

GraphExec is a tool for executing litegraph.js graphs on a server, with node operations implemented as Python functions.

Slot types can be any Python types, including NumPy arrays and custom, opaque classes.

It runs as a REST back-end for litegraph.js with some aftermarket modifications, or as a command-line tool. Generating JavaScript code for client-side stub nodes (with slots, properties and widgets, but no business logic) is also possible, based on decorators added to the node implementation.

For each node, server-side code can return image results (including Matplotlib figures).

The project is in an alpha development stage; for example, litegraph.js built-in nodes are not implemented, and there is no support for the REST back-end in the upstream library.

screenshot


Usage

With my_node_types.py:

from graphexec import node_type

from .my_implementation import _perlin_noise

@node_type.define("my_package/perlin_noise", "Perlin noise")
@node_type.input("width", "number")
@node_type.input("height", "number")
@node_type.output("map", "numpy.ndarray")
def perlin_noise(width, height):
    return dict(map=_perlin_noise(int(width), int(height)))

NODE_TYPES = [
    perlin_noise,
]
graphexec-generate-js-module -o ../litegraph/src/nodes/my-package-generated.js my_node_types
env PYTHONPATH=. graphexec-server --wwwroot ../litegraph -m my_node_types

Format check

black --diff **.py

Type check

mypy graphexec

graphexec's People

Contributors

mcejp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.