When I attempt to use the fetch thing to use sdxl for a discord bout but it outprints an error
Heres my fetching function
async function query(data) {
const response = await fetch(
"https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0",
{
headers: {
Authorization: "Bearer "+config.API,
"Content-Type": "application/json"
},
method: "POST",
body: JSON.stringify(data),
}
);
const result = await response.json();
return result;
}
.....
.....
const output = query(prompt)
And my error is
ExpectedConstraintError > s.string.url
Invalid URL
Expected: expected to match a URL
Received:
| '[object Promise]'
at Object.run (D:Skye DataDownloadsmidjourney-bot-masternode_modules@sapphireshapeshiftdistcjsindex.cjs:2363:27)
at D:Skye DataDownloadsmidjourney-bot-masternode_modules@sapphireshapeshiftdistcjsindex.cjs:939:67
at Array.reduce (<anonymous>)
at _StringValidator.parse (D:Skye DataDownloadsmidjourney-bot-masternode_modules@sapphireshapeshiftdistcjsindex.cjs:939:29)
at ButtonBuilder.setURL (D:Skye DataDownloadsmidjourney-bot-masternode_modules@discordjsbuildersdistindex.js:651:34)
at Object.run (D:Skye DataDownloadsmidjourney-bot-mastersrcslashCommandsinformationimagine.js:44:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Client.<anonymous> (D:Skye DataDownloadsmidjourney-bot-mastersrceventsclientinteractionCreate.js:43:9)
I was expecting it to change the reply into the image in which because of the error it just timed out.