stable-diffusion-webui-forge icon indicating copy to clipboard operation
stable-diffusion-webui-forge copied to clipboard

(Solved) Looking for an "Extensions Expert"

Open Marc0ai opened this issue 1 year ago • 12 comments

Forgive me, it's not a real issue, but I didn't know where else to post other than here or reddit....

In short, I've finished writing a script that can be used on Forge (or automatic1111 if you prefer) which works, and it works quite well.

The problem is that so far, the only thing I've managed to do is implement it as a script (you know, the ones you use at the bottom of the WebUI from the dropdown menu), but I would like to "convert" it into a proper extension, so that it appears in the "Main" tab. Despite my attempts, I haven't been able to figure it out, or rather, I don't know how to do it practically. I've only tried emulating other extensions, but without success...

So, is there anyone who could take a look? https://pastebin.com/z3jjxw4x

Feel free to try it out; the script itself works and is used to apply photographic filters to the generations.

Marc0ai avatar Sep 11 '24 21:09 Marc0ai

First:

    def show(self, is_img2img):
        return scripts.AlwaysVisible

Second: run() is for scripts, for extensions you have many options. Check modules\scripts.py. postprocess_image() seems ideal for you: def postprocess_image(self, p, pp, *script_args): It'll be called for each image, with the image in pp.image. Third: wrap your UI up into a gradio Accordion.

Nice work, BTW!

DenOfEquity avatar Sep 11 '24 23:09 DenOfEquity

Wow, thanks to your answer I was finally able to figure it out.... I was just using the wrong approach, thanks, I really appreciate it. The next challenge now will be to be able to insert it into the extensions index, because I noticed that the index has not been updated for a month now, so I don't know if there is still interest from the author of A1111.... If anyone still wants to try it, the extension can be completely used and installed from here: https://github.com/Marc0ai/sd-webui-photo-refiner

Marc0ai avatar Sep 12 '24 10:09 Marc0ai

@Marc0ai

Is there any dependency to be installed like dlib?

nitinmukesh avatar Sep 12 '24 10:09 nitinmukesh

Yep, to use "Face Enhancer" you need dlib, in theory it should install itself on the first startup

Marc0ai avatar Sep 12 '24 10:09 Marc0ai

Yep, to use "Face Enhancer" you need dlib, in theory it should install itself on the first startup

It's not.

err

Juqowel avatar Sep 12 '24 12:09 Juqowel

Damn my bad... Evidently there are problems with that installation method... I temporarily added a separate installer, now it should add dlib correctly, let me know

Marc0ai avatar Sep 12 '24 13:09 Marc0ai

Installation will be a bit complicated.

cm

Juqowel avatar Sep 12 '24 15:09 Juqowel

It should actually be easier than expected, I updated everything and now it should handle installing cmake too, you can try updating the extension and try again

Marc0ai avatar Sep 12 '24 15:09 Marc0ai

I literally started getting interested in python and how to implement it in the webui 3 days ago, so I was expecting this kind of problem, with a little patience I hope to solve everything 👌

Marc0ai avatar Sep 12 '24 15:09 Marc0ai

It should actually be easier than expected, I updated everything and now it should handle installing cmake too, you can try updating the extension and try again

cm3

You should test it on a new clean system to find the correct way.

Juqowel avatar Sep 12 '24 19:09 Juqowel

This looks interesting since I use ReActor and ADetailer a lot, so I manually installed the requirements on my computer (Win 11) before I tried to install the extension, and the extension installed without issues. Going to test it out later tonight.

I suggest you make a wiki page on the Github page with some good examples for each of the various settings and make a link to the wiki visible after you expand it in the UI. That would make it easier for people to get up and running without having to spend potentially a lot of time to test out how it works to find out what results one can expect.

Many would also like to see hints with some short description when you hover over one of the settings similar to this: image

And to make it more visible to other A1111/Forge users, see if you can get it added to the Extension Index.

SvenErik1968 avatar Sep 13 '24 12:09 SvenErik1968

I'm glad the extension is useful and I really appreciate the feedback. I've made some improvements to the UI, including a link to the Git page where I've added visible examples for each effect. I'll add descriptions for the effects later. Unfortunately, I'm still trying to figure out the best way to install the dlib library, which should be quite simple in theory, but it seems to cause issues for some users. If anyone knows more about this, I'd greatly appreciate it. Oh, and I've also forwarded it to the A1111 index, hoping it's still active—I haven't seen any updates in a month... PS: As I already said, it's been just over a week since I learned Python, Gradio etc....I still have a lot of things to understand...🤯

Marc0ai avatar Sep 13 '24 15:09 Marc0ai