midjourney-api
midjourney-api copied to clipboard
Imagine() does not throw error if prompt is against MJ standards
the code that reproduces this issue or a replay of the bug
try {
const imagine = await this.client.Imagine(
jobData.prompt,
async (uri, progress) => {
console.debug("imagine in progress", uri, progress);
},
);
if (imagine) {
console.info("imagine successfully", imagine);
return imagine;
}
} catch (e) {
console.error("imagine failed", e);
if (e.message.includes("against our community standards")) {
// Error message might contain:
//
// Sorry! Our AI moderator thinks this prompt is probably against our community standards.
//
// Please review our current community standards:
//
// **ALLOWED**
// - Any image up to PG-13 rating involving fiction, fantasy, mythology.
// - Real images that may be seen as respectful or light-hearted parodies, satire, caricatures
// - Imaginary or exaggerated real-life scenarios, including absurd or humorous situations.
//
// **NOT ALLOWED**
// - Disrespectful, harmful, misleading public figures/events portrayals or potential to mislead.
// - Hate speech, explicit or real-world violence.
// - Nudity or unconsented overtly sexualized public figures.
// - Imagery that might be considered culturally insensitive
//
// This AI system isn't perfect. If you find it rejecting something innocent please press the **Notify Developers** button and we will review it and try to further improve our performance. Thank you for your help!"
}
return null;
}
Describe the bug
Describe the bug
- Enter the prompt which is to draw porn or weapon or anything might against MJ standards
- Submit the prompt successfully and receive an error model show that the prompt is against MJ community standards
- client.Imagine() does not throw any error
Expected behavior
- client.Imagine() should throw error right away when the error model shows up
Screenshots
The weird thing, If I put a break point at line 633 of src/discord.ws.ts
, client.Imagine() throws error correctly.
But if I remove the break point, got the log of error modal but no error is thrown.
error log
Error: Sorry! Our AI moderator thinks this prompt is probably against our community standards. Please review our current community standards: ALLOWED - Any image up to PG-13 rating involving fiction, fantasy, mythology. - Real images that may be seen as respectful or light-hearted parodies, satire, caricatures - Imaginary or exaggerated real-life scenarios, including absurd or humorous situations. NOT ALLOWED - Disrespectful, harmful, misleading public figures/events portrayals or potential to mislead. - Hate speech, explicit or real-world violence. - Nudity or unconsented overtly sexualized public figures. - Imagery that might be considered culturally insensitive This AI system isn't perfect. If you find it rejecting something innocent please press the Notify Developers button and we will review it and try to further improve our performance. Thank you for your help! at WsMessage.messageCreate (D:\Chatbot\midreborn\modules\mj_workers\node_modules\midjourney\libs\discord.ws.js:132:39) at WsMessage.onMessageCreate (D:\Chatbot\midreborn\modules\mj_workers\node_modules\midjourney\libs\discord.ws.js:237:14) at D:\Chatbot\midreborn\modules\mj_workers\node_modules\midjourney\libs\discord.ws.js:464:31 at Array.forEach (