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

Deforum extension not working #308

Closed
2 tasks done
williamforty opened this issue Jan 24, 2023 · 6 comments
Closed
2 tasks done

Deforum extension not working #308

williamforty opened this issue Jan 24, 2023 · 6 comments
Labels
awaiting-response Waiting for the issuer to respond bug Something isn't working

Comments

@williamforty
Copy link

Has this issue been opened before?

  • It is not in the FAQ, I checked.
  • It is not in the issues, I searched.

Describe the bug

Firstly, based on my debugging I think this is the right place for this issue, however I could be wrong. I apologise in advance if this turns out to be the wrong place for raising it.

I am trying to get the deforum extension to work properly, but having trouble. It seems to install just fine, it loads the required tab, etc. However, the "Generate" button does not work. This is a known issue, but I suspect there are various underlying causes, and I suspect one underlying cause might be related to docker.

Like the above linked issue, I get the same submit_deforum error:

VM139:3 Uncaught (in promise) ReferenceError: submit_deforum is not defined
    at eval (eval at <anonymous> (index.4395ab38.js:75:2081), <anonymous>:3:14)
    at index.4395ab38.js:34:32410
    at HTMLButtonElement.<anonymous> (index.4395ab38.js:76:2455)
    at index.4395ab38.js:4:1266
    at Array.forEach (<anonymous>)
    at HTMLButtonElement.le (index.4395ab38.js:4:1253)
    at HTMLButtonElement._ (Button.svelte:10:48)
    at index.4395ab38.js:4:1266
    at Array.forEach (<anonymous>)
    at HTMLButtonElement.le (index.4395ab38.js:4:1253)

Scrolling up to the top of the console reveals some earlier errors though, which I suspect may be the real root cause:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)    deforum-hints.js:1
Failed to load resource: the server responded with a status of 500 (Internal Server Error)    deforum.js:1

The full paths of the requested files are:

http://localhost:7860/file=/stable-diffusion-webui/extensions/deforum/javascript/deforum-hints.js
http://localhost:7860/file=/stable-diffusion-webui/extensions/deforum/javascript/deforum.js

I'm afraid I'm no python expert, and I've never even heard of Gradio before today, so I'm not all that clear how these files end up being served to the browser. Therefore I'm not really able to debug the reason why these files can't be served up when they're requested (any help on this appreciated - happy to do some poking around, if I know where to poke!)

Inspecting the docker container, the files seem to exist at the /stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/javascript/ location as expected. Owner and permissions seem to match other similar files, for example in the /stable-diffusion-webui/extensions-builtin/ directory.

One difference I noticed is that the extensions directory is exposed outside of the docker container, which might somehow cause python/Gradio to be unable to interact with the files in the usual way. To test this hypothesis I copied the extension to the extensions-builtin directory, which seemed to then allow the .js files to be served up successfully, but then I get other errors (presumably because I can't just move things around and expect it to work, but I don't know this for sure)

So, perhaps there are limitations around how extensions can work on docker, if they're contained within a folder that is shared with the host OS?

Which UI

auto

Hardware / Software

  • OS: Windows 11
  • OS version: Version 21H2 (OS Build 22000.1455)
  • WSL version: 2
  • Docker Version: v4.16.1
  • Docker compose version: v2.15.1
  • Repo version: 510f9fa
  • RAM: 32GB
  • GPU/VRAM: 6GB

Steps to Reproduce

  1. Install Deforum extension
  2. Reload the UI
  3. Click on the Deforum tab
  4. Click the Generate button
  5. Inspect the console, and observe submit_deforum is not defined error
@williamforty williamforty added the bug Something isn't working label Jan 24, 2023
@AbdBarho
Copy link
Owner

@williamforty I guess we had a similar problem before #216

So, perhaps there are limitations around how extensions can work on docker, if they're contained within a folder that is shared with the host OS?

Pretty much so.

Because the extension folder is symlinked, the fully resolved path of the files in that folder does not fit the criteria that gradio uses to serve the file, so it ignores it.

I squeezed my head a lot for a good solution that does not involve just moving the extensions folder into the container, if you have any ideas I am all open ears.

@AbdBarho AbdBarho mentioned this issue Jan 24, 2023
@AbdBarho
Copy link
Owner

Ok so I managed to hack around it to get it up and running.

After merging #309, you can add the following to your startup.sh, install the defourm extension, and restart the container.

apt-get install ffmpeg -y
if [ -f ./extensions/deforum-for-automatic1111-webui/requirements.txt ]; then
  pip install -r ./extensions/deforum-for-automatic1111-webui/requirements.txt
  pip install -U opencv-python-headless 'transformers>=4.24'
fi

this will install all additional dependencies, and everything should work fine.

at least it worked for me.

download

AbdBarho added a commit that referenced this issue Jan 24, 2023
@williamforty
Copy link
Author

Thanks very much, it's now working! I tried it out before even adding the changes to startup.sh, and it seemed to work even without those changes - not sure why, maybe the dependencies are already in place from other things?

This was the result (slight graininess because I've had to compress to get under the github 10mb upload limit)

20230125065804_compressed

For my education, are the changes to startup.sh usually required to honour the install instructions for each individual extension? I suppose there's no telling what the requirements might be for installing each extension, so it's hard to handle in a generalised manner 🤔

@AbdBarho
Copy link
Owner

I had to revert this commit because it was causing other extensions to break. I will have to find a better solution....

I will comeback to your question later.

@AbdBarho
Copy link
Owner

AbdBarho commented Jan 27, 2023

Ok now, I managed to add another fix that did not break the world, although I am not very proud of it.

Regarding your question:

For my education, are the changes to startup.sh usually required to honour the install instructions for each individual extension?

startup.sh is basically a crutch for doing stuff in the container without having to modify or update the dockerfile.

The idea was, if any extensions need any additional dependencies or required any sort of configuration, you can do that in startup.sh.

I suppose there's no telling what the requirements might be for installing each extension, so it's hard to handle in a generalised manner 🤔

Correct. If am not mistaken, when you install an extension from the ui, if the extension has a requirements.txt, the dependencies will be installed (again, by the UI, not the container). This also means if you build a new version of the container and the extensions are already there, then you need to re-install their dependencies, that is why I prefer adding it directly to startup.sh.

This gets really tricky if you have conflicting versions of dependencies, deforum for example: source, target

I hope this answers your question.

If your problem is solved please close this issue.

@AbdBarho AbdBarho added the awaiting-response Waiting for the issuer to respond label Jan 27, 2023
@williamforty
Copy link
Author

Many thanks @AbdBarho, I'm satisfied the problem is solved, I think. 👍

torun225 added a commit to torun225/stable-diffusion-webui-docker that referenced this issue Feb 11, 2023
commit 3c860d6
Author: AbdBarho <ka70911@gmail.com>
Date:   Thu Feb 2 19:53:48 2023 +0100

    Update versions (AbdBarho#320)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@226d840
    - invoke:
    invoke-ai/InvokeAI@80c5322

    Remove `accelerate` for startup. Refs AbdBarho#317

    Use `SIGINT` Fixes AbdBarho#319

commit 15e9841
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Jan 29 20:07:41 2023 +0100

    Update versions (AbdBarho#316)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@00dab8f
    - invoke:
    invoke-ai/InvokeAI@07e03b3

commit eeb410f
Author: AbdBarho <ka70911@gmail.com>
Date:   Fri Jan 27 07:55:22 2023 +0100

    Update versions (AbdBarho#315)

    auto:
    AUTOMATIC1111/stable-diffusion-webui@7a14c8a
    invoke:
    invoke-ai/InvokeAI@e4cd662

    Also, fix script mounting in auto AbdBarho#295

commit 9d2a338
Author: AbdBarho <ka70911@gmail.com>
Date:   Wed Jan 25 18:17:10 2023 +0100

    Always serve static files (AbdBarho#314)

commit 95e489a
Author: AbdBarho <ka70911@gmail.com>
Date:   Wed Jan 25 17:38:25 2023 +0100

    Revert AbdBarho#309 (AbdBarho#313)

    Closes AbdBarho#312

commit 00518a0
Author: AbdBarho <ka70911@gmail.com>
Date:   Tue Jan 24 23:25:07 2023 +0100

    Add missing mkdir (AbdBarho#310)

commit f8de919
Author: AbdBarho <ka70911@gmail.com>
Date:   Tue Jan 24 23:11:15 2023 +0100

    Sync Scripts (AbdBarho#309)

    Refs AbdBarho#308

commit 8713163
Author: AbdBarho <ka70911@gmail.com>
Date:   Tue Jan 24 19:52:15 2023 +0100

    Update Auto (AbdBarho#307)

    AUTOMATIC1111/stable-diffusion-webui@93fad28

commit e2b0fb9
Author: AbdBarho <ka70911@gmail.com>
Date:   Tue Jan 24 19:17:34 2023 +0100

    Add Lora support (AbdBarho#306)

    Refs AbdBarho#305 AbdBarho#303

    Co-authored-by: repligator <114337591+repligator@users.noreply.github.com>

commit 510f9fa
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Jan 22 20:32:03 2023 +0100

    Update versions (AbdBarho#302)

    Closes AbdBarho#301

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@c98cb0f
    - invoke:
    invoke-ai/InvokeAI@89791d9

commit 042d5c5
Author: AbdBarho <ka70911@gmail.com>
Date:   Thu Jan 19 06:37:53 2023 +0100

    Fix link / mkdir order (AbdBarho#299)

    Fixes
    AbdBarho@c9153fa#commitcomment-97285124

commit 6684637
Author: AbdBarho <ka70911@gmail.com>
Date:   Wed Jan 18 18:50:56 2023 +0100

    Mount scripts instead of copy (AbdBarho#298)

    Refs AbdBarho#295

commit c9153fa
Author: AbdBarho <ka70911@gmail.com>
Date:   Wed Jan 18 18:48:34 2023 +0100

    Update versions (AbdBarho#297)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@6faae23
    - invoke:
    invoke-ai/InvokeAI@f232068

commit 13dfd4e
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Jan 15 11:50:16 2023 +0100

    Update auto (AbdBarho#293)

    AUTOMATIC1111/stable-diffusion-webui@d97f467

    This version has a hash computation of models, so expect slower start up
    & loading times.

commit 9b1ea3c
Author: AbdBarho <ka70911@gmail.com>
Date:   Fri Jan 13 21:27:55 2023 +0100

    [MAJOR] Update auto to torch 1.13.1 (AbdBarho#290)

    AUTOMATIC1111/stable-diffusion-webui@82725f0

    torch==1.13.1+cu117

    This might break your extensions!

commit b5cdf29
Author: AbdBarho <ka70911@gmail.com>
Date:   Mon Jan 9 19:04:40 2023 +0100

    Update versions (AbdBarho#287)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@2b94ec7
    - sygil:
    Sygil-Dev/sygil-webui@571fb89

commit db831ec
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Jan 7 18:58:50 2023 +0100

    Bump versions (AbdBarho#286)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@1512333
    - invoke:
    invoke-ai/InvokeAI@26e413a

commit ceeac61
Author: AbdBarho <ka70911@gmail.com>
Date:   Fri Jan 6 10:24:20 2023 +0100

    Update auto (AbdBarho#282)

    AUTOMATIC1111/stable-diffusion-webui@683287d

commit 19972f3
Author: AbdBarho <ka70911@gmail.com>
Date:   Wed Jan 4 20:36:49 2023 +0100

    Update Versions (AbdBarho#281)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@8149078
    - sygil:
    Sygil-Dev/sygil-webui@e484828
    - invoke:
    invoke-ai/InvokeAI@21bf512

commit 0c16c10
Author: AbdBarho <ka70911@gmail.com>
Date:   Tue Jan 3 21:19:37 2023 +0100

    Update auto (AbdBarho#280)

    AUTOMATIC1111/stable-diffusion-webui@3e22e29

commit 78c90e5
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Jan 1 16:46:41 2023 +0100

    Update auto & invoke (AbdBarho#277)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@524d532
    - invoke:
    invoke-ai/InvokeAI@524d532

    Happy new Year!!!

commit 6a3826c
Author: AbdBarho <ka70911@gmail.com>
Date:   Mon Dec 26 09:50:29 2022 +0100

    Update auto (AbdBarho#274)

    AUTOMATIC1111/stable-diffusion-webui@4af3ca5

    Merry Christmas 🎄

commit 56d9763
Author: AbdBarho <ka70911@gmail.com>
Date:   Thu Dec 22 09:19:39 2022 +0100

    Smaller xformers wheel (AbdBarho#271)

    Built with `Release` instead of `RelWithDebInfo`

    Related AbdBarho#270

commit 41e0dcc
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Dec 17 12:22:45 2022 +0100

    Auto: clean up interrogators (AbdBarho#265)

commit 5a9d305
Author: AbdBarho <ka70911@gmail.com>
Date:   Fri Dec 16 09:57:33 2022 +0100

    Update Invoke (AbdBarho#264)

    invoke-ai/InvokeAI@ffa54f4

commit d70e96d
Author: AbdBarho <ka70911@gmail.com>
Date:   Wed Dec 14 09:47:36 2022 +0100

    Update Invoke (AbdBarho#261)

    invoke-ai/InvokeAI@5d20f47

commit d97d257
Author: AbdBarho <ka70911@gmail.com>
Date:   Mon Dec 12 09:25:44 2022 +0100

    Update versions (AbdBarho#257)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@685f963
    - sygil:
    Sygil-Dev/sygil-webui@d3f9d05
    - invoke:
    invoke-ai/InvokeAI@e159bb3

commit c3cf812
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Dec 10 12:06:37 2022 +0100

    Expose API per default

commit b8256cc
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Dec 10 11:42:04 2022 +0100

    Update PR template

commit 4969906
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Dec 10 11:40:25 2022 +0100

    Update Download URLs

commit 8201e36
Author: AbdBarho <ka70911@gmail.com>
Date:   Fri Dec 9 18:14:48 2022 +0100

    Alpha support  for sd v2.x in auto (AbdBarho#244)

    AUTOMATIC1111/stable-diffusion-webui@44c46f0

    Install sd 2 from [these
    instructions](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#stable-diffusion-20),
    put the downloaded files in `data/StableDiffusion/`, maybe create a
    subfolder `v2` and put the models in it, just to keep everything clean.

    There will be problems, so be warry.

commit 1423b27
Author: AbdBarho <ka70911@gmail.com>
Date:   Fri Dec 9 16:50:46 2022 +0100

    Update Versions (AbdBarho#256)

    sygil:
    Sygil-Dev/sygil-webui@5291437
    Also, switch to pip instead of conda because it is really slow

    invoke:
    invoke-ai/InvokeAI@ed9186b

commit 87a51e9
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Dec 4 11:00:28 2022 +0100

    [BREAKING] Rename UIs (AbdBarho#254)

    Rename the UIs in docker compose to their new names

    Changes folder names

    Changes output folder structure

    Closes issue AbdBarho#263

    Adds `sygil-sl` instead of docker compose flag.

commit bdee804
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Dec 4 07:07:49 2022 +0100

    Fix mounting in Lstein (AbdBarho#253)

    Closes AbdBarho#251

commit f1a1641
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Dec 3 13:36:18 2022 +0100

    Invoke 2.2.3 (AbdBarho#250)

    lstein:
    invoke-ai/InvokeAI@5c31feb

commit 8df9d10
Author: AbdBarho <ka70911@gmail.com>
Date:   Wed Nov 30 19:33:44 2022 +0100

    Update versions (AbdBarho#246)

    - hlky:
    Sygil-Dev/sygil-webui@18a3b80
    - lstein:
    invoke-ai/InvokeAI@a9aa4e4

commit 7a1e52b
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Nov 26 15:45:53 2022 +0100

    Enable extensions by default (AbdBarho#243)

    Closes AbdBarho#242

commit d20b873
Author: AbdBarho <ka70911@gmail.com>
Date:   Fri Nov 25 13:25:10 2022 +0100

    Update xformers (AbdBarho#241)

    facebookresearch/xformers@8910bb5

commit 23757d2
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Nov 20 11:35:56 2022 +0100

    Update invoke (AbdBarho#234)

    invoke-ai/InvokeAI@2b7e3ab

commit 9e7979b
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Nov 20 11:05:39 2022 +0100

    Update Versions (AbdBarho#230)

    - auto:
    AUTOMATIC1111/stable-diffusion-webui@47a44c7
    - hlky:
    Sygil-Dev/sygil-webui@269107a

    Refs AbdBarho#216

commit 8623c73
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Nov 13 08:42:27 2022 +0100

    v1.5 Inpainting (AbdBarho#221)

    Also remove v1.4

    Closes AbdBarho#217

commit 9b6750b
Author: AbdBarho <ka70911@gmail.com>
Date:   Sun Nov 13 07:12:17 2022 +0100

    Use cuda 11.6 for auto (AbdBarho#220)

    auto:
    AUTOMATIC1111/stable-diffusion-webui@98947d1

    Closes AbdBarho#218 AbdBarho#219

commit 5e3f20b
Author: AbdBarho <ka70911@gmail.com>
Date:   Sat Nov 12 18:33:59 2022 +0100

    Move contribution to the top
Jordan-Lambda pushed a commit to Jordan-Lambda/lambda-cloud-stable-diffusion-2.0-webui-easy that referenced this issue Aug 2, 2023
Jordan-Lambda pushed a commit to Jordan-Lambda/lambda-cloud-stable-diffusion-2.0-webui-easy that referenced this issue Aug 2, 2023
cloudaxes pushed a commit to cloudaxes/stable-diffusion-webui-docker that referenced this issue Sep 6, 2023
cloudaxes pushed a commit to cloudaxes/stable-diffusion-webui-docker that referenced this issue Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-response Waiting for the issuer to respond bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants