Important
This repository is a SillyBunny-specific fork of Rurijian/deep-swipe. Install this fork only if you are using SillyBunny. For vanilla SillyTavern, use the upstream Deep Swipe repository instead.
Don't run both at once. They install into different folders, so SillyBunny will happily
load the pair of them and you'll end up with two sets of chevrons, two sets of observers,
and a /dswipe belonging to whichever one loaded last.
Fork issues, SillyBunny layout bugs, and compatibility reports should be directed to purachina on GitHub through this repository: https://github.com/SillyBunnyTeam/SillyBunny-Deep-Swipe/issues
Upstream never started up for me at all. Its init fetches settings.html from a hardcoded
scripts/extensions/third-party/deep-swipe path, and if the folder you installed into is
spelled any differently - one capital letter is enough on Linux - that fetch 404s and takes
the whole extension down with it. No chevrons, no counters, no slash commands, no settings
panel. It still lists itself as enabled, which is the part that had me looking in the wrong
place for an evening.
So:
- The settings path is worked out from the module's own URL now, so it stops caring what the folder is called, whether you installed globally or per-user, and how you capitalised the URL you pasted.
- Loading the settings panel sits in its own try block. If it ever fails again you still get the swipe controls.
- The chevrons use SillyBunny's own swipe geometry, so they line up under Echo, Whisper, Hush, Ripple and Tide rather than sitting wherever vanilla left them.
- Clicking a chevron mid-generation is blocked now, same as the native swipe buttons.
swipe.right()andswipe.left()quietly dropforceMesIdandforceSwipeId. Swapped forswipe.to(), which actually takes them.- Dropped about ninety lines of save-corruption defence built on a theory that doesn't hold
here - SillyBunny's
saveChat()clones the chat before it queues anything, so it was never going to mutate the array it was handed. - Fixed the slash command arguments, which were going into the wrong constructor slots and
made
/dswipeautocomplete suggest nonsense.
Everything else is Rurijian's work. Their original readme follows.
A SillyTavern extension that allows you to swipe (regenerate) any message in your chat history, not just the last one. Clone the native swipe experience for every message!
Deep-Swipe.mp4
- Deep Swipe: Generate new swipes anywhere in the context! User or Assistant! It doesn't matter! Swipe everything!!
- Read While Generating: Continue reading the previous swipe while a new one generates! An overlay preserves the content so you don't lose your place!
- Deep Impersonate for User Messages: Generate alternative user messages using a customizable impersonation prompt. Swipe old log with new based chinese models! Change the past, but lazily! DIRECTORMAXXING
- Deep Regenerate for Assistant Messages: Regenerate any AI response, not just the last one! Fix that one awkward reply from 20 messages ago!
- Navigation Chevrons: Browse through existing swipes with left/right arrows on each message, just like native, but more!
- Swipe Counters: See swipe count (e.g., "2/5") on each message, just like native, but more!
- Beautiful Polish: Fade-in/fade-out overlays, spinning throbbers, completion messages, and pulsing border highlights! It's fancy!
- Non-destructive: Uses a truncate-generate-restore pattern that preserves your chat history
- Smart DOM Handling: Prevents message hijacking with clever mesid invalidation tricks! Tech wizardry!
- Deep Swipe will REFUSE to generate while Prompt Inspector's "Inspect Prompts" feature is enabled
- You must disable Prompt Inspector (click "Stop Inspecting" in the wand menu) before using Deep Swipe generation
- Navigating between existing swipes still works while PI is enabled
This is a hard compatibility limit - the extensions fundamentally conflict in how they handle generation state.
- Copy https://github.com/Rurijian/deep-swipe into extensions/install extensions (top-right button) as all-users
- Refresh Sillytavern maybe? It's probably fine though
- The extension will be available immediately
If you want to use the slash commands, I recommend you turn on message IDs so you can see which number you want to Deep Swipe. But, you probably already know this, if you're using slash commands. Use the built-in /messages command.
Deep Swipe provides navigation controls on each message:
- Left arrow (←): Go to previous swipe
- Right arrow (→): Go to next swipe (or generate new if at last)
Slash Commands
/dswipe back [id] or /ds back [id]
Function: Navigate to the previous swipe on a message
# Generate a new response for message #3
/dswipe forward 3
# Navigate to previous swipe on message #7
/dswipe back 7
# Using the short alias
/ds forward 10
- Shows current swipe position (e.g., "2/5")
- Available on both AI and user messages
Note: Navigation controls are hidden on the last message (which has native swipe buttons) and on system messages.
Access the settings in Extensions > Deep Swipe:
- Enable Deep Swipe: Master toggle for the extension
- Show Deep Swipe navigation: Display navigation arrows and counters on messages
- Enable Deep Swipes on user messages: Allow swiping user messages (Deep Impersonate)
- Enable Deep Swipes on assistant messages: Allow regenerating any AI response
- Impersonation Prompt: Customizable prompt for generating user message swipes
- Use
{{user}}for the user name - Use
{{input}}for the original message content - Default:
NEW DIRECTION: Could you re-write/improve my last reply as if you were me? Just post the reply.
- Use
- Assistant Impersonation Prompt: Optional custom prompt for assistant swipes
- Auto-advance to latest swipe: Automatically switch to newly generated swipes
When enabled, user messages can be swiped to generate alternative versions. The extension uses a guided impersonation approach:
- The current user message is used as input
- The impersonation prompt guides the AI to rewrite/improve as the user
- The AI generates an alternative response following the prompt's guidance
- The new response is saved as a swipe
This is useful for:
- Exploring different ways to express the same idea
- Adjusting tone or style of user messages
- Creating variations for branching storylines
- Fixing that one reply you wish you worded better
When enabled, any assistant message can be regenerated, not just the last one:
- The target message is preserved with a beautiful overlay showing current content
- A temp message triggers generation at the bottom of context
- The AI generates a fresh response
- The new response is captured and saved as a new swipe
- Fancy animations show completion!
This is useful for:
- Fixing awkward responses buried in the chat history
- Exploring different AI personalities mid-conversation
- Creating alternative story branches
Deep Swipe uses a sophisticated "truncate-generate-restore" pattern:
- Save: Messages after the target are temporarily saved
- Overlay: An overlay shows the current content during generation
- Truncate: Chat is truncated to isolate the target context
- Generate: A new swipe is generated at the bottom of context (like user swipes!)
- Capture: The generated response is captured as a new swipe
- Restore: The saved messages are re-inserted into the chat
- Polish: Fancy animations and border highlights guide your eyes!!!
- Refresh: The UI is updated to show the new swipe
For user messages, the extension uses guided impersonation with a customizable prompt. For assistant messages, the overlay lets you "read while generating" - based
MIT License
Created by Rurijian for SillyTavern Version 1.3.0 - Now with extra polish!