light-and-ray / sd-webui-replacer

A tab for sd-webui for replacing objects in pictures or videos using detection prompt
193 stars 11 forks source link

Webui first load problem with scripts #36

Closed mykeehu closed 6 months ago

mykeehu commented 6 months ago

I have the latest version of both the plugin and Webui installed, the error also occurred on Forge. When I open Webui for the first time, the controls are not usable on it. I see this error in the Chrome console:

error running callback ƒ replacerRemoveInpaintDiffMaskUpload() {
    const mask = gradioApp().getElementById('replacer_inpaint_diff_mask_view');
    var imageContainer = mask.getElementsByClassName('image-container')[0];
… : TypeError: Cannot read properties of null (reading 'getElementsByClassName')
    at replacerRemoveInpaintDiffMaskUpload (replacer.js?1707903619.0917509:79:31)
    at executeCallbacks (file=script.js?1702938585.5389194:83:13)
    at MutationObserver.<anonymous> (file=script.js?1702938585.5389194:112:9)

file=script.js?1702938585.5389194:85 error running callback ƒ replacerRemoveInpaintDiffMaskUpload() {
    const mask = gradioApp().getElementById('replacer_inpaint_diff_mask_view');
    var imageContainer = mask.getElementsByClassName('image-container')[0];
… : TypeError: Cannot read properties of null (reading 'getElementsByClassName')
    at replacerRemoveInpaintDiffMaskUpload (replacer.js?1707903619.0917509:79:31)
    at executeCallbacks (file=script.js?1702938585.5389194:83:13)
    at MutationObserver.<anonymous> (file=script.js?1702938585.5389194:112:9)

error running callback ƒ replacerApplyZoomAndPanIntegration () {
    if (typeof window.applyZoomAndPanIntegration === "function") {
        window.applyZoomAndPanIntegration_replacer_mod("#replacer_advanced_options", ["#re… : TypeError: window.applyZoomAndPanIntegration_replacer_mod is not a function
    at replacerApplyZoomAndPanIntegration (replacer.js?1707903619.0917509:66:16)
    at executeCallbacks (file=script.js?1702938585.5389194:83:13)
    at MutationObserver.<anonymous> (file=script.js?1702938585.5389194:112:9)

If I disable the extension, the webui runs fine. But then I get this message in the cmd console: *** Extension "sd-webui-replacer" requires "sd-webui-segment-anything" which is disabled. The segment-anything is not disabled, so the reverse would be correct: *** Extension "sd-webui-replacer" is disabled.

light-and-ray commented 6 months ago

If I disable the extension, the webui runs fine. But then I get this message in the cmd console: *** Extension "sd-webui-replacer" requires "sd-webui-segment-anything" which is disabled. The segment-anything is not disabled, so the reverse would be correct: *** Extension "sd-webui-replacer" is disabled.

Fixed in dev:

Do you mean webui can't run completely, or only these js callbacks?

mykeehu commented 6 months ago

Do you mean webui can't run completely, or only these js callbacks?

None of the buttons or lists work, I temporarily refresh the interface with CTRL+F5 and then it should be fine.

light-and-ray commented 6 months ago

Thanks for reporting. Committed fix. If the problems are gone, you can close the issue

light-and-ray commented 6 months ago

Do you mean webui can't run completely, or only these js callbacks?

None of the buttons or lists work, I temporarily refresh the interface with CTRL+F5 and then it should be fine.

I have the same some times. Unfortunately it's not because these errors. I think it's because gradio wasn't designed for such big apps and a lot of extensions

mykeehu commented 6 months ago

Very interesting. Because there's no script error anymore, it's perfect. However, the loading is still buggy, as if it was stuck with some loader. So the buttons are not usable, and the lists are not updated, just like the Extensions tab doesn't load the items. Here are the extensions I use, are there any of them that might be incompatible?

image

Update: now there will definitely be some incompatibility with another extension. When I enabled only yours, controlnet and segment-anything, there was no problem. So I'll start testing one by one. image

light-and-ray commented 6 months ago

Yes, need to disable all unused extensions. Also in settings you can hide unused tabs

For me, when this bug happens, I need to reopen the page, not just reload

mykeehu commented 6 months ago

I'm here now, but it's working well for now. As soon as I find out which plug-in it's stuck with, I'll post it here. image

mykeehu commented 6 months ago

We have the problematic extension. Unfortunately the extension conflicts with Supermerger :( https://github.com/hako-mikan/sd-webui-supermerger

I tried it on Auto1111 and Forge. Only one of the extensions can be enabled, otherwise the error occurs. Is it calling some function or definition that might be the same? I don't know, unfortunately I am not a programmer. I report the problem to him.

light-and-ray commented 6 months ago

I confirm, enabled this, and got this error 😆 But after reopening it fixes. I enable it only if I need merge loras