Doesn't work with direnv (only supports virtualenv)
caesar opened this issue · 4 comments
I know the Readme says you don't want contributions, so feel free to ignore… that said, this is certainly a critical bug for me, so I thought I'd open an issue anyhow.
Regardless of input, when I click Generate, the app gives an output of "image error".
It doesn't give any more details about what the error might be. I've tried running in dev mode in the hopes of some debug output either on the CLI or in the web console, but there's nothing.
Copying the displayed command and manually running it from the terminal from within the SD directory works fine.
I suspect (but have no evidence yet) that this is related to the fact that my installation of SD is using pyenv via direnv (as opposed to virtualenv, as shown in the guide linked from the readme). Perhaps whatever method the app is using to run the python command doesn't load the pyenv.
That's all I can think of anyway… I'll try and do some more debugging when I get a chance.
Thanks for letting me know. Bugfix contributions are certainly welcome.
What you're saying is concerning but I would need a way to reproduce this issue before I can look into it.
I'm sure there are many ways to install Stable Diffusion. This app is build around this method. Did you follow those instructions or something else?
If you look at main.rs you'll notice starting at line 73 that it calls the source venv/bin/activate
command to activate the venv before the actual SD command.
I think the best way to debug it is to run the command in the terminal first, as shown in the guide above. If that works, then the app should also work (I hope 😬 ). Keep me posted!
I'm sure there are many ways to install Stable Diffusion. This app is build around this method. Did you follow those instructions or something else?
I followed those instructions, except that, as noted above, I used pyenv (via direnv) instead of virtualenv (simply because that's what I always use).
If you look at main.rs you'll notice starting at line 73 that it calls the source venv/bin/activate command to activate the venv before the actual SD command.
Aha! As I suspected then, my use of pyenv/direnv instead of virtualenv is the issue.
I wonder what it would take to add support for pyenv as well… I'll look into it.
In the meantime the workaround I guess is to use virtualenv (or just use the app to generate prompts and copy-paste them into the terminal).
I'm not a python dev so I'm not sure what are the implications and pros/cons of using pyenv
vs direnv
but I wouldn't mind supporting both. There needs to be some sort of check for one or the other before invoking it.
I've got this working by detecting the presence of either venv/bin/activate
or .direnv
and calling the appropriate command. I'll clean it up a bit and send a PR.