npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

huggingface-visualblocks-nodes

v0.0.9

Published

Custom Hugging Face components for Visual Blocks

Downloads

25

Readme

Hugging Face + Visual Blocks Custom Components

Visual blocks is an amazing tool from our friends at Google that allows you to easily create and experiment with machine learning pipelines using a visual interface. This repository contains the source code for custom components that allow you to use Hugging Face client and server models in your Visual Blocks pipelines. We've created a few nodes supporting different tasks and models following our Tasks definitions.

[!NOTE] Visual Blocks seems to be mostly working in Chrome. If you are having trouble with the interface, try using Chrome, and please submit an issue to the Visual Blocks team.

Important links:

  • https://visualblocks.withgoogle.com/
  • https://www.npmjs.com/package/huggingface-visualblocks-nodes
  • https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest

How to use the custom components

To start playing with our custom components you need to Add a custom node to your Visual Blocks project. First you need to start a new project https://visualblocks.withgoogle.com/#/edit/new, then click on the "+" button in the bottom left corner to add a new node.

Then input the pre-bundled code from our npm package. You can do this by pasting the following link into the input field and clicking "Submit":

https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest

Then you will be able to see three Hugging Face Collections: Client, Server and Common.

Nodes and Examples

Client Nodes

Client nodes are nodes running tranformers pipelines on the client side using Transformers.js. All Client nodes have WASM and WebGPU (experimental) backend support, and you can find web-compatible models by visiting https://huggingface.co/models?library=transformers.js.

[!NOTE] WebGPU support in transformers.js is still experimental and may not work on all devices. Not all models are supported by WebGPU backend yet.

Translation

Translation Node Example

More info:

  • https://huggingface.co/tasks/translation
  • https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TranslationPipeline

Token Classification

Token Classification Node Example

More info:

  • https://huggingface.co/tasks/token-classification
  • https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TokenClassificationPipeline

Text Classification

Text Classification Node Example

More info:

  • https://huggingface.co/tasks/text-classification
  • https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipeline

Object Detection

Object Detection Node Example

More info:

  • https://huggingface.co/tasks/object-detection
  • https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ObjectDetectionPipeline

Image Segmentation

Image Segmentation Node Example

More info:

  • https://huggingface.co/tasks/image-segmentation
  • https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageSegmentationPipeline

Image Classification

Image Classification Node Example

More info:

  • https://huggingface.co/tasks/image-classification
  • https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageClassificationPipeline

Depth Estimation

Depth Estimation Node Example

More info:

  • https://huggingface.co/tasks/depth-estimation
  • https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.DepthEstimationPipeline

Background Removal

Background Removal Node Example

Server Nodes

Server nodes are nodes running Transformers pipeline tasks using the Hugging Face Serverless API. For a few selected LLM models, it's running using our hosted Text Generation Inference, our fast, optimized inference for LLMs.

[!NOTE] You can use the Hugging Face Serverless API for free with limited usage, after which you'll be rate limited. If you need more usage, you can create an account at https://huggingface.co/join and get an API token at https://huggingface.co/settings/tokens or log in using the Hugging Face Login node.

For server nodes you have the option to Login using your Hugging Face account to get more usage and access to private models. Using Hugging Face Hub Login

If successful, you can obtain your Apikey directly from the Hugging Face Hub Login node.

Text Generation and Chat Completion

Chat Template Text Generation Node Example

Chat Completion Node Example

More info:

  • https://huggingface.co/tasks/text-generation

Fill Mask

Fill Mask Node Example

More info:

  • https://huggingface.co/tasks/fill-mask

Image Classification

Image Classification Node Example

More info:

  • https://huggingface.co/tasks/image-classification

Summarization

Summarization Node Example

More info:

  • https://huggingface.co/tasks/summarization

Text Classification

Text Classification Node Example

More info:

  • https://huggingface.co/tasks/text-classification

Text Generation

Text Generation Node Example

More info:

  • https://huggingface.co/tasks/text-generation

Text to Image

Text to Image Node Example

More info:

  • https://huggingface.co/tasks/text-to-image

Token Classification

Token Classification Node Example

More info:

  • https://huggingface.co/tasks/token-classification

Extra Examples

Background Removal Text to Image

Chat Completion Text to Image Depth

Image Segmentation Webcam Client

Local Development

  1. Clone the repository

    git clone https://github.com/huggingface/visual-blocks-custom-components.git
    cd visual-blocks-custom-components
  2. Install the dependencies

    npm i
  3. Run the development server

    npm run dev
  4. Visit Google's staging server

  5. Click the + in the bottom left corner to add the custom nodes.

  6. Paste in the link to the script (e.g., http://localhost:8080/index.js) and click "Submit".