antis0007 / sd-webui-multiple-hypernetworks

GNU General Public License v3.0
97 stars 12 forks source link

Feature Suggestions! #5

Open Luke2642 opened 1 year ago

Luke2642 commented 1 year ago

I do like this script a lot, it's so powerful!

  1. Please could you make it autocorrect a comma to a comma space space in both boxes? This would help legibility a lot.

  2. Please can you make it put the multiple hypernetworks and strengths into the PNG exif? That would help not forget your settings, rather than documenting them separately!

----- EDIT - ignore the following. A text area would be simpler, in my next comment ----

  1. Please could you consider a simplified "shortcode" a,b,c.... syntax, to make it easier to use, and allow for future features? If the hypernetwork list defaults to showing a shortcode:

a hypone(hash) b hyptwo(hash) c hypthree(hash) d ...

If there's more than 26 hypernetworks, it'll be za, zb, zc .... zz etc, preserving the order of the list, and then zza, zzb, zzc ... zzz and so on.

And then you only need one box, in which you'd type:

a:0.1, b:0.2, c,0.3

And below the box, it would help you visually confirm that those were the networks you intended, by listing:

hypone(hash) = 0.1 hyptwo(hash) = 0.2 hypthree(hash) = 0.3

  1. And then, a crazy new feature this would make slightly saner, would be things like prompt alternating, but for hypernetworks!

So the syntax would be

[ a:0.1, b:0.2 | a:0.1, c,0.3 ]

And then it would use a and b hypernetworks for half the steps, and a and c for the other half!

Crazy complication, but, maybe? :-)

antis0007 commented 1 year ago

Loving these suggestions!

1: Autocorrect is a request I've heard quite a bit, but I dont have enough experience with gradio to get it working yet. I'll probably take a peek at the booru tag autocomplete repo for this. 2: This will require more function overriding most likely. Can't guarantee I'll get it working soon but this is definitely in my plans. 3: Shortcodes are a great idea! I hadn't thought of this earlier but I could easily set up a dictionary to alias the names of the networks. It may be unintuitive for some users though, so I'll see if I can make this as an option under a menu/checkbox type deal.

I'll look into if switching the functions dictating hypernetworks midway through generation would work, but that does seem quite difficult. I'd have to keep track of the number of steps while the script executes and change things accordingly, once I figure out how to do that on the fly I'd love to add it.

I can keep this issue open for future ideas / suggestions and updates on progress.

Luke2642 commented 1 year ago

Thanks, no problem. My shortcode suggestion would break the ability to copy/paste the hypernetworks list as well as add user confusion.

One way to preserve the current functionality but also improve it, is to change the two textboxes to one textarea.

No need for commas anymore, only spaces and linebreaks:

0.1 hypone(hash) 0.2 hyptwo(hash) 0.3 hypthree(hash)

This format is hopefully:

I put the strength on the left so you can visually scan down without looking for the ends of the lines.

Additional

antis0007 commented 1 year ago

Update on this: Metadata saving has been implemented, it may be a bit buggy since I haven't had much time to test. Do be sure to give it a shot though!

DarkAlchy commented 1 year ago

This befuddles me - Must be the same length. The token? The filename? The filesize (iow vectors)? All of those are just unacceptable to really make this a valuable tool so I hope it is something else you meant.

antis0007 commented 1 year ago

@DarkAlchy Sorry for the late response, I can update the readme to make it more clear: The number of hypernetworks provided MUST equal the number of strengths provided. Otherwise the program will throw an error because there isn't an explicit strength set for each one. Example:

hypernet1, hypernet2, hypernet3 0.3, 0.5, 0.3

Notice how both lists are the same length. That's all I really meant by that.

As for the second part, you cannot leave a field empty while running this script, otherwise It'll throw an error because it can't find an hypernetwork to load from. It's assumed that while you have this script enabled you will be generating with at least 1 hypernetwork. You can disable the script by pressing "RESET" and selecting "None" from the script dropdown.

Hope this clears it up.

DarkAlchy commented 1 year ago

So all you meant was that each HN MUST have a strength set? I am really (most times) just going to use two so should both strength add up to 1.0 when combined or does that matter?

antis0007 commented 1 year ago

@DarkAlchy It seems you understood now, yes every hypernetwork needs a strength set. As for adding up to 1, no that doesn't matter at all.

Hypernetwork strength can be set independently and all that matters is that each hypernetwork gets a strength value between 0 and 1. You can think of the program sequentially applying each hypernetwork at each strength you specify, one after the other.

DarkAlchy commented 1 year ago

@DarkAlchy It seems you understood now, yes every hypernetwork needs a strength set. As for adding up to 1, no that doesn't matter at all.

Hypernetwork strength can be set independently and all that matters is that each hypernetwork gets a strength value between 0 and 1. You can think of the program sequentially applying each hypernetwork at each strength you specify, one after the other.

Stacking with interesting results to be had I am sure.

Thank you, as I can't wait to get to stacking though I just wish TheLastBen's HN trainer was not so broken on Colab (doesn't work at all for 2.1 and with 15 gigs T4 only allows a BS of 1 and 512x512 source or Pytorch OOM YET you can run locally with 12GB and do BS=4 at 768x768). We really need more tools as I love HNs.