Giter Club home page Giter Club logo

Comments (26)

hlky avatar hlky commented on July 19, 2024 4

Closing this as it seems to be resolved for those involved, if anyone else has a problem they can create another issue.

from stable-diffusion.

hlky avatar hlky commented on July 19, 2024

It looks like it hasn't updated for some reason, there must be an issue with the linux installation script.

@JoshuaKimsey made the guide and linux installation script, you'll have to wait for him to have a look, I haven't tried the linux instructions myself because I use windows

My suggestion would be try git pull to get the updates

from stable-diffusion.

stestagg avatar stestagg commented on July 19, 2024

This error typically happens when Python can't find the stable-diffusion code to import.
it may be worth trying:
env PYTHONPATH=. ./linux-sd.sh

This will make python look in the 'current directory' for imports, and then it will find the frontend directory.
The various helper/wrapper scripts end up trying to run the UI server from the correct directory.

I haven't tried it myself, as I run the server slighly differently, but this should work

from stable-diffusion.

FyorUU avatar FyorUU commented on July 19, 2024

Same issue here, it seems many other modules in webui.py aren't found either, "frontend" being the first. (gradio, k_diffusion, pynvml, torch, einops, omegaconf, ldm, transformers, gfpgan, basicr, realesrgan).

Haven't had any luck with the env PYTHONPATH= command @stestagg suggested.

Probably a very simple problem but I hope it gets resolved soon since I don't know how to fix this either :)

from stable-diffusion.

hlky avatar hlky commented on July 19, 2024

@FyorUU sounds like the environment isn't being created or something.

You could try docker if you need the installation to be as automatic as possible

from stable-diffusion.

yourjelly avatar yourjelly commented on July 19, 2024

I had this issue getting my docker running. The problem had to do with folder permissions when installing conda, so it wasn't doing it at all.

CONDA_DIR /opt/conda
wget -O ~/miniconda.sh -q --show-progress --progress=bar:force https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
    /bin/bash ~/miniconda.sh -u -b -p $CONDA_DIR && \
    rm ~/miniconda.sh
PATH=$CONDA_DIR/bin:$PATH
conda update -n base -c defaults conda

This fixed it for me. Although I wasn't going to recommend edits because I think it's due to an Unraid quirk

from stable-diffusion.

FyorUU avatar FyorUU commented on July 19, 2024

Fixed it! I had 2 major problems.

@hlky The problem indeed seemed to be with the environment. I'm also using the Linux install script which requires you to manage Anaconda/Miniconda yourself beforehand, but it didn't work with miniconda3 and only worked when I eventually installed the regular anaconda3. Both could run 'conda env' which the guide states as a requirement.

Finding frontend/frontend.py was my first issue which @MeesCode also had, I solved this with setting PYTHONPATH=. in the ultimate-stable-diffusion directory (thanks @stestagg). I don't know if this has to be done with the environment active but did it in the lsd env.

Then frontend.py in the frontend folder could be found now, but all the other modules which conda should have taken care of couldn't be found.
I've removed miniconda3 and installed anaconda3, then reinstalled the script, which appears to have completely solved the issue. Happily generating images with the browser gui now.

So in conclusion: the Linux install script might only work with anaconda3 and the PYTHONPATH needs to be corrected.

from stable-diffusion.

skorokithakis avatar skorokithakis commented on July 19, 2024

This fails in docker-compose up as well.

from stable-diffusion.

dogarrowtype avatar dogarrowtype commented on July 19, 2024

I fixed this with a simple pip3 install -e . in the stable-diffusion folder after a commit a day or so ago caused this bug.

from stable-diffusion.

JoshuaKimsey avatar JoshuaKimsey commented on July 19, 2024

Both could run 'conda env' which the guide states as a requirement.

@FyorUU @hlky Wait, does miniconda3 use different commands compared to the regular Anaconda? I thought both used the same conda env commands to manage environments? I may need to investigate this further... I never needed to mess with the PYTHONPATH either, so it may be it's an issue between Anaconda and Miniconda. I'll look into this and respond shortly.

from stable-diffusion.

skorokithakis avatar skorokithakis commented on July 19, 2024

@dogarrowtype that didn't work for me in Docker, sadly.

from stable-diffusion.

FyorUU avatar FyorUU commented on July 19, 2024

@JoshuaKimsey They do both feature the 'conda env' command at the very least, and your Linux install script also seemed to display the same things either way from what I remember seeing (such as successfully installing all the environment.yaml modules).
Miniconda3 didn't seem to have any problems in the installer script at all until it is time to run the relauncher.py, which will keep failing due to not finding the correct modules.

It could still be a user error on my part, all I know for sure is that I have repeatedly failed running the installer with miniconda3 trying all kind of things and was finally successful after switching to anaconda3.
I hope you can recreate and fix the issue, good luck and thank you for your work Joshua and hlky.

from stable-diffusion.

yourjelly avatar yourjelly commented on July 19, 2024

@dogarrowtype that didn't work for me in Docker, sadly.

Also try on line 25 of entrypoint.sh
25:PIP_EXISTS_ACTION=w

from stable-diffusion.

JoshuaKimsey avatar JoshuaKimsey commented on July 19, 2024

@FyorUU I just uninstalled Anaconda3 and installed Miniconda3 and it still worked as expected. So I'm really not sure what is causing the issue that you encountered. I think probably the best solution is what you did, which is uninstall Miniconda and install Anaconda. It could be an edge case thing between how the two install for some people. I really need to try and figure out if there is a way to test for an install of Anaconda and just do it for the user.

I did discover a small issue while testing this though. It seems the environment.yaml may not be updating correctly when I pull new updates down from GitHub, so I'll need to look into that. That should have no effect on the initial run of the script installing it though, which means no effect on the Anaconda vs Miniconda thing.

from stable-diffusion.

trufty avatar trufty commented on July 19, 2024

Try this at the top of webui.py

import sys
sys.path.append('.')

edit: This fixed it for me in my custom docker container

from stable-diffusion.

JoshuaKimsey avatar JoshuaKimsey commented on July 19, 2024

@MeesCode Hey sorry I just realized I had replied back to you directly. I'm not sure why this would be throwing that error. It is possible it's a problem with my script, but the first main thing is to make sure that you have the latest updates from the repo, the latest version of my script, and that Anaconda is setup correctly. I tested Miniconda and it worked fine for me as well, however others here, such as @FyorUU, seemed to have issues getting it to function correctly with it.

If you would like to try the full-fledged version of Anaconda first, then you can uninstall miniconda (it's the same instructions for Anaconda and Miniconda, just change the folder name in step 2, as well as remove the conda path in your .bash_profile/.bashrc file), then you can install the full-fledged Anaconda and try that out instead. The instructions should tell you how to do it for your system type.

Let me know if you have anymore issues with this, and I'll see how I can help.

from stable-diffusion.

rolo avatar rolo commented on July 19, 2024

I managed to fix this after having the same issue with the missing "frontend" module after running the linux installer (Ubuntu 22.04) by simply activating the env after the script finished running.

It looked to me as though it was trying to run without using the new conda env so not finding any of the dependencies.

So after the script had failed I activated the conda env with:

conda activate lsd

I was then able to launch from the ultimate-stable-diffusion dir with:

python scripts/webui.py

I'm using miniconda rather than full anaconda. I installed it following the instructions in the official Stable Diffusion repo the other day, I haven't used any anaconda version prior to this so am not best placed to try and fix the installed script if this is the issue, but maybe this will help someone else. Cheers.

from stable-diffusion.

JoshuaKimsey avatar JoshuaKimsey commented on July 19, 2024

@rolo Yeah, Miniconda seems to be an issue for some people. I'm not completely sure why, but my only suggestion is to uninstall Miniconda and install the full version of Anaconda instead. I left instructions and links for that in my last post above here. Try that and see if it works correct;y. Also, make sure you have the newest version of the script installed too.

from stable-diffusion.

rolo avatar rolo commented on July 19, 2024

@rolo Yeah, Miniconda seems to be an issue for some people. I'm not completely sure why, but my only suggestion is to uninstall Miniconda and install the full version of Anaconda instead. I left instructions and links for that in my last post above here. Try that and see if it works correct;y. Also, make sure you have the newest version of the script installed too.

Ah sorry I wasn't clear - I was letting folks know I got it running fine with miniconda I just needed to activate the env afterwards. I've edited my post.

from stable-diffusion.

rbracco avatar rbracco commented on July 19, 2024

Same issue here, it seems many other modules in webui.py aren't found either, "frontend" being the first. (gradio, k_diffusion, pynvml, torch, einops, omegaconf, ldm, transformers, gfpgan, basicr, realesrgan).

Haven't had any luck with the env PYTHONPATH= command @stestagg suggested.

Probably a very simple problem but I hope it gets resolved soon since I don't know how to fix this either :)

I'm experiencing the same, it's like the script doesn't install any of the libraries and they have to be added one by one.

from stable-diffusion.

JoshuaKimsey avatar JoshuaKimsey commented on July 19, 2024

@rbracco Are you using Anaconda or Miniconda?

from stable-diffusion.

rbracco avatar rbracco commented on July 19, 2024

I tried with Miniconda, uninstalled and cleared everything from my .bashrc and started over with Anaconda.

Ubuntu 20.04, installed Anaconda3-2022.05-Linux-x86_64.sh

from stable-diffusion.

yourjelly avatar yourjelly commented on July 19, 2024

from stable-diffusion.

rbracco avatar rbracco commented on July 19, 2024

I just now got it working after around an hour of fiddling but it required lots of small manual installs into the environment including stuff like updating some subdependencies (e.g. websockets 9.1->10.3) to get around errors. I also had to manually execute the WGET for the GFPGAN and RealESRGAN, and I still have the warning LDSR not found at path, please make sure you have cloned the LDSR repo to ./src/latent-diffusion/ but it is at least generating images.

Edit: to be clear I'm precisely following the install guide here: https://github.com/hlky/stable-diffusion/wiki/Linux-Installation

from stable-diffusion.

JoshuaKimsey avatar JoshuaKimsey commented on July 19, 2024

@rbracco Geez... I'm not sure what's going on. Did it start working after switching to Anaconda? Also, what did the terminal say when my script got to the point of downloading the models? Because that should be a simple operation on it's own? I'm trying to figure out what's going wrong for some people, cause most of what I use is basic Bash stuff, save for the environment stuff using Conda.

from stable-diffusion.

rbracco avatar rbracco commented on July 19, 2024

Here's a long post with the process I followed, hope it helps you to debug. Thanks for your work.

Output on the normal script looked totally successful:
image

Then after asking if I wanted to run in standard/optimized mode (I chose optimized and have > 6gb ram) I got the gradio not installed error
image

I noticed at that point lsd wasn't activated either so I killed the process, ran conda activate lsd, gradio still wasnt installed, so I pip installed it. Next none of the editable install models like k-diffusion were installed so I ran

pip install -e git+https://github.com/hlky/facexlib#egg=facexlib &&
pip install -e git+https://github.com/CompVis/taming-transformers#egg=taming-transformers &&
pip install -e git+https://github.com/openai/CLIP#egg=clip &&
pip install -e git+https://github.com/TencentARC/GFPGAN#egg=GFPGAN &&
pip install -e git+https://github.com/xinntao/Real-ESRGAN#egg=realesrgan &&
pip install -e git+https://github.com/hlky/k-diffusion-sd#egg=k_diffusion

Next, no pynvml installed, so I ran pip install pynvml==11.4.1 (following the environment.yaml version numbers).

Next block of errors was

  1. GFPGAN model not found at path
  2. RealERSGAN not found at path
  3. package not found error filelock

image

Fixes:
1 and 2. Manually call the various WGETs from the bash script wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P ./src/realesrgan/experiments/pretrained_models
3. pip install filelock

The final error was __init__() got an unexpected keyword argument 'logger' from websockets which I fixed with pip install -u websockets to go from 9.1->10.3

Finally I was able to run stuff but with a fair amount of bugs such as:

  1. Program crashes if input is empty or longer than 75 characters
  2. ImageLab lets me load an input image, but the output image never appears, it just says "loading"
  3. Clicking "mask" on img2img Image Editor Mode causes the program to freeze and need to be rebooted.
  4. Occasional CUDA out of memory errors.

from stable-diffusion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.