Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

progress method is not called for Imagine #282

Open
TiPEX360 opened this issue Aug 11, 2024 · 3 comments
Open

progress method is not called for Imagine #282

TiPEX360 opened this issue Aug 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@TiPEX360
Copy link

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

const mjClient = new Midjourney({
ServerId: process.env.MJ_SERVER_ID,
ChannelId: process.env.MJ_CHANNEL_ID,
SalaiToken: process.env.MJ_SALAI_TOKEN ?? "",
Ws: true
})

await mjClient.init()

await mjClient.Imagine("Example prompt", (uri, progress) => {
console.log("progress called")
console.log(uri, progress)
})

Describe the bug

Describe the bug
A clear and concise description of what the bug is.

The progress callback function passed to Imagine is never called. No log messages appear with the above example.

Expected behavior
A clear and concise description of what you expected to happen.

Progress function should be called. uri and progress strings logged to the console using the example code given.

Screenshots
If applicable, add screenshots to help explain your problem.

error log

🎊 ws ready!!! Hi: null

@TiPEX360 TiPEX360 added the bug Something isn't working label Aug 11, 2024
@Magomed-R
Copy link

Good day. I encountered the same problem. Tell me, did you solve it somehow? Are there any workarounds?

@ponyzy
Copy link

ponyzy commented Nov 22, 2024

Good day. I encountered the same problem. Tell me, did you solve it somehow? Are there any workarounds?

mjclient.wsClient.onSystem("messageUpdate",(msg)=>{
this.messagefilter( msg );
});
if( msg.type == 20 && msg.content )
{
let mtxt = msg.content;
let perpos = mtxt.lastIndexOf('%)');
if( perpos > 0 )
{
let perposb = mtxt.indexOf('(', perpos - 4);
let progress = mtxt.substring( perposb + 1,perpos);
progress = tools.getInt( progress );

@Magomed-R
Copy link

mjclient.wsClient.onSystem("messageUpdate",(msg)=>{ this.messagefilter( msg ); }); if( msg.type == 20 && msg.content ) { let mtxt = msg.content; let perpos = mtxt.lastIndexOf('%)'); if( perpos > 0 ) { let perposb = mtxt.indexOf('(', perpos - 4); let progress = mtxt.substring( perposb + 1,perpos); progress = tools.getInt( progress );

Oh, thanks! Honestly, I've already started rewriting the library for myself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants