-
-
Notifications
You must be signed in to change notification settings - Fork 3
Stash Plugin Guide
skier233 edited this page Jan 1, 2025
·
23 revisions
- Stash is installed with images or scenes registered with it.
- Python is installed in the same environment as Stash (directly on the computer, Docker, virtualenv, etc).
- The AI Server is up and running. See the AI Quickstart Guide.
- In Stash, go to Settings -> Plugins -> Available Plugins -> Community (stable).
- Search for
AI Tagger
at the top. - Select
AI Tagger
and hit Install. - Ensure the AI server is running.
- Navigate to Settings -> Tasks.
- Scroll down to the bottom to find Plugin Tasks.
- Select AI Tagger -> Tag Scenes.
- Run this task twice to install necessary dependencies and set up required tags in Stash for the plugin.
- If you encounter any errors in the Stash logs during installation, navigate to the plugin directory
<your-stash-directory>/plugins/community/ai_tagger
and runpip install -r requirements.txt
.
- If you encounter any errors in the Stash logs during installation, navigate to the plugin directory
- In Stash, go to Settings -> Plugins -> Available Plugins -> Community (stable).
- Search for
AI Tagger
at the top. - Select
AI Tagger
and hit Install. - Launch a shell on your computer (outside docker)
- Create a new python virtual environment:
python -m venv ./stash_venv
. Save this path for later<stash-venv-path>
- Activate the virtual environment:
source /root/.stash/venv/bin/activate
You should see the (stash_venv) prefix in your shell - Install the AI Tagger Dependencies:
pip install -r <stashfolder>/plugins/community/ai_tagger/requirements.txt
- Open Stash -> Settings -> System
- Edit Python Executable Path:
<stash-venv-path>/bin/python
- In Stash click Settings -> Plugins -> Reload Plugins
-
Marking for AI Tagging:
- To mark scenes or images for AI tagging, add the
AI_TagMe
tag to those scenes or images in Stash. - You can tag large batches, selecting thousands of scenes or images for AI processing.
- To mark scenes or images for AI tagging, add the
-
Running the AI Tagger:
- Navigate to Settings -> Tasks -> AI Tagger.
- Choose
Tag Images
to tag images with theAI_TagMe
tag orTag Scenes
to tag scenes with theAI_TagMe
tag.
After tagging, the scenes or images will be updated as follows:
- Successfully tagged items will have the
AI_Tagged
tag and any other applied tags. - Items that encountered errors or were unreadable will have the
AI_Errored
tag.
Scenes previously tagged by the AI server can be updated in Stash to generate different markers or scene tags with new settings without reprocessing the entire scene in the AI server.
To update a scene:
- Add the
AI_TagMe
tag to a scene that was already tagged and has theAI_Tagged
tag. - The existing markers and scene tags will be replaced with ones generated from the stored AI results using the new settings.
Exceptions:
- If the active AI model on the server is a more accurate/newer version from the one used previously.
- If the
frame_interval
inconfig.py
(which defines how often frames in the scene should be processed by the AI) is lower than when the scene was originally tagged.
In these cases, the AI will reprocess the scene.
To customize the plugin, navigate to the plugin directory located at <your-stash-directory>/plugins/community/ai_tagger
. Inside this folder, you can customize the config.py:
config.py
:
- Contains FRAME_INTERVAL which is the interval, in seconds, that the AI will process frames from the video. The default is 2 seconds which means the AI will process a frame at every 2s interval from the video. Lowering this value to 1 or 0.5s will make markers have more accurate start and end times at the cost of longer AI processing. Raising this value will decrease the AI processing time which could be helpful for underpowered computers.
- Contains the link to the AI server (if changed).
- Contains path_mutation which allows mutation of paths when sent from the Stash plugin to the AI Server. If your stash server and ai server are on different computers or in Docker you may likely need this. This works by replacing any instances of the first path with the second path for each item in path_mutation.