ARImageSynthesizer

GRATIS CON POSSIBILITÀ DI UPGRADE
Popolarità

9.1 / 10

Latenza

135ms

Livello di servizio

100%

Health Check

N/A

Torna a tutte le discussioni

GET does not return image, it returns JSON

Rapid account: Franalissar
franalissar
7달 전

Basically when I do a request with postman I get the desired image in the body of th response, but when I do the request on a javascript file I get another json with this:

{2 items
"hash":"<my-image-hash>"
“message”:“File already in progress.”
}

What am I doing wrong here?

This is my getImage code:
const getPicture = async (hashval) => {
const url =
https://arimagesynthesizer.p.rapidapi.com/get?hash=’+hashval+’&returnType=image’;
const options = {
method: “GET”,
headers: {
“X-RapidAPI-Key”: “api-key”,
“X-RapidAPI-Host”: “arimagesynthesizer.p.rapidapi.com”,
},
};

try {
await fetch(url, options)
.then((response) => response.blob())
.then((blob) => {
const reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = () => {
const base64data = reader.result;
console.log(base64data);
const parentElement = document.getElementById(“imageDiv”);
const imgElement = document.createElement(‘img’);
imgElement.id = ‘genimg’;
imgElement.src = base64data;
parentElement.append(imgElement);
};
});
} catch (error) {
console.error(error);
}
};

export default getPicture();

Rapid account: Ardic AI Team
ArdicAITeam Commented 7달 전

Hello Franalissar,

The JSON response you received is not an error; it is simply meant to inform you about the image generation process. By default, all requests are placed in a queue, and the images are generated in accordance with their position in the queue. In your case, your request is currently at the front of the queue and is being processed.

At the moment, we are facing some technical difficulties due to high traffic, which may cause your image to be stuck in the “in process” state or even discarded. Rest assured, our team is actively working on finding a solution and implementing a better way to keep users informed.

Best regards,
ARDIC AI Team

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti