https://github.com/ubos-tech/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'.
https://github.com/ubos-tech/node-red-contrib-image-generation-ubos
ai chatgpt chatgpt-api dall-e dalle-2 image-generation image-generator-using-openai-api image-generators machine-learning no-code node-red node-red-flow nodejs openai
Last synced: 3 days ago
JSON representation
A Node-RED node that interacts with OpenAI machine learning models to generate image outputs like 'DALL·E 2'.
- Host: GitHub
- URL: https://github.com/ubos-tech/node-red-contrib-image-generation-ubos
- Owner: UBOS-tech
- License: mit
- Created: 2023-06-12T09:59:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-19T14:29:15.000Z (over 2 years ago)
- Last Synced: 2025-09-14T00:01:11.983Z (28 days ago)
- Topics: ai, chatgpt, chatgpt-api, dall-e, dalle-2, image-generation, image-generator-using-openai-api, image-generators, machine-learning, no-code, node-red, node-red-flow, nodejs, openai
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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'.
UBOS
•
Community
•
Youtube
•
Discord
•
GitHub
[](https://flows.nodered.org/node/node-red-contrib-image-generation-ubos)
[](https://www.npmjs.com/package/node-red-contrib-image-generation-ubos)
### 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` 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](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids)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:
```js
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
```js
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](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids)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
```js
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](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids)## Demo
### Create image
### Image edit
### Image variation
### Bugs reports and feature requests
Please report any issues or feature requests at GitHub.
## License
[MIT License](https://github.com/UBOS-tech/node-red-contrib-image-generation-ubos/blob/main/LICENSE)