Skip to content

Node for InvokeAI 4.x.x+ workflows to remove specified strings and try to clean up formatting.

License

Notifications You must be signed in to change notification settings

526christian/prompt-pruner-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prompt-Pruner node for InvokeAI v4.x+

2024-05-29_ resize

A basic node that deletes whatever it finds in text (ideally a prompt or tags) based on a .txt list (optional), with options to remove:

  • Any Automatic1111-style and InvokeAI prompt weighting
  • Duplicate whole tags
  • Backslashes
  • TI embeddings and LoRAs

It will also try to do a clean-up, fixing spacing and removing extra commas and stuff that may be left behind after things get deleted.

Some useful applications:

  • Removing formatting from prompts not made for InvokeAI/Compel that might otherwise cause problems or take up extra tokens
  • Removing unwanted and frivulous words/sentences automatically
  • Converting prompts to bare natural language for export/sharing

For your blacklist.txt, just put whatever you want on separate newlines. An example .txt of annoying style terms that nightmare-promptgen-XL generates all the time is included as an example.

Use tagremovescript.py via terminal with python tagremovescript.py like normal. Edit the .py directly to configure it because I'm too lazy to set up anything else.

The code for this was originally just for a script to help preprocess a dataset of images generated in Invoke (mainly with prompts from the nightmare-promptgen node) for training, so uh, this was kind of an afterthought and not rigorously tested.

About

Node for InvokeAI 4.x.x+ workflows to remove specified strings and try to clean up formatting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages