erictik / midjourney-api

MidJourney client. Unofficial Node.js client
Apache License 2.0
1.67k stars 278 forks source link

"Naughty" prompts #93

Open waynemareci opened 1 year ago

waynemareci commented 1 year ago

Wonder if you've given any thought to processing rejected prompts

image

I've seen this using words like "flesh" or "overdose". Right now Imagine() eventually times out and returns a null message. Can anything be done to catch this response?

zcpua commented 1 year ago

https://github.com/erictik/midjourney-api/blob/main/example/imagine-ws.ts#L17

Ws:true

waynemareci commented 1 year ago

I have Ws set to true

waynemareci commented 1 year ago

I failed to run client.init(); this seems to resolve my issue. Can you explain the purpose of client,init()? It's not used in Usage in the readme.md on the midjourney-api home page.

zcpua commented 1 year ago

Wait for Discord websocket to connect successfully

LukeFerris commented 1 year ago

Some interesting further behaviour on this. If you appeal successfully, it looks like that key word (blood in my example below) is then allowed going forwards - but with a slight difference in behaviour. Once the image is created, it seems to delete the original message and displays the result in a new message (see "original message was deleted" at the top of the image).

Screenshot 2023-06-11 at 09 04 25

This thwarts the midjourney api code in ever linking up with the successful image (I suspect) which causes it to eventually return null / timeout.

I wonder whether this bit is solveable..