yarn install
cp .env.example .env
- Add APIKeys of imagine.art and midjourney
-
script to generate using imagine.art is in directory: generate-image
-
script to remix on existing base image is: remix-image
- script to generate image via prompt and reference image generate-image
npx ts-node src/genai/midjourney/generate-image.ts
- script to query and get the response of midjourney
-
capture the messageId from the response of step-1
-
paste the messageId in the script for
get-message-details
get-message-details -
run command:
npx ts-node src/genai/midjourney/get-message-details.ts
- The message details should contain hyperlink/URL to the generated image
-
nestJS API has POST-API endpoint to take
reference image-name
andtraits
as message-body -
usage of API:
- start the service
yarn start:dev
- Open Postman client and create a POST request with:
URL: http://localhost:3000/image
Request Body:
{
"basecat": "new-cat",
"traitsRecord": {
"personality": "",
"eye": "",
"tail": "",
"wearing": "sun glasses",
"activity": "",
"environment": "on the snow"
}
}
-
reference values for the traits can be open, i.e you can fill them as per your imagination
-
API at moment uses the imagine-art AI