this only works in sillytavern, people using other UIs would have to remove the prompts

info for risu: technically you can just upload all of the assets in the zip as additional assets and edit the regex toremove /assets/charactername/ from the beginning of urls (you can refer to asset.png with just <img src="asset.png"> in risu)

if you're using sillytavern, you have to make sure no blur effect is on in your theme

or do #chat{backdrop-filter:none;}
see https://stackoverflow.com/a/52937920 for more info, it effectively locks "position:fixed" elements into the actual chat itself

ST automatically serves the files in your data/default-user/assets folder under /assets.

so instead of uploading a zip to the expressions addon thing, you could unpack it under /assets/character/charactername/, for example

regex to replace [[exp:imagename]] with expressions fitting the below css and regex to cut it out of any message other than the first
https://files.catbox.moe/5hqvu1.json https://files.catbox.moe/x78st4.json
replace your oblivious mother with your character's name

proompt: (At the end of each response, include one of the following 'expression tags': [[exp:admiring]], [[exp:amused]], [[exp:angry]], [[exp:angryblush]], [[exp:aroused]], [[exp:confused]], [[exp:contempt]], [[exp:coughing]], [[exp:disgust]], [[exp:excited]], [[exp:facepalm]], [[exp:forcedsmile]], [[exp:laugh]], [[exp:manic]], [[exp:ohgodohfuck]], [[exp:realization]], [[exp:relief]], [[exp:shocked]], [[exp:sniggering]], [[exp:spooked]], [[exp:thinking]])

below css needs to be in actual custom css theme

putting it in the bot

if you put it in the bot itself (e.g. in the greeting, you need to remove custom- from in front of all these class names and the [style="transform: translate(0px);"] css still needs to be in custom css because it's applied to .mes_block, and st only lets you css style .mes_text

/* these are just copied out of the actual ST css */
.last_mes .custom-expression-holder {
    min-width: 100px;
    min-height: 100px;
    max-height: 90vh;
    max-width: 90vh;
    width: calc((100vw - var(--sheldWidth)) /2);
    position: fixed; /* except for this, which was absolute because it was at the top of html */
    bottom: 0;
    padding: 0;
    left: 0;
    filter: drop-shadow(2px 2px 2px #51515199);
    z-index: 2;
    overflow: hidden;
    resize: both;
    display: flex;
    justify-content: center;
}
.last_mes .custom-expression {
  min-width: 100px;
  min-height: 100px;
  max-height: 90vh;
  max-width: 90vh;
  top: 0;
  bottom: 0;
  padding:0;
  vertical-align: bottom;
  object-fit: contain;
}
.mes:not(.last_mes) .custom-expression-holder {display:none;}
[style="transform: translate(0px);"]{transform:none!important;} /* st sets this when you swipe and it breaks position: fixed; */

probably busted on mobile

why do this?

default st expressions addon is shit, no custom expressions, the classifier is iffy, and the ways of feeding the extension via the actual smart LLM either do an entire second prompt or just don't work

python script to autogen expressions also: https://files.catbox.moe/9bhll2.py

^ works with reforge, but you need to run it with --api

Edit Report
Pub: 01 May 2025 22:33 UTC
Edit: 02 May 2025 20:48 UTC
Views: 155