Upgrading Stashai to ONNX endpoint ; Same HF Host#730
Open
Drewlius wants to merge 1 commit into
Open
Conversation
Details Hosted by the original creator at the same HF Spaces URL This was tested and verified by hand with multiple different media formats across both Tags and Markers and is confirmed operational on my machine. Used OpenCode to help understand Gradio and how it handles API interactions as well as how that interacts with stash and base64 data URL. There is a built in retry logic loop as well as built in compatibility for older browsers. if it is not working on your end i would suggest checking the HF Spaces URL above and ensuring that it is fully online and operational before blaming the script. Both the stashai.js and the stashai.yml must be deployed for the change to take effect and be functional. only deploying the stashai.js will result in errors and result in failure of the plugin function completely. Post-Update migrated from a Gradio 3 Space to a Gradio 5 Space, which meant completely rewriting how the plugin talks to the API. After changing stashai.js you must hard refresh your browser (Ctrl + Shift + r). In the Stash App, reload plugins in plugins settings in the main Settings screen. Regular browser refresh won't pick up the changes. Some-Context The ONNX Space has a bigger, better model but runs on HF's free tier (2GB RAM). The 335MB model barely fits and it cold-starts, OOMs occasionally, and then HF auto-restarts it. The plugin needs retry logic to handle this. The 335MB ONNX model takes ~30 seconds to load on HF's free tier. During that time, the Space might OOM and restart. The first request often fails, but the second or third works. This is solved by the retries with delays in the script.
Author
|
Apologies about the original pull requests to the wrong branch of the project. |
DogmaDragon
reviewed
Jun 19, 2026
| name: Stash AI | ||
| # requires: CommunityScriptsUILibrary | ||
| description: Add Tags or Markers to a video using AI | ||
| version: 1.0.2 |
Contributor
There was a problem hiding this comment.
Need to bump the version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
Post-Update
Some-Context
AI USAGE
Opencode was used to help me understand the syntax of the API requests to the Stashai ONNX Model endpoint, the GRADIO 5 documentation was fed into it, HF API Request documentation for JS was fed in, the old stashai.js was fed in, and the contents of my IDE was fed in, this was done to query when I had questions regarding the documentation and helping to troubleshoot non 200 OK Responses from the HF API endpoint. JavaScript is also fairly new to me so it was useful and time saving for me to get help with particular JS Syntax and plain English translations of functions and definitions contained within the original .JS file. The code was all tested and verified to be functioning properly and returning both Tags and Markers and successfully attaching them to the video file and adding those Tags/Markers to the DB properly. There may be issues still present. I am not an expert at web development or Javasript and have spent most of my time in programming writing Python and bash scripts for Linux, Like i stated though the script is working and returning responses from the correct ONNX API endpoint. If you review and see something is wrong don't hesitate to point it out. I will spend the time to fix it to the best of my abilities.