|
import axios from "axios"; |
|
export const config = { |
|
"name": "imagine", |
|
"url": "/api/imagine", |
|
"description": "Get response from imagine AI Model. imagine AI is a very powerful AI that can do a lot of things.", |
|
"query": "prompt", |
|
"response": "text", |
|
"testURL": "./api/imagine?prompt=cute+cat" |
|
|
|
} |
|
|
|
const {imagine} = require('@shuddho11288/sdxl-imagine') |
|
|
|
export default async function handler(req, res) { |
|
const prompt = req.query.prompt; |
|
const response = await imagine(prompt); |
|
res.status(200).json({...response}); |
|
} |