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

node-red-contrib-image-generation-ubos

v1.0.5

Published

A Node-RED node that interacts with OpenAI machine learning models to generate image outputs like 'DALL·E 2'.

Downloads

41

Readme

node-red-contrib-image-generation-ubos

A Node-RED node that interacts with OpenAI machine learning models to generate image outputs like 'DALL·E 2'.

flow npm

Quick Start

Install with the built in Node-RED Palette manager or using npm:

npm install node-red-contrib-image-generation-ubos

Setup

When editing the nodes properties, to get your OPENAI_API_KEY log in to ChatGPT and then visit https://platform.openai.com/account/api-keys click "+ Create new secret key" then copy and paste the "API key" into the nodes API_KEY property value.

To get your Organization visit https://platform.openai.com/account/org-settings then copy and paste the "OrganizationID" into the nodes Organization property value.

Properties

  • [Required] msg.OPENAI_API_KEY: This is the API key provided by OpenAI. It is necessary for authentication when making requests to the OpenAI API.
  1. When msg.type is set to create_image:

    • [Required] msg.prompt: A text description of the desired image(s). The maximum length is 1000 characters.

    • msg.n: The number of images to generate. Must be between 1 and 10.

    • msg.size: The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

    • msg.response_format: The format in which the generated images are returned. Must be one of url or b64_json.

    • msg.user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more

  2. When msg.type is set to create_image_edit:

    • [Required] msg.image: The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask. For example:
     msg.image = {
         "value": msg.req.files[0].buffer,
         "options": {
             "filename": msg.req.files[0].originalname
         }
     };
    • msg.mask: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. For example
     msg.mask = {
         "value": msg.req.files[1].buffer,
         "options": {
             "filename": msg.req.files[1].originalname
         }
     };
    • [Required] msg.prompt: A text description of the desired image(s). The maximum length is 1000 characters.

    • msg.n: The number of images to generate. Must be between 1 and 10.

    • msg.size: The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

    • msg.response_format: The format in which the generated images are returned. Must be one of url or b64_json.

    • msg.user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more

  3. When msg.type is set to create_image_variation:

    • [Required] msg.image: The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. For example
     msg.image = {
         "value": msg.req.files[0].buffer,
         "options": {
             "filename": msg.req.files[0].originalname
         }
     };
    • msg.n: The number of images to generate. Must be between 1 and 10.

    • msg.size: The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

    • msg.response_format: The format in which the generated images are returned. Must be one of url or b64_json.

    • msg.user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more

Demo

Create image

Group 21

Image edit

Group 21

Image variation

Group 21 (1)

Bugs reports and feature requests

Please report any issues or feature requests at GitHub.

License

MIT License