diggedypomme / Kindlefusion

Using kindle horde
79 stars 1 forks source link

hangs after "JS SHOULD BE CONVERTING" #4

Closed haruishi43 closed 1 year ago

haruishi43 commented 1 year ago

Thanks for open-sourcing this project! It's a neat feature for a kindle that I don't really have a need for.

I got the dependencies and webui working, but there seem to be issues getting the output of stablediffusion on the kindle:

INFO       | 2023-07-17 03:23:55 | __main__:generate:612 - {'finished': 0, 'processing': 1, 'restarted': 0, 'waiting': 0, 'done': False, 'faulted': False, 'wait_time': 0, 'queue_position': 0, 'kudos': 1.0, 'is_possible': True}
update_to_display: update_mode=PARTIAL, wave_mode=257 inverted=0
INFO       | 2023-07-17 03:23:57 | __main__:generate:612 - {'finished': 1, 'processing': 0, 'restarted': 0, 'waiting': 0, 'done': True, 'faulted': False, 'wait_time': 0, 'queue_position': 0, 'kudos': 13.0, 'is_possible': True}
update_to_display: update_mode=PARTIAL, wave_mode=257 inverted=0
DEBUG      | 2023-07-17 03:23:59 | __main__:generate:649 - Downloading 'e3079a5b-80af-424b-a56a-5d8694eb7108' from https://a223539ccf6caa2d76459c9727d276e6.r2.cloudflarestorage.com/stable-horde/e3079a5b-80af-424b-a56a-5d8694eb7108.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=b30a941498880b9cabb6500261b6f539%2F20230717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20230717T032359Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Signature=6233f432373acc524c3587061d592f58b3daa3ac8ba9ce527d8a5ae2089cadd7
JS SHOULD BE CONVERTING,JS SHOULD BE CONVERTING JS SHOULD BE CONVERTING
192.168.1.11 - - [17/Jul/2023 03:24:01] "GET /do_html_fusion_js/dancing%20piggy HTTP/1.1" 200 -

After 'JS SHOULD BE CONVERTING,JS SHOULD BE CONVERTING JS SHOULD BE CONVERTING', the kindle shows "Loading..." box and the log seems to just hang. Do you have any idea what might be the cause of this?

Thanks in advance!

haruishi43 commented 1 year ago

I found out that some prompts work, while others just hang.

diggedypomme commented 1 year ago

Thank you for your kind words. Sometimes it takes longer to do an image due to their server, but it sounds like it should have finished. Are you doing this from the main page or via the mobile version? If it is the main page, please could you do f12 and check the js console. It should pass the webp through to the browser, and then in js convert it to jpg and pass it back to the server, so i wonder if something is up with the JS part, as it does suggest it finished generating. Also do the images show up in the gallery? Im guessing not, but worth checking.

BTW, I did some updates which I haven't uploaded yet, but which have an extra clock thing using pre-done stable diffusion images - you can see the clockfaces that I made for it here: https://diggedypomme.com/clockfaces/ , It's not linked apart from the ability to start and stop the clocks from within Kindlefusion. I will try and get that part shared too if it is of interest

Kind regards

haruishi43 commented 1 year ago

Thank you for the response.

diggedypomme commented 1 year ago

Thank you - does the temp2.png match the image that you were trying to get it to generate?

That's odd that the size doesn't match - I thought I had it set to go to stable horde and generate them in 600x800, but looking back I have it to

                "width": 384,
                "height":512,
                "steps": 50,

I think there might have been a limitation on going past 512 with the free api key, but you could have a play with that setting.

It is set to scale the image to match the width rather than the height I think:

if im.width > im.height:
    im = im.transpose(Image.ROTATE_270)

# Resize image

width, height = im.size
new_width = 600
new_height = int(height * (new_width / width))
im = im.resize((new_width, new_height), Image.ANTIALIAS)

I know doing the requests with Unsplash does get some different dimensioned ones tho, but I don't have control over them.

Yea you're very welcome to play with it and advise on any changes - it's great seeing other people interested in it too :) Thanks

haruishi43 commented 1 year ago

does the temp2.png match the image that you were trying to get it to generate?

I know doing the requests with Unsplash does get some different dimensioned ones tho, but I don't have control over them.

Yea you're very welcome to play with it and advise on any changes - it's great seeing other people interested in it too :) Thanks

diggedypomme commented 1 year ago

Sorry - was away for a week. I haven't had that issue that I can remember, however it does sound like it is the JS that is failing, so it would be interesting to see the logs from that. I have been using Chrome if that makes a difference - I wonder if it is acting differently in Firefox.

Cool yea I'll get a github set up for the clockfaces in the next few days, thanks

rohanmaan commented 1 year ago

Thank you for your kind words. Sometimes it takes longer to do an image due to their server, but it sounds like it should have finished. Are you doing this from the main page or via the mobile version? If it is the main page, please could you do f12 and check the js console. It should pass the webp through to the browser, and then in js convert it to jpg and pass it back to the server, so i wonder if something is up with the JS part, as it does suggest it finished generating. Also do the images show up in the gallery? Im guessing not, but worth checking.

BTW, I did some updates which I haven't uploaded yet, but which have an extra clock thing using pre-done stable diffusion images - you can see the clockfaces that I made for it here: https://diggedypomme.com/clockfaces/ , It's not linked apart from the ability to start and stop the clocks from within Kindlefusion. I will try and get that part shared too if it is of interest

Kind regards

The clock faces look super nice. What stable diffusion prompts did you use to get such images?

diggedypomme commented 1 year ago

Heya, thank you very much, I'm so sorry, I haven't got round to completing the github for that yet. I am working non stop 12 hr shifts until Monday, but I am then off for a few days so I will definitely get it done then, along with the guide for making them, the prompts used, and zips for the images and the script to run them on a kindle.

I used stable diffusion with controlnet but I will need to look up the prompts that I used for each of the clock faces as I used slightly different settings for each. In summary though, i made the images for each minute via a pythons script, and then i fed that through controlnet depth and put something quite simple like "bees" or what have you (will need to double check).

Controlnet has just been released for stable diffusion xl so it would be interesting to see how these compare - I will see if I can get a new clockface done. I am open to suggestions for any that people would like me to try and make. I am running a 3070ti so it might take a while to do one with xl

rohanmaan commented 1 year ago

Awesome.Thanks a lot. Cheers.

diggedypomme commented 1 year ago

Heya, The zips with the images are still uploading, and I need to find the code for linking this all through to Kindlefusion for launching it, but I made this github for the clockfaces https://github.com/diggedypomme/KindleTimeMachine I put each of the settings that I had used for generating the images in the readme, along with the code I used to generate the base clock images. I also zipped them and they should be uploading at the moment too

haruishi43 commented 1 year ago

@diggedypomme thanks for the update! the work you put into documenting the code makes it so much easier to understand and reproduce your work. amazing work!

btw, I'm going to close this and will ask questions in another issue.

diggedypomme commented 1 year ago

Very welcome, thank you

rohanmaan commented 1 year ago

Heya, The zips with the images are still uploading, and I need to find the code for linking this all through to Kindlefusion for launching it, but I made this github for the clockfaces https://github.com/diggedypomme/KindleTimeMachine I put each of the settings that I had used for generating the images in the readme, along with the code I used to generate the base clock images. I also zipped them and they should be uploading at the moment too

Thank you very much.Appreciate all your effort.

diggedypomme commented 1 year ago

No problem, thank you