-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to share app + settings via a URL #2269
Comments
I wonder if we can use datasets on the hub as the "Database" for this. Regardless of the implementation, we should consolidate this issue with #1452, no? |
Yes let me close #1452 as this issue is more descriptive and suggests some possible approaches |
That would be pretty cool, and we have most of the logic already in place via the |
So what about the following UX:
DX:
|
Coming back to this, using a database seem like a lot of effort. You would need to pass a token, so it would basically not be available on many interfaces, the user would have to go through a number of steps in order to actually share their parameters, further cluttering the UI. It is also gives us more to maintain + an external service as a dependency which we will need to keep track of (we currently have no testing in place to notify us when external services change). Using the url would just be a simple copy/ paste, doesn't require permissions/ a token, is faster because there are no network requests involved and is simpler because the url would just be waiting to be copied with no additional steps for the user. Plus the maintenance benefits noted above. We could allow the author of the space to fine tune what gets saved by adding |
If it's using a HF Dataset as the backend, the user of the app wouldn't have to pass in a token. Only the developer of the app would have to pass in an HF token so that a HF Dataset can be created from the Space. It wouldn't change the UI at all. I like the URL approach too for its simplicity, but the only problem is that it wouldn't work for images or any media component as you discussed above |
The database approach needs the users trust for the developer for sensible data. |
This would be super cool for our Stable Diffusion bias Spaces, where we would like to share Spaces with people saying something like: check out this cool result with these values and they would have the Space show those, instead of the default ones |
@sashavor in your case, do you need to share images/audio/etc or just numerical parameters that could be encoded into a URL? |
Just the numerical parameters! |
#2654 has some implications on this and is a pre-requisite |
Is your feature request related to a problem? Please describe.
People are manually sharing prompts + settings for stable diffusion
Describe the solution you'd like
A way for users to easily share settings just by sharing a URL.
Some options
We could use query params to do this for the most part. Each component has a unique id so it would be easy to map the values contained within
url/?1=hi&2=hi2
to the correct settings for components. The only thing we really need to think about it URL length limits which are different for different browsers but are something like 2000+ at minimum. We are unlikely to hit this for most standard inputs but anything involving media or longform text could cause issues.We would probably need to omit media and long text from this implementation.
There other alternative is to store them in a database and generate a unique short url, we could then look up the config in the DB and send that down for a given URL, this is more complex and less responsive but we would be able to cache the whole state of the page (including media + outputs). Query params can update without reloading the page and in realtime if needed (as those inputs are changed), shorturls would need to be sent off for processing.
Concerns
Query params should be pretty safe but I don't know if adding subpaths to Gradio apps would cause any issues for users, if so we could add this functionality under a
shareable_links=Bool
flag that be get passed to.launch()
The text was updated successfully, but these errors were encountered: