Unit Generator

Installation

Install or update SillyTavern. You need at least 1.11.2 version to work.
Install this extension: https://github.com/LenAnderson/SillyTavern-RegexSlash (Extensions -- Install Extension -- Insert link)
(optional) Install https://github.com/LenAnderson/SillyTavern-Variable-Viewer/ in the same fashion. Not required, but you can easily look at the variables.

Download the QuickReplies here https://files.catbox.moe/kski79.rar and drop them into public\QuickReplies
Open the regexes here https://files.catbox.moe/hgsuh8.txt
Now, open the settings.json in your public directory and navigate to "regex": part. Replace it with the contents of this file.

Finally, character you use matters. You can use mine https://files.catbox.moe/er65eo.png or use a similar blank state storyteller character.

Setup

Textgen

You need to use Mixtral-Instruct. Probably won't work with Mixtral finetunes. As of now, they're kind of dumbing the model down.
Two ways I've tried are OpenRouter and DeepInfra. Both work great for me. Yes, you're paying, but it's dirt cheap. You can generate 100 units for $0.01, probably even more. Note that you can limit your context to something relatively low, this thing will never use too much context if working as intended.
Localchadding might also work, if you don't mind the speed and if quantization does not make the model dumber.
I use temperature of 1, and rep/freq penalty of 0.

Imagen

I use NAIv3. Local SD can also work, but quality will be significantly worse. Set it up in Extensions -- Image Generation. I don't know if it'll work without imagen.

Preparation

Set the Quick Reply set to RPGTest (Extensions -- Quick Reply -- Global Quick Reply Sets). Two buttons should appear. "Generate character" and "Reset Storage". Run "Reset Storage" to create an empty array. You only need to do it once as a setup, or when you want to clear the unit storage.

How to use

Do not chat normally at all. Also, clear the chat of any garbage if there's any. Only the greeting message should be present.
Click the "Generate character" button to create one. This launches a chain of prompts to generate either completely random or specified by your input character. It will also launch imagen.
Afterwards, a picture and full description should appear. Example:
Example
If everything is set up correctly, it should be very stable. I have a near perfect consistency with my setup. If you don't like the result at all (or it is messed up), you can just delete it. Otherwise, you can edit everything you want before saving.
Any text field can be edited as long as you don't break the formatting and keep everything a single paragraph. Don't like the stats, equipment, or maybe want to tweak the description? Just edit the field.
Your buttons now have changed to "Regenerate Portrait", "Save Unit", and "Clear Unit".
Regenerate Portrait allows you to redo the portrait either using the default algorithm—prose generation, assisted algorithm—using AI to generate something resembling SD prompt (efficiency varies), or to just input your own prompt.
"Clear Unit" is pretty straightforward—clears the dialogue, so you can generate something new.
"Save Unit" shows you what's about to be saved one more time. Example:
Example
So if you've messed up the formatting, it'll show something's broken.
Clicking "Accept" clears the unit, but saves it into the all_db_units and shows it's ID in the popup. Now you can call this unit.


Some examples on what to do with this:

/getglobalvar index=0 all_db_units |
/send {{pipe}}

Will send the unit id=0 info in a raw format.


/getglobalvar index=0 all_db_units |
/setvar key=t {{pipe}} |
/getvar index=image_link t |
/setvar key=t2 {{pipe}} |
/send <img src='{{getvar::t2}}'></img>

Will send the unit id=0 image.
In a similar fashion, you can get any other variable and inject them into prompts or AI responses.


/getglobalvar all_db_units |
/send {{pipe}}

Will send all the database.

Improvements?

You can edit the type of generated content fairly easily. If generating fully random unit, since Mixtral is horrible at being creative, it uses random "Race", "Class", and "Theme" to generate it.
Here is the current pool, found at the top of "Generate character" macro. I didn't put much effort into it, so you can make it better or tailor it to suit your needs.

/setglobalvar key=unit_tag_race {{random: Alien, Ape, Cyclops, Dryad, Dwarf, Elf, Faerie, Giant, Gnome, Goblin, Gorgon, Hag, Halfling, Human, Kobold, Merfolk, Minotaur, Ogre, Orc, Satyr, Siren, Slith, Reptillian, Troll, Werewolf, Yeti, Angel, Archon, Avatar, Demigod, Djinn, Efreet, God, Inkling, Lamia, Nymph, Reflection, Shade, Shapeshifter, Skeleton, Specter, Spirit, Vampire, Wraith, Zombie, German, Spanish, American, Slavic, Mongolian, Chinese, Japanese, Aztec, Gyaru, Dog, Cat, Raven, Octopus, High Elf, Moon Elf, Sun Elf, Night Elf, Half Elf, Hill Dwarf, Mountain Dwarf, Half Dwarf, Blood Orc, Stone Orc, Half Orc, Half Ogre, Half Goblin, Ghoul, Elemental}}
|
/setglobalvar key=unit_tag_class {{random: Advisor, Ally, Archer, Army, Artificer, Assassin, Barbarian, Bard, Berserker, Child, Citizen, Cleric, Clown, Coward, Deserter, Detective, Doctor, Drone, Druid, Elder, Employee, Flagbearer, Gamer, Guest, Inquisitor, Knight, Mercenary, Minion, Monger, Monk, Mystic, Ninja, Noble, Nomad, Peasant, Performer, Pilot, Pirate, Praetor, Processor, Ranger, Rebel, Rigger, Rogue, Samurai, Scion, Scientist, Scout, Serf, Shaman, Soldier, Spellshaper, Survivor, Warlock, Warrior, Wizard, Cosplayer, Gangster, Teacher, Sniper, Politician, Charlatan, Laborer, Commander, Raider, Priest, Surfer, Gambler, Agent, Martial Artist, Maid, Trickster, Grenadier, Crusader, Shapeshifter, Inventor, Mage, Roamer, NEET, Duelist, Collector, Hunter, Technician, Slave, Traitor, Expert, Digger, Illusionist, Defiler, Arcanist, Magician}}
|
/setglobalvar key=unit_tag_theme {{random: Magical, Mythical, Fire, Spark, Water, Frost, Air, Thunder, Earth, Stone, Dark, Death, Hell, Unholy, Heaven, Holy, Metal, Wood, Prehistoric, Ancient, Medieval, Renaissance, Industrial, Modern, Futuristic, Psyonic, Nature, Tech, Mutant, Construct, Normal, Plain, Swamp, Island, Mountain, Forest, Silly, Funny, Serious, Sad, Bored, Angry, Lewd}}

Edit Report
Pub: 23 Jan 2024 18:40 UTC
Edit: 23 Jan 2024 19:11 UTC
Views: 119