kiri-art / stable-diffusion-react-nextjs-mui-pwa

PWA Web App front end for Stable Diffusion, on React/NextJS with Material UI
https://kiri.art/
MIT License
127 stars 32 forks source link

need --help #42

Open treksis opened 1 year ago

treksis commented 1 year ago

This is a massive repo.

Is it possible to get some guidelines? gongo, mongo... at least what to setup...!

by the way, your runpod docker is awesome...

also is there discord channel for the "kiri" space ?

thank you

gadicc commented 1 year ago

hey... thanks so much! :D

i admit this is a bit of a mess... i'm going to clean this up and improve it next early year... just some background, originally this (the frontend) was the "big open source project", but ultimately, the site itself (for non-coders) and the container (docker-diffusers-api) were the way more popular projects, so this part got a bit neglected. i do want to fix that but have a few higher priorities first.

for now, i think the most important thing is to:

  1. have mongo running on the same system (or on the cloud, and set MONGO_URL), to set REQUIRE_REGISTRATION=0),
  2. yarn install
  3. vc dev

and of course, have docker-diffusers-api running.

You'll see some errors in the console but otherwise this should still run... just :sweat_smile:

As I said, do want to get this all fixed up as soon as I have time. May also provide a docker image for the frontend too for a quick start.

gadicc commented 1 year ago

re discord, not yet... for now i really find discord too distracting / draining.... but maybe I'll set one up for other users to help each other... or once I have a bit more free time, definitely need to e.g. do the work above, before I can start chatting to people on discord :sweat_smile:

treksis commented 1 year ago

sorry for the stpd question.

in which file should I set REQUIRE_REGISTRATION to 0? in which file?

even if require_registration to 1, How do I make the google auth work?

I just uploaded to vercel and linked to mongoDB.

image image

would you also integrate serverless runpod to this repo in the future?

thank you.

gadicc commented 1 year ago

Oh great, you're deploying to Vercel.

should be MONGO_URL not MONGO_URI (L not I at the end, what you wrote is probably more correct but there is some historical code here :sweat_smile:).

REQUIRE_REGISTATION is an environmental variable too, but as you said, won't need it on your code.

For google login, set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET variables. You also need to set a ROOT_URL var to the accessible location of your site, e.g. https://myapp.vercel.app/ or whatever, redeploy, then call /gongoAuth?type=check once off to update these values in the database (it will reply with OK).

Mmm yes I will add runpod support... it might only be in another week or two. If you want to try do it yourself before then, take a look at the sd-banana.ts and bananaCheck.ts files in the api directory, that might be all you need to modify.

I just opened https://github.com/kiri-art/stable-diffusion-react-nextjs-mui-pwa/issues/43 to track.

Note that with banana, you don't need any credentials to check the status of a request... we use this to our advantage to wait for the request to complete directly on the client / user's browser, for lower latency... I'm not sure if this is possible with runpod, in which case, we'll need to pipe the check through the server to add credentials.

elihanani commented 1 year ago

I set REQUIRE_REGISTRATION=0 and NEXT_PUBLIC_REQUIRE_REGISTRATION=0 in Vercel and also in the .env.local file; still, the login option still shows for image generation.

I tried to set up GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, along with ROOT_URL and MONGO_URL, yet clicking the login with the Google button does nothing. Although, in the development environment (local and codespaces), clicking the same button gives an error.

I am unable to deploy the API and test with banana.dev. Please advise on properly getting this up and running. Thank you in advance.

gadicc commented 1 year ago

Hey @aliehanani, in that case, it's possible I may have broken part of the REQUIRE_REGISTRATION logic in a recent update. I have a lot of work planned to get this repo in better in shape, unfortunately it's a lower priority than other parts of the site (i.e. docker-diffusers-api, and some closed-source code to manage kiri.art). I'm just going to be honest and say that I'm completely overloaded at the moment, and have no idea when I'll get a chance to look this :(

HOWEVER. In the meantime, could you try call http://localhost:3000/api/gongoAuth?type=setup (or whatever host/port you're running dev) - it should return OK - and see if that fixes login in development? (If not, let me know if there are any errors in the dev console). If so, you'd need to do the same after deployment and also anytime you change any of the google settings. I know I need to make this clearer (it used to be automatic but it was very inefficient on serverless).

Again, I'm aware of - and apologise for - the current state of this repo. Originally this was intended to be the main part of the project, but didn't attract much interest, whereas docker-diffusers-api and the kiri.art site itself became very popular, so all my energy went there. And with that, I'm really behind on a few other things, which are, to be honest, more important. So, I do thank you for patience, and apologise for the current pain in getting this up. I have some very cool stuff planned for this part of the project (i.e., the UI), I just have no idea when I'll have a chance to work on it yet :/

elihanani commented 1 year ago

Hello @gadicc 👋 Thanks so much for the detailed and honest response. It turned out that I had to keep API_SUFFIX=exec, then run /api/gongoAuth?type=setup. Although, I had to configure social media login to access it, as I could not figure out how to make REQUIRE_REGISTRATION=0 works.

I wish I could be more of a help. If you are willing to accept a mentee, I would love to assist with low-hanging fruits. Cheers

gadicc commented 1 year ago

Thanks so much, @aliehanani. For for understanding, welcome info and offer to help.

I've already started work on a feature branch locally where I've been working to simplify all the I/O between models, providers, serverless and browser. Part of that work will involve abstracting and separating out some of the kiri.art specific code to make it easier to turn off (and fix registration issues).

Once that's done, I think it will be easier to get involved in the project, both to add new features but also especially for newbies (without your level of patience) to get started with it. So, I think its best to wait for that first, even though, unfortunately, I have no idea how long it will take to finish.

However, if you notice anything obvious to be improved, especially from a usability side, feel free to open issues and mention you'd like to work on it. At worst, I'll update the issue when it's more relevant, and at best, I'll say that it's no problem to work on that particular part of the code already and can give guidance.

Thanks so much! :D

elihanani commented 1 year ago

Thanks so much, @aliehanani. For for understanding, welcome info and offer to help.

I've already started work on a feature branch locally where I've been working to simplify all the I/O between models, providers, serverless and browser. Part of that work will involve abstracting and separating out some of the kiri.art specific code to make it easier to turn off (and fix registration issues).

Once that's done, I think it will be easier to get involved in the project, both to add new features but also especially for newbies (without your level of patience) to get started with it. So, I think its best to wait for that first, even though, unfortunately, I have no idea how long it will take to finish.

However, if you notice anything obvious to be improved, especially from a usability side, feel free to open issues and mention you'd like to work on it. At worst, I'll update the issue when it's more relevant, and at best, I'll say that it's no problem to work on that particular part of the code already and can give guidance.

Thanks so much! :D

Cool beans! 🤜🤛