dr413677671 / PromptGallery-stable-diffusion-webui

A prompt cookbook worked as stable-diffusion-webui extenstions.
Apache License 2.0
153 stars 16 forks source link

Dynamic formatting #35

Closed HPPinata closed 1 year ago

HPPinata commented 1 year ago

This patchset fixes a few issues i noticed on initial testing:

  1. The "default_positive" field did not work
  2. There were commas added even if fields like "default_negative" were empty
  3. A space should be inserted after every (actually placed) comma
  4. IMO the arguments were added on the wrong side of the prompt

Nr. 1 Is caused by the textboxes not holding the correct value when load_avartar() is called. Neither on initial load, nor when changing the selection or uploading a new file. Moving "default_negative" into load_avartar() stopps it from working as well see this commit so just move both to load_prompt(). This also makes their handeling consistent.

Nr. 2 Is fixed by checking if len(default_) != 0 before adding any input (including commas)

Nr. 3 Just some minor formatting

Nr. 4 This is optional, personal preference and can be changed (if you prefer the original order): Original behaviour: -> tags + default_ + prompt New ordering (more conventional): -> prompt + default_ + tags

This can be altered by just swapping m_positive + ', ' + value -> value + ', ' + m_positive and avatar_prompts[avatar_names.index(dropdown)] + ', ' + default_positive -> default_positive + ', ' + avatar_prompts[avatar_names.index(dropdown)]

(Obviously doing the same for the negative version)

I tried keeping the changes minimal and hope you like them enough to merge them into your amazing project

dr413677671 commented 1 year ago

merged