erictik / midjourney-api

MidJourney client. Unofficial Node.js client
Apache License 2.0
1.69k stars 283 forks source link

Error describing image: response.arrayBuffer is not a function #271

Open Slushbanq opened 5 months ago

Slushbanq commented 5 months ago

the code that reproduces this issue or a replay of the bug

export const describeImage = webMethod( Permissions.Anyone, async (imageUrl) => { const SALAI_TOKEN = "XXXXX"; const MIDJOURNEY_SERVER_ID = "XXXXX"; const MIDJOURNEY_CHANNEL_ID = "XXXXX";

    const client = new Midjourney({
        ServerId: MIDJOURNEY_SERVER_ID,
        ChannelId: MIDJOURNEY_CHANNEL_ID,
        SalaiToken: SALAI_TOKEN,
        fetch: fetch, 
        Ws: true,
        Debug: true
    });

    try {
        await client.Connect();
        const description = await client.Describe(imageUrl);
        console.log("Image Description:", description);
        return description;
    } catch (error) {
        console.error("Error describing image:", error);
        throw error;
    }
}

);

Describe the bug

Describe the bug GUYS PLEASE SOMEONE HELP! The code works when I replace the "Describe" with "Imagine" function as you can see here. image

Expected behavior But when I use the describe function with a simple link it gives me this error: image

Note that I am building a website and I am using the fetch and the Describe function on the backend code.

error log

🎊 ws ready!!! Hi: Slushbanq event READY_SUPPLEMENTAL 2024-05-06T01:23:05.897Z Error describing image: response.arrayBuffer is not a function response.arrayBuffer is not a function