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

[BUG] Webpage won't load #451

Open
inhahe opened this issue Feb 8, 2024 · 16 comments
Open

[BUG] Webpage won't load #451

inhahe opened this issue Feb 8, 2024 · 16 comments
Labels

Comments

@inhahe
Copy link

inhahe commented Feb 8, 2024

Model
lama

Describe the bug
I installed iopaint using the instructions in the readme on WSL2 (Ubuntu 22) running on Windows 11. I tried to load http://127.0.0.1:8080 in Chrome in Windows. It just loads for a long time showing nothing, then stops loading and continues to show nothing. My linux terminal shows some other stuff and then:

2024-02-08 16:09:29.669 | INFO     | iopaint.model_manager:init_model:39 - Loading model: lama
2024-02-08 16:09:29.670 | INFO     | iopaint.helper:load_jit_model:104 - Loading model from: /home/inhahe/.cache/torch/hub/checkpoints/big-lama.pt
INFO:     Started server process [5643]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
INFO:     127.0.0.1:56850 - "GET / HTTP/1.1" 200 OK
INFO:     127.0.0.1:56850 - "GET /assets/index-NQyCh9rO.js HTTP/1.1" 200 OK
INFO:     127.0.0.1:56864 - "GET /assets/index-iK_rIxV0.css HTTP/1.1" 200 OK
INFO:     127.0.0.1:53794 - "GET / HTTP/1.1" 304 Not Modified
INFO:     127.0.0.1:53794 - "GET /assets/index-NQyCh9rO.js HTTP/1.1" 200 OK
INFO:     127.0.0.1:53808 - "GET /assets/index-iK_rIxV0.css HTTP/1.1" 200 OK
INFO:     127.0.0.1:53808 - "GET /favicon.ico HTTP/1.1" 404 Not Found

(the two GETs are because I tried reloading the page.)

System Info
Software version used
1.0.4

  • lama-cleaner:
  • pytorch: 2.2.0
  • CUDA: n/a, it's using the CPU.
@Sanster
Copy link
Owner

Sanster commented Feb 9, 2024

It might be a bug in the front-end. Could you open Chrome's devtool and see what errors are reported in the console?

https://developer.chrome.com/docs/devtools/open?hl=zh-cn

@inhahe
Copy link
Author

inhahe commented Feb 9, 2024

I had quit the program and WSL, so I started WSL and the program again, and this time it works. I knew I should have tried that!

However, I can't for the life of me figure out how to outpaint using the web interface.

I just don't see a way to do it, so maybe the dev console errors aren't relevant, but here they are:

127.0.0.1-1707448429378.log

@inhahe
Copy link
Author

inhahe commented Feb 9, 2024

I see in three of the four videos on the readme page that there's a whole big panel to the right. I guess that's the problem. I don't know how to enable that panel.

@Sanster
Copy link
Owner

Sanster commented Feb 9, 2024

The side panel appears when using the Diffusion model. There are many models available in the readme, such as runwayml/stable-diffusion-inpainting. These models require a significant amount of computation, and running them without a GPU will be slow.

@inhahe
Copy link
Author

inhahe commented Feb 9, 2024

Thanks. But I'm having the problem with the page not loading again.

I installed iopaint again, this time on Windows 11, Python 3.11.2. I installed it with CUDA support this time, since I do have a GPU. I ran iopaint using iopaint start --device=cuda.

I actually did try restarting iopaint this time.

The same thing happens when I try to access the page in Chrome as I described earlier.

Here's the only console errors that came up:

Uncaught TypeError: Cannot read properties of undefined (reading 'getSelected')
    at jquery-1.4.min.js:188:13
content.js:7 Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at Array.<anonymous> (content.js:7:89199)
    at c.trigger (content.js:7:81786)
    at HTMLDocument.<anonymous> (content.js:7:81253)

@inhahe
Copy link
Author

inhahe commented Feb 9, 2024

I just restarted iopaint again to try it on Firefox, and now it's working on both firefox and Chrome. So the bug seems a bit random.

@Sanster
Copy link
Owner

Sanster commented Feb 9, 2024

I don't think this should be an error of iopaint, because iopaint doesn't depend on jquery at all. Could it be the influence of other chrome plugins?

@inhahe
Copy link
Author

inhahe commented Feb 9, 2024

Oh, hmm. I do have a few Chrome extensions running, not sure if any of them could be interfering. I guess they must be? I wouldn't know which one.

@inhahe
Copy link
Author

inhahe commented Feb 9, 2024

I guess the problem with the page not loading and the jquery error could be unrelated, because I don't have this problem with any other websites, and the specific error that popped up doesn't seem at glance to be one that would be likely to prevent the page from loading

@inhahe
Copy link
Author

inhahe commented Feb 9, 2024

If the webpage ever starts failing to load again, I'll see if there's a way I can disable all my chrome extensions and try it that way, or just try it in Firefox, and get back to you.

@netoneplus
Copy link

I'm also having the same problem.
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec. (:8080/assets/index-CXO-mkQB.js:1 )

@ziloka
Copy link

ziloka commented Apr 12, 2024

I had to download a favicon.ico file to the assets folder.

Eg since I knew iopaint was installed in this directory C:\Users\ziloka\.pyenv\pyenv-win\versions\3.10.6\Lib\site-packages\iopaint\web_app\assets

I downloaded a png and saved it as favicon.ico in that directory

After that I tried loading the page

and in the chrome dev tools i got the following error
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

I think this error is fixed if you disable cache in chrome and refresh the page.

https://developer.chrome.com/docs/devtools/network/reference#disable-cache-network-conditions

@denven
Copy link

denven commented Apr 23, 2024

Same issue here, Python 3.12, page cannot load(blank white page) on Chrome, Edge, Firefox, and Incognito or Private mode as well. Clear or disable cache doesn't help to resolve the issue.

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

@liguob666
Copy link

同样的问题,请教如何解决呢?
index-OPzQDLhO.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
我付费购买了一个一键安装的也是一样的。git代码到本地跑起来也是一样的问题!

@robertdu86
Copy link

robertdu86 commented Oct 7, 2024

I had the same problem, after searching and trying things for several hours, i found here a solution that worked for me by modifying a single value in regedit (#460) and then you need to restart the computer. The most ridiculous thing is, just after i found the solution, i realised i didn't need it for what i wanted to do, batching a lot of images can be done only with a command. I post here the command i used for doing a lot of files with the watermark at the same position because nothing is correctly expliqued in this site, they fucking suppose that everybody is familiarised with python and how to format the commands (first you need a different mask for vertical photos and horizontal photos and normally if the resolution is different he does it automatically but sometimes it doesn't work because the watermark is not rescaled to the resolution (I mean if the resolution is smaller the watermark is even bigger), so you need a different mask for that resolution creating a mask is easy you copy a photo you want to modify and open it in paint, you paint the watermark in white and the rest all in black).For the command, if you want to use the gpu you need to put --device=cuda otherwise its --device=cpu. The command i used is: iopaint run --model=lama --device=cuda --image=C:/Watermark_a_Supprimer/image --mask=C:/Watermark_a_Supprimer/Mask/horizontal.jpg --output=C:/Watermark_a_Supprimer/output. in this case i work on the horizontal photos, so you put your horizontals photos in the folder wich the path is behind "image=" and i used the mask i called "horizontal.jpg. I must say i am very happy to have persevered trying to make this thing works because the result is fantastic.
I want to had that sometimes you need to modify slightly your masks if the result is not perfect, i had to do it several times.

Copy link

github-actions bot commented Feb 1, 2025

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants