This is a simple node js api for creating and streaming images using Midjourney Node.js client. This API offers three main routes: imagine
, upscale
, and variant
.
This README provides an overview of these routes and how to use them.
To set up the Midjourney Node.js API and start using its image manipulation capabilities, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/yourusername/midjourney-nodejs-api.git
-
Navigate to the project directory:
cd midjourney-nodejs-api
-
Install the necessary dependencies:
yarn install
-
Configure your environment variables by creating a .env file in the project root directory. You can use the .env.example file as a template.
-
Start the API server:
yarn dev
-
You can import the postman json file in your postman app.
The 'imagine' route allows you to create images based on a provided prompt.
- HTTP Method: POST
- Endpoint:
/imagine
- Request Payload:
{
"prompt": "Image prompt"
}
Response: The API will respond with the created image data.
The 'upscale' route is used to upscale an image.
- HTTP Method: POST
- Endpoint:
/upscale
- Request Payload:
{
"id": "111",
"index": 1,
"hash": "111",
"content": "Image prompt"
}
Response: The API will respond with the created image data.
The 'variant' route is similar to the 'upscale' route and is used to create a variant of an image.
- HTTP Method: POST
- Endpoint:
/variant
- Request Payload:
{
"id": "111",
"index": 1,
"hash": "111",
"content": "Image prompt"
}
Response: The API will respond with the created image data.
This project is licensed under the MIT License.