sd_civitai_extension
sd_civitai_extension copied to clipboard
You are making this extension to the wrong way
The feature list of Readme.md is a terrible choice.
You are making a desktop client tool into SD webui. Which includes all features of the website. That's really a terrible choice.
Here is how this should be done:
If you want to offer a desktop client, you create it with Electron, package your website into it. Easy to create, easy to maintain. And with full feature of the website.
For this extension. You only make it can:
- Having a button to Open civitai's web page
- View downloaded model as cards
- Add url/model id, version id to a downloaded model, so those model already downloaded, can be linked to a civitai model.
- Download preview image for already downloaded model
- Open model's webpage by click a button
- VIew model's trigger words and add them to prompt
- Remind new version for a downloaded model.
- Download a new model by filling a civitai's url.
That's all for this extension. Easy to install, easy to use, easy to maintain. And its first version can be done in 2 days.
This extension should only focus on 3 things:
- Link and manage those already downloaded model
- Download a new model
- Remind new version of a downloaded model.
Nothing more.
Do not put the whole destop client's feature into an extension. It is not necessary and users won't get good experience for an extension like that. And it gonna be hard to develop and hard to maintain
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.
@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?
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
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.
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.
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:
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.
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).
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.
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
Close it since this is already done with civitai helper extension.