ferranfg / midjourney-discord-api-php

Generate images using Midjourney Bot through the Discord API.
https://ferranfigueredo.com
MIT License
135 stars 35 forks source link

Prompting twice Instead instead of Once #10

Closed mrphpdev closed 1 year ago

mrphpdev commented 1 year ago

My Code :

    $message = $midjourney->generate('eg prompt');
    $url = $message->upscaled_photo_url;
    echo $url;
    copy($url, './midjourney/images/input/'.$i.'.png');
  1. the midjourney Bot starts processing prompt
  2. It gives the image with 4 images to upscale
  3. Code picks the 1st one to upscale
  4. After Upscaling the code returns the url
  5. I set copy it to store
  6. Again The processing Starts after Upscalling and the browser loading ends resulting in 2 times but it upscales only one prompt and the other lefts processing

if it happens many times , then the discord may ban you for spamming Please Fix it

ferranfg commented 1 year ago

There is a demo.php file in this repo. Can you try if it happens also when you use this code?

mrphpdev commented 1 year ago

I tried with Demo.php code same happens , first it returns the image , the loading stops in localhost then again the prompt is entered for image generation

mrphpdev commented 1 year ago

Update : This can be fixed by running it through command line :

eg :

php demo.php