a1ed83a1ba animated bg thumb toggle (#4109)
* Feat: Add toggle for animated background thumbnails

This commit introduces a new toggle in the User Settings UI: "Load Animated Background Thumbnails".

- When checked (default), animated background thumbnails (.gif, .mp4, animated .webp) load and display as usual in the background selection menu.
- When unchecked, these animated thumbnails are replaced with a transparent PNG (`__transparent.png`) in the selection menu. This is intended to reduce UI and network lag for you if you have a large number of animated backgrounds.

The actual functionality of setting any background (animated or static) remains unchanged; clicking a thumbnail will always apply the original background file.

Changes include:
- Added `loadAnimatedBackgroundThumbnails` (boolean, defaults to true) to `settings.json` under the `power_user` object.
- Added the toggle HTML to `public/index.html`.
- Modified `public/scripts/backgrounds.js` to conditionally replace animated thumbnails based on the new setting.
- Modified `public/script.js` to handle the toggle's event listener and save its state.
- Modified `public/scripts/power-user.js` to initialize the toggle's state upon loading settings.

* Fix: Resolve issues with animated background thumbnail toggle

This commit addresses two issues with the "Load Animated Background Thumbnails" feature:
1.  Toggle state was not persisting correctly across page loads.
2.  Animated media files were still being loaded even when the toggle was set to hide their thumbnails.

Fixes:
-   Corrected the variable scope in `applyPowerUserSettings` within `public/scripts/power-user.js` to ensure the toggle's checked state is properly initialized from the global `power_user.loadAnimatedBackgroundThumbnails` setting. This resolves the persistence issue.
-   Refined the logic in `getBackgroundFromTemplate` within `public/scripts/backgrounds.js`. When the toggle is off and a background is an animated type (.gif, .mp4, .webp), the `background-image` CSS property for its thumbnail now directly uses the path to `__transparent.png`. This prevents the browser from potentially pre-fetching or the server from processing the original animated file via the `/thumbnail` endpoint for display purposes.
-   Added console logging in `getBackgroundFromTemplate` to help debug the toggle state and file being processed.

The core functionality of applying backgrounds by clicking on thumbnails (whether transparent or regular) remains unchanged, as the `bgfile` attribute correctly stores the original media path.

* Fix: Resolve page load error and animated thumbnail toggle issues

This commit addresses a critical page loading error (`power_user is not defined`
in `backgrounds.js`) and ensures the "Load Animated Background Thumbnails"
toggle functions as intended.

The page load error was caused by `getBackgrounds()` (and subsequently
`getBackgroundFromTemplate()`) in `backgrounds.js` attempting to access
`power_user.loadAnimatedBackgroundThumbnails` before the `power_user` object
was fully initialized and its properties reliably accessible during the
application's `firstLoadInit` sequence.

Fixes:
1.  **Explicit Setting Passing for Initial Load**:
    *   Modified `getBackgrounds()` in `public/scripts/backgrounds.js` to accept
        `loadAnimatedThumbnailsSetting` as a parameter.
    *   Modified `getBackgroundFromTemplate()` in `public/scripts/backgrounds.js`
        to accept and prioritize this passed parameter. It includes fallback
        logic to use the global `power_user.loadAnimatedBackgroundThumbnails`
        (primarily for event-driven updates like chat changes, which happen later)
        and then to a default of `true` if the setting is somehow unavailable.
    *   Updated the call to `getBackgrounds()` in `public/script.js` during
        `firstLoadInit` to pass `power_user.loadAnimatedBackgroundThumbnails`
        explicitly after `power_user` settings are loaded.
    *   Updated the toggle's `change` event listener in `public/script.js` to also
        pass the new setting state to `getBackgrounds()` for immediate refresh
        of system backgrounds.

2.  **Toggle Persistence**:
    *   Ensured the toggle's state in `public/scripts/power-user.js`
        (within `applyPowerUserSettings`) is correctly initialized using the
        global `power_user.loadAnimatedBackgroundThumbnails`.

3.  **Media Loading for Thumbnails**:
    *   The logic in `getBackgroundFromTemplate` now ensures that if animated
        thumbnails are toggled off, the `background-image` CSS directly uses
        `url("backgrounds/__transparent.png")`, avoiding calls to `getThumbnailUrl()`
        with original animated file paths, which might have caused unintended
        pre-fetching or server-side processing.

This set of changes should resolve the page loading blockage and ensure the
animated background thumbnail toggle works correctly for both display and
network loading, while maintaining the functionality of applying original
backgrounds.

* Fix: Ensure correct initial state and first-toggle behavior for animated thumbnail toggle

This commit addresses issues where the "Load Animated Background Thumbnails"
toggle might not correctly display its default 'on' state (checked) on
a clean install, and ensures the first toggle action takes immediate effect.

Changes:
- In `public/scripts/power-user.js`:
    - `loadPowerUserSettings`: Ensured that `power_user.loadAnimatedBackgroundThumbnails`
      is robustly defaulted to `true` if the key is missing or not a boolean
      (e.g., from an older settings file) *before* `applyPowerUserSettings` is called.
    - `applyPowerUserSettings`: Added console logging to trace the value of
      `power_user.loadAnimatedBackgroundThumbnails` just before setting the
      checkbox state. Ensured the checkbox `checked` property is set using
      `!!power_user.loadAnimatedBackgroundThumbnails` for explicit boolean conversion.
      The function already correctly referenced the global `power_user` object.

- In `public/scripts/backgrounds.js`:
    - `getBackgroundFromTemplate`: This function's logic for determining the
      `loadSetting` (which decides if a transparent thumbnail is used) was
      previously refined to prioritize a passed parameter, then fall back to the
      global `power_user.loadAnimatedBackgroundThumbnails`, and then to `true`.
      Console logs were added to trace the resolved setting and file details.

- In `public/script.js`:
    - `firstLoadInit`: The call to `getBackgrounds` already correctly passes the
      `power_user.loadAnimatedBackgroundThumbnails` after settings are loaded.
    - Event listener for `#loadAnimatedBackgroundThumbnails`: The logic to update
      the global `power_user` state and then call refresh functions
      (`getBackgrounds` and emitting `CHAT_CHANGED` for `getChatBackgroundsList`)
      appears to be in the correct synchronous order.

These changes should ensure the toggle initializes to its correct visual state (checked)
and that the first toggle from ON to OFF (and back) correctly and immediately
updates both the visual display of thumbnails and the network loading behavior.

* Fix: Address ESLint issues in background thumbnail toggle feature

This commit resolves ESLint errors that were present in
`public/scripts/backgrounds.js` and `public/scripts/power-user.js`
related to the "Load Animated Background Thumbnails" feature.

Changes:
- I corrected indentation errors in `public/scripts/backgrounds.js`
  as reported by the linter.
- I replaced direct use of `object.hasOwnProperty()` with
  `Object.prototype.hasOwnProperty.call(object, ...)` in both
  `backgrounds.js` and `power-user.js` to resolve the
  `no-prototype-builtins` ESLint error.
- I ensured `power_user` is correctly imported and/or checked for
  definition (using `typeof power_user !== 'undefined'`) in
  `backgrounds.js` before accessing its properties, to satisfy
  linter concerns around `no-undef` for `power_user` in the
  context of the `getBackgroundFromTemplate` fallback logic.

These changes primarily address code style and linting rules and
are not intended to alter the functional behavior of the animated
background thumbnail toggle, which was addressed in previous commits.

* fix weird spacing for lint

* Refactor animated background thumbnail settings and functionality

* Remove comments

* Add missing awaits

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-07 22:55:48 +03:00
…
2025-03-01 21:16:28 +02:00
2025-06-07 22:55:48 +03:00
2025-06-07 22:40:52 +03:00
2025-03-19 21:10:42 +02:00
…
…
2024-08-11 00:13:24 +03:00
2025-03-06 14:55:50 +00:00
…
2025-06-05 07:35:19 +00:00
2024-10-11 10:43:29 +03:00
2025-04-23 20:50:46 +03:00
2024-10-01 12:43:20 +03:00
2025-04-16 09:52:08 +08:00


SillyTavern provides a single unified interface for many LLM APIs (KoboldAI/CPP, Horde, NovelAI, Ooba, Tabby, OpenAI, OpenRouter, Claude, Mistral and more), a mobile-friendly layout, Visual Novel Mode, Automatic1111 & ComfyUI API image generation integration, TTS, WorldInfo (lorebooks), customizable UI, auto-translate, more prompt options than you'd ever want or need, and endless growth potential via third-party extensions.

We have a Documentation website to answer most of your questions and help you get started.

What is SillyTavern?

SillyTavern (or ST for short) is a locally installed user interface that allows you to interact with text generation LLMs, image generation engines, and TTS voice models.

Beginning in February 2023 as a fork of TavernAI 1.2.8, SillyTavern now has over 200 contributors and 2 years of independent development under its belt, and continues to serve as a leading software for savvy AI hobbyists.

Our Vision

  1. We aim to empower users with as much utility and control over their LLM prompts as possible. The steep learning curve is part of the fun!
  2. We do not provide any online or hosted services, nor programmatically track any user data.
  3. SillyTavern is a passion project brought to you by a dedicated community of LLM enthusiasts, and will always be free and open sourced.

Branches

SillyTavern is being developed using a two-branch system to ensure a smooth experience for all users.

  • release -🌟 Recommended for most users. This is the most stable and recommended branch, updated only when major releases are pushed. It's suitable for the majority of users. Typically updated once a month.
  • staging - ⚠️ Not recommended for casual use. This branch has the latest features, but be cautious as it may break at any time. Only for power users and enthusiasts. Updates several times daily.

If you're not familiar with using the git CLI or don't understand what a branch is, don't worry! The release branch is always the preferable option for you.

What do I need other than SillyTavern?

Since SillyTavern is only an interface, you will need access to an LLM backend to provide inference. You can use AI Horde for instant out-of-the-box chatting. Aside from that, we support many other local and cloud-based LLM backends: OpenAI-compatible API, KoboldAI, Tabby, and many more. You can read more about our supported APIs in the Docs.

Do I need a powerful PC to run SillyTavern?

The hardware requirements are minimal: it will run on anything that can run NodeJS 18 or higher. If you intend to do LLM inference on your local machine, we recommend a 3000-series NVIDIA graphics card with at least 6GB of VRAM. Check your backend's documentation for more details.

Suggested Backends (not affiliated)

  • AI Horde - use models hosted by volunteers. Requires no further setup
  • KoboldCpp - a community's favorite for running GGUF models locally
  • tabbyAPI - a popular, lightweight, locally-hosted exl2 inference API
  • OpenRouter - a single API for many cloud providers (OpenAI, Claude, Meta Llama, etc.) as well as popular community models.

Questions or suggestions?

Discord server

Join our Discord community! Get support, share favorite characters and prompts.

Or get in touch with the developers directly:

I like your project! How do I contribute?

  1. Send pull requests. Learn how to contribute: CONTRIBUTING.md
  2. Send feature suggestions and issue reports using the provided templates.
  3. Read this entire readme file and check the documentation website first, to avoid sending duplicate issues.

Screenshots

image image

Character Cards

SillyTavern is built around the concept of "character cards". A character card is a collection of prompts that set the behavior of the LLM and is required to have persistent conversations in SillyTavern. They function similarly to ChatGPT's GPTs or Poe's bots. The content of a character card can be anything: an abstract scenario, an assistant tailored for a specific task, a famous personality or a fictional character.

To have a quick conversation without selecting a character card or to just test the LLM connection, simply type your prompt input into the input bar on the Welcome Screen after opening SillyTavern. This will create an empty "Assistant" character card that you can customize later.

To get a general idea on how to define character cards, see the default character (Seraphina) or download selected community-made cards from the "Download Extensions & Assets" menu.

Key Features

  • Advanced text generation settings with many community-made presets
  • World Info support: create rich lore or save tokens on your character card
  • Group chats: multi-bot rooms for characters to talk to you and/or each other
  • Rich UI customization options: theme colors, background images, custom CSS, and more
  • User personas: let the AI know a bit about you for greater immersion
  • Built-in RAG support: add documents to your chats for the AI to reference
  • Extensive chat commands subsystem and own scripting engine

Extensions

SillyTavern has extensibility support.

  • Character emotional expressions (sprites)
  • Auto-Summary of the chat history
  • Automatic UI and chat translation
  • Stable Diffusion/FLUX/DALL-E image generation
  • Text-to-speech for AI response messages (via ElevenLabs, Silero, or the OS's System TTS)
  • Web Search capabilities for adding additional real world context to your prompts
  • Many more are available to download from the "Download Extensions & Assets" menu.

Tutorials on how to use them can be found in the Docs.

⌛ Installation

🪟 Windows

[!WARNING]

  • DO NOT INSTALL INTO ANY WINDOWS CONTROLLED FOLDER (Program Files, System32, etc).
  • DO NOT RUN START.BAT WITH ADMIN PERMISSIONS
  • INSTALLATION ON WINDOWS 7 IS IMPOSSIBLE AS IT CAN NOT RUN NODEJS 18.16
  1. Install NodeJS (latest LTS version is recommended)
  2. Install Git for Windows
  3. Open Windows Explorer (Win+E)
  4. Browse to or Create a folder that is not controlled or monitored by Windows. (ex: C:\MySpecialFolder)
  5. Open a Command Prompt inside that folder by clicking in the 'Address Bar' at the top, typing cmd, and pressing Enter.
  6. Once the black box (Command Prompt) pops up, type ONE of the following into it and press Enter:
  • for Release Branch: git clone https://github.com/SillyTavern/SillyTavern -b release
  • for Staging Branch: git clone https://github.com/SillyTavern/SillyTavern -b staging
  1. Once everything is cloned, double-click Start.bat to make NodeJS install its requirements.
  2. The server will then start, and SillyTavern will pop up in your browser.

Installing via GitHub Desktop

(This allows git usage only in GitHub Desktop, if you want to use git on the command line too, you also need to install Git for Windows)

  1. Install NodeJS (latest LTS version is recommended)
  2. Install GitHub Desktop
  3. After installing GitHub Desktop, click on Clone a repository from the internet.... (Note: You do NOT need to create a GitHub account for this step)
  4. On the menu, click the URL tab, enter this URL https://github.com/SillyTavern/SillyTavern, and click Clone. You can change the Local path to change where SillyTavern is going to be downloaded.
  5. To open SillyTavern, use Windows Explorer to browse into the folder where you cloned the repository. By default, the repository will be cloned here: C:\Users\[Your Windows Username]\Documents\GitHub\SillyTavern
  6. Double-click on the start.bat file. (Note: the .bat part of the file name might be hidden by your OS, in that case, it will look like a file called "Start". This is what you double-click to run SillyTavern)
  7. After double-clicking, a large black command console window should open and SillyTavern will begin to install what it needs to operate.
  8. After the installation process, if everything is working, the command console window should look like this and a SillyTavern tab should be open in your browser:
  9. Connect to any of the supported APIs and start chatting!

🐧 Linux & 🍎 MacOS

For MacOS / Linux all of these will be done in a Terminal.

  1. Install git and nodeJS (the method for doing this will vary depending on your OS)
  2. Clone the repo
  • for Release Branch: git clone https://github.com/SillyTavern/SillyTavern -b release
  • for Staging Branch: git clone https://github.com/SillyTavern/SillyTavern -b staging
  1. cd SillyTavern to navigate into the install folder.
  2. Run the start.sh script with one of these commands:
  • ./start.sh
  • bash start.sh

🐋 Installing via Docker

These instructions assume you have installed Docker, are able to access your command line for the installation of containers, and familiar with their general operation.

Using the GitHub Container Registry

Docker Compose (easiest)

Grab the docker-compose.yml file from the GitHub Repository and run the following command in the directory where the file is located. This will pull the latest release image from the GitHub Container Registry and start the container, automatically creating the necessary volumes.

docker-compose up

Customize the docker-compose.yml file to your needs. The default port is 8000. If you want to adjust the server configuration using environment variables, read the documentation here.

Docker CLI (advanced)

You will need two mandatory directory mappings and a port mapping to allow SillyTavern to function. In the command, replace your selections in the following places:

Container Variables

Volume Mappings
  • CONFIG_PATH - The directory where SillyTavern configuration files will be stored on your host machine
  • DATA_PATH - The directory where SillyTavern user data (including characters) will be stored on your host machine
  • PLUGINS_PATH - (optional) The directory where SillyTavern server plugins will be stored on your host machine
  • EXTENSIONS_PATH - (optional) The directory where global UI extensions will be stored on your host machine
Port Mappings
  • PUBLIC_PORT - The port to expose the traffic on. This is mandatory, as you will be accessing the instance from outside of its virtual machine container. DO NOT expose this to the internet without implementing a separate service for security.
Additional Settings
  • SILLYTAVERN_VERSION - On the right-hand side of this GitHub page, you'll see "Packages". Select the "sillytavern" package and you'll see the image versions. The image tag "latest" will keep you up-to-date with the current release. You can also utilize "staging" that points to the nightly image of the respective branch.

Running the container

  1. Open your Command Line
  2. Run the following command in a folder where you want to store the configuration and data files:
SILLYTAVERN_VERSION="latest"
PUBLIC_PORT="8000"
CONFIG_PATH="./config"
DATA_PATH="./data"
PLUGINS_PATH="./plugins"
EXTENSIONS_PATH="./extensions"

docker run \
  --name="sillytavern" \
  -p "$PUBLIC_PORT:8000/tcp" \
  -v "$CONFIG_PATH:/home/node/app/config:rw" \
  -v "$DATA_PATH:/home/node/app/data:rw" \
  -v "$EXTENSIONS_PATH:/home/node/app/public/scripts/extensions/third-party:rw" \
  -v "$PLUGINS_PATH:/home/node/app/plugins:rw" \
  ghcr.io/sillytavern/sillytavern:"$SILLYTAVERN_VERSION"

By default the container will run in the foreground. If you want to run it in the background, add the -d flag to the docker run command.

Building the image yourself

We have a comprehensive guide on using SillyTavern in Docker here which covers installations on Windows, macOS and Linux! Give it a read if you wish to build the image yourself.

⚡ Installing via SillyTavern Launcher

SillyTavern Launcher is an installation wizard that will help you get setup with many options, including installing a backend for local inference.

For Windows users

  1. On your keyboard: press WINDOWS + R to open Run dialog box. Then, run the following command to install git:
cmd /c winget install -e --id Git.Git
  1. On your keyboard: press WINDOWS + E to open File Explorer, then navigate to the folder where you want to install the launcher. Once in the desired folder, type cmd into the address bar and press enter. Then, run the following command:
git clone https://github.com/SillyTavern/SillyTavern-Launcher.git && cd SillyTavern-Launcher && start installer.bat

For Linux users

  1. Open your favorite terminal and install git
  2. Git clone the Sillytavern-Launcher with:
git clone https://github.com/SillyTavern/SillyTavern-Launcher.git && cd SillyTavern-Launcher
  1. Start the installer.sh with:
chmod +x install.sh && ./install.sh
  1. After installation start the launcher.sh with:
chmod +x launcher.sh && ./launcher.sh

For Mac users

  1. Open a terminal and install brew with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install git with:
brew install git
  1. Git clone the Sillytavern-Launcher with:
git clone https://github.com/SillyTavern/SillyTavern-Launcher.git && cd SillyTavern-Launcher
  1. Start the installer.sh with:
chmod +x install.sh && ./install.sh
  1. After installation start the launcher.sh with:
chmod +x launcher.sh && ./launcher.sh

📱 Installing via Termux on Android OS

[!NOTE] SillyTavern can be run natively on Android devices using Termux, but we do not provide official support for this use case.

Please refer to this guide by ArroganceComplex#2659:

Unsupported platform: android arm LEtime-web. 32-bit Android requires an external dependency that can't be installed with npm. Use the following command to install it: pkg install esbuild. Then run the usual installation steps.

Command-line arguments

You can pass command-line arguments to SillyTavern server startup to override some settings in config.yaml.

Examples

node server.js --port 8000 --listen false
# or
npm run start -- --port 8000 --listen false
# or (Windows only)
Start.bat --port 8000 --listen false

Supported arguments

[!TIP] None of the arguments are required. If you don't provide them, SillyTavern will use the settings in config.yaml.

Option Description Type
--version Show version number boolean
--configPath Override the path to the config.yaml file string
--dataRoot Root directory for data storage string
--port Sets the port under which SillyTavern will run number
--listen SillyTavern will listen on all network interfaces boolean
--whitelist Enables whitelist mode boolean
--basicAuthMode Enables basic authentication boolean
--enableIPv4 Enables IPv4 protocol boolean
--enableIPv6 Enables IPv6 protocol boolean
--listenAddressIPv4 Specific IPv4 address to listen to string
--listenAddressIPv6 Specific IPv6 address to listen to string
--dnsPreferIPv6 Prefers IPv6 for DNS boolean
--ssl Enables SSL boolean
--certPath Path to your certificate file string
--keyPath Path to your private key file string
--autorun Automatically launch SillyTavern in the browser boolean
--autorunHostname Autorun hostname string
--autorunPortOverride Overrides the port for autorun string
--avoidLocalhost Avoids using 'localhost' for autorun in auto mode boolean
--corsProxy Enables CORS proxy boolean
--requestProxyEnabled Enables a use of proxy for outgoing requests boolean
--requestProxyUrl Request proxy URL (HTTP or SOCKS protocols) string
--requestProxyBypass Request proxy bypass list (space separated list of hosts) array
--disableCsrf Disables CSRF protection (NOT RECOMMENDED) boolean

Remote connections

Most often this is for people who want to use SillyTavern on their mobile phones while their PC runs the ST server on the same Wi-Fi network. However, it can be used to allow remote connections from anywhere as well.

Read the detailed guide on how to set up remote connections in the Docs.

You may also want to configure SillyTavern user profiles with (optional) password protection: Users.

License and credits

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

  • TavernAI 1.2.8 by Humi: MIT License
  • Portions of CncAnon's TavernAITurbo mod used with permission
  • Visual Novel Mode inspired by the work of PepperTaco (https://github.com/peppertaco/Tavern/)
  • Noto Sans font by Google (OFL license)
  • Icon theme by Font Awesome https://fontawesome.com (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
  • Default content by @OtisAlejandro (Seraphina character and lorebook) and @kallmeflocc (10K Discord Users Celebratory Background)
  • Docker guide by @mrguymiah and @Bronya-Rand
  • kokoro-js library by @hexgrad (Apache-2.0 License)

Top Contributors

Contributors

S
Description
LLM Frontend for Power Users.
https://sillytavern.app Readme AGPL-3.0
376 MiB
Languages
JavaScript 88.7%
HTML 8.1%
CSS 2.8%
Less 0.3%