h43lb1t0 / SD-WebUI-BatchCheckpointPrompt

Test a base prompt with different checkpoints and for the checkpoints specific prompt templates
MIT License
54 stars 3 forks source link

[Feature Request]: Ability to use styles #50

Closed drphero closed 11 months ago

drphero commented 11 months ago

Please search to see if an issue already exists for the feature you want, and that it hasn't been fixed in a recent build/commit.

What would this feature do?

This feature would allow users to select preexisting styles, including negative prompts, in order to avoid copy pasting mass amounts of prompts and manually fixing the negative prompt syntax.

What is the workflow for your feature idea?

It could work similar to how it does for x/y/z plot, where the user is shown a list of styles to select.

Any other information?

No response

h43lb1t0 commented 11 months ago

I'll add this to my TODO list and will checkout if it fits in for me

h43lb1t0 commented 11 months ago

@drphero what is your idea for saving the checkpoints this way? I understand your idea like replacing/adding to the saved values dropdown the option to select styles. But not only styles, but also checkpoints are needed.

drphero commented 11 months ago

~~I was thinking it could be an optional separate box below the prompt templates box that would be combined with the prompts box when saved. Since multiple styles could be used for a single generation, it would need to allow that. So maybe it would look something like this:~~

Checkpoint Names darkSushi25D25D_v40.safetensors @index:17,

Prompts/prompt templates for Checkpoints {prompt} @index:17;

Styles for Checkpoints style1, style2 @index:17;

Of course the style names would need to match ones that the user already has saved. It would be good if there was a way to easily add in the style names without having to type them all, but I'm not sure how that would work.

drphero commented 11 months ago

@h43lb1t0 I just thought of a better way. So it's like the way you implemented negative prompts. Styles could be used like {{style: stylename}}. But since styles can include negative prompts themselves, this would need to take that into account.

h43lb1t0 commented 11 months ago

@drphero I think I like this way. That should'nd be to hard to implement.

h43lb1t0 commented 11 months ago

@drphero i've added it. Could you try it before i merge it? I don't use styles that much and can't realy say if the implementation is good or not.

drphero commented 11 months ago

@h43lb1t0 I've given it a try now. The only problem I've found so far is that it stacks the styles. So if you have something like three checkpoints and three matching prompt templates, each with a different style, the first one comes out correct, but then the 2nd one will use its own, but also the 1st style added. And the 3rd will have its own, but the 2nd and 1st style also added.

drphero commented 11 months ago

@h43lb1t0 By changing line 214 in batchCheckpointsPrompt.py from p.styles.extend(batch_params.style) to p.styles = (batch_params.style) seems to fix this.

Is it possible to use multiple styles for one checkpoint? I can't figure out what the formatting would be.

h43lb1t0 commented 11 months ago

@drphero jmade some changes. Now it is possible to use multiple styles. Just list them one after another. The last style is the one the base prompt will be inserted to.

drphero commented 11 months ago

@h43lb1t0 Everything seems to be working as far as I can tell. Great work!