Code Monkey home page Code Monkey logo

Comments (10)

JustMaier avatar JustMaier commented on June 3, 2024

Yeah, the README is very old and needs to be updated. After starting the development of the extension, I too determined that trying to bring the sites functionality into SD was going to result in a poor experience and something too hard to maintain.

We've significantly revised our plans for this extension since then and will take your ideas here into account :)
I'll take a moment to adjust the readme.

from sd_civitai_extension.

Ju1-js avatar Ju1-js commented on June 3, 2024

@JustMaier When downloading the model from the pasted hash, shouldn’t it send an alert to ask the user if they want the file set if they want it downloaded with the model's size? Ex. 1.3 Gb, and how will it handle VAEs?

from sd_civitai_extension.

JustMaier avatar JustMaier commented on June 3, 2024

Not sure of a good way to pop a confirmation prompt from the gradio backend, otherwise I'd totally do a confirm action.

As for the VAE, you're totally right, we need to get that hashed in there as well. I'll try and get that in shortly

from sd_civitai_extension.

butaixianran avatar butaixianran commented on June 3, 2024

You mean get webui's prompt textbox from gradio?

    # check modules/ui.py, search for txt2img_paste_fields
    # Negative prompt is the second element
    txt2img_prompt = modules.ui.txt2img_paste_fields[0][0]
    txt2img_neg_prompt = modules.ui.txt2img_paste_fields[1][0]
    img2img_prompt = modules.ui.img2img_paste_fields[0][0]
    img2img_neg_prompt = modules.ui.img2img_paste_fields[1][0]

If you just mean a yes/no dialog window, I don't think gradio can do that well.

Gradio is weak and full of issues. The better way is just fill extension tab with html and javascript. And use a hidden button and a hidden textbox to send msg from javascript to gradio.

But javascript can not get response back from gradio, I asked gradio team, there is no way for that. So the only way is gradio get msg from javascript, do something, then reload/re-fill the extension tab with new html.

This is exactly how SD webui's extra network cards tab done. In this way you can have anything you want, since the extension tab is fill with html and javascript.

from sd_civitai_extension.

JustMaier avatar JustMaier commented on June 3, 2024

Yeah... That's to problem. Since the request to download would come from the back-end (gradio side) there isn't a great way to present it in the UI (javascript side) for review as far as I can tell.

We do already have SocketIO built into the extension. I wonder if maybe we just push it a step further and enable the SocketIO server inside the extension and have it communicate with the front-end through a socket connection. I really shouldn't have to do that though. I'm pretty sure that Gradio already has a socket connection with the UI... They should make it an option to use that to post messages.

from sd_civitai_extension.

Ju1-js avatar Ju1-js commented on June 3, 2024

Yea, for prompting the user, I'd probably use some popup HTML via js, or the js confirm() function which only has yes/cancel. Also, it should say the size of the files being downloaded in the prompt somewhere.
I'd make it look something like this:
popup-mockup
It would blur and dim the page, close if clicked off, cancel button clicked or the x (which I forgot to put in the mockup).
The rest I think is quite easy to determine their function.

from sd_civitai_extension.

Ju1-js avatar Ju1-js commented on June 3, 2024

I'm not sure how hard this would be to implement, but it's what I imaged when I thought about it prompting the user.
If this does work, it could be nice to somehow alert the user when the model finishes downloading ex. a fake notification card (kinda like the connection lost popup from radio).

from sd_civitai_extension.

butaixianran avatar butaixianran commented on June 3, 2024

You have to send downloading status to UI with gradio, not with javascript.

Since there is no way js can get response from gradio, the only way is letting gradio update the UI. Extension's tab page need to be split into 2 areas, one for html+javascript, one for gradio.

So, in this gradio UI area, you can put a gradio component to show downloading status.

from sd_civitai_extension.

Ju1-js avatar Ju1-js commented on June 3, 2024

Is that not similar to how the save images function works in the WebUI?
https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8/modules/ui_common.py#L165

from sd_civitai_extension.

butaixianran avatar butaixianran commented on June 3, 2024

Close it since this is already done with civitai helper extension.

from sd_civitai_extension.

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.