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

allow wildcard files to have comment lines

Open rubberbaron opened this issue 1 year ago • 1 comments

This PR allows very simple comments in Wildcards files: if lines start with "#", they are a comment.

Having comments allows wildcard files shared between people to contain authorship information, sources, and other information.

Beyond wanting this on general principle, I personally want it for compatibility:

I'll be releasing my extended wildcards extension at some point, and it will include a number of built-in public domain wildcard lists. Because my library supports comments, I have information in them like:

# cc0. derived from https://github.com/dariusk/corpora
# validated in SD 1.5 with "a __animal__"
# excluded due to issues: gnu, musk, mustang, mole, newt, puma, silver fox, wolverine
aardvark
alligator
alpaca
antelope
ape
[etc.]

However, I intentionally don't use any other features not found in this Wildcards library other than these comments, so this small change will make those files compatible.

rubberbaron avatar Aug 01 '23 02:08 rubberbaron

I verified that this is the basic comment format used by Dynamic Prompts as well. (Like my extension, it supports more general comments everywhere, but I think this PR represents a reasonable compromise between making the Wildcards extension more compatible without introducing too much extra complexity.)

rubberbaron avatar Aug 07 '23 04:08 rubberbaron