Comments (8)
Yeah I'm aware, I do some complex prompts from time to time myself.
With my current WIP regex it would look like this:
Everything that is green was matched as a weighted tag, while brown tries to match "normal" tags. As you can see, it already works pretty well, even for nested tags - as long as they have no spaces, which is a limitation of all tags currently.
So when editing a tag that was already inserted, you'd have use underscores:
to still get a proper match. Maybe I'll automate or work around that in the future somehow, but for now it's out of scope.
With spaces ignored, it matches all of them as expected though, so I know the regex will also work for the future.
I just can't ignore them for now because I have no mechanism in place to search & insert tags with underscores or spaces seen as the same.
from a1111-sd-webui-tagcomplete.
Editing inside brackets should work now, as long as the hard-coding bug is fixed for you on the webui side.
chrome_2022-10-29_14-32-57.mp4
from a1111-sd-webui-tagcomplete.
- was fixed in 9fc9f1a (v1.6.0), so if you're on a version newer than that it should work (it does for me on the current version).
- This is a known issue currently. Since some tags can have parentheses or colons, a word inside them is not seen as a single tag without brackets, but tries to match the text including the parentheses and : separator. I could probably add a special check for that though. The reason it doesn't autocomplete after you clicked on it is because it looks for the word based on the cursor position, so since the cursor is not at the end of the word but after the space, it fails. But that it shows the list in that case after you typed a space seems to be a bug, I'll look into it.
from a1111-sd-webui-tagcomplete.
- was fixed in 9fc9f1a (v1.6.0), so if you're on a version newer than that it should work (it does for me on the current version).
Thanks for the confirm, after few test I found that it's a hardcode bug of webui's localization... this feature is not working at all with chinese localization ..I didn't realized that until now :/
It check if the placeholder has prompt
, but in chinese it's 提示词
, so always return false
- This is a known issue currently. Since some tags can have parentheses or colons, a word inside them is not seen as a single tag without brackets, but tries to match the text including the parentheses and : separator. I could probably add a special check for that though.
Parenthesis of correctly written tags are always escaped like Nero \(fate\)
, just ignore unescaped (wrong) parenthesis would make things easier
from a1111-sd-webui-tagcomplete.
Good to know, you should probably open an issue there for that bug if there isn't one already
Ah I see you already did that.
For 2 simply ignoring it sadly isn't an option because () aren't escaped yet if the user is still typing them, but I am currently working on the proper solution with a separate check for the (<tag>:<num>) weighting format. With that in place you should then be able to edit & complete tags in the weighting brackets like any other.
from a1111-sd-webui-tagcomplete.
Got it: AUTOMATIC1111/stable-diffusion-webui#3904
I don't know much about the parser thing so no more suggestions I could give :)
Don't forget that webui support complex syntax like this: (part of a real prompt from a friend)
(closeup:0.6) sweat [(loli:1):0.75] small breasts, wet (cumdrip pussy:1.2),
[sketch | line art|charcoal ] [(watercolor:1.2):0.7] spot color by [(Jeremy Mann:1.4)::0.6] [(Akihiko Yoshida:1.4):0.4]
from a1111-sd-webui-tagcomplete.
With spaces ignored, it matches all of them as expected though, so I know the regex will also work for the future. I just can't ignore them for now because I have no mechanism in place to search & insert tags with underscores or spaces seen as the same.
It's worth noting that (cat ears:1.5)
is (cat_ears:1.5)
, but (girl with cat ears:1.5)
is not (girl_with_cat_ears:1.5)
, there's no way to tell the difference unless you search the tag in database all the time (will that be a performance hit?), nor you can tell user want to edit cat ears
or girl with cat ears
when they double click on cat
from a1111-sd-webui-tagcomplete.
Yeah, that is the big problem. I can't know where multi-word tags start or end, and searching for multiple pair combinations would be impossible due to performance reasons - trying out every combination would be:
- Matching every single tag
- Matching every combination of adjacent words
a. For all groups size 2 to size n, where n is our total tag count.
That would put us at a complexity of O(cn) or worse, which gets out of hand really fast.
That's why I'm choosing to ignore it for now 😅
Finding a proper solution for that would only work in very restrictive circumstances, so I think it's fair game to require manual underscore replacement by the user on that part (or leaving replaceUnderscores
off in the config, but that might lead to worse results for some models.
from a1111-sd-webui-tagcomplete.
Related Issues (20)
- wildcards no longer autocompleting HOT 4
- The extension errors every time a checkpoint or VAE is loaded (SD.Next) HOT 4
- A1111 Trouble getting controlnet to start with webUI < The directory name is invalid: > HOT 1
- No longer seems to work with SD.Next in third party textboxes HOT 3
- Model keyword - partial load. HOT 9
- $$ is replaced with $ upon inserting a wildcard file's content
- Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat1 in method wrapper_CUDA_addmm) HOT 3
- Attempt to `JSON.parse(opts['tac_keymap'])`, but `opts['tac_keymap']` may sometimes be undefined HOT 3
- Directory named `.safetensors` causes model-keyword to break and to break `webui-tagcomplete` in return HOT 1
- 不知道这里有没有人用秋叶整合包的,无论卸载重装还是各种设置都是弹不出来自动补全框 HOT 12
- Tagcomplete no longer listing embeddings as suggestions in SD.Next HOT 1
- A111 Refresh Button on Extra Networks hangs infinitely HOT 7
- In some cases, i can't search tags by aliases. HOT 4
- Wrong format used for LyCORIS HOT 3
- Wildcard autocompletion in the prompt box cutoff from colon HOT 1
- [Feature Request] - Allow for names of Styles (found on the right side pulldown) to be included for autocomplete. HOT 4
- launch error and feature dont work
- Loras in hidden directories are suggested when they shouldn't
- Embedding suggestions not working under Diffusers backend. [SDNext] HOT 6
- Is it possible to update danbooru.csv? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from a1111-sd-webui-tagcomplete.