Skip to content

Allow users to share app + settings via a URL #2269

Closed
@pngwn

Description

@pngwn
  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
People are manually sharing prompts + settings for stable diffusion

image

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()

Metadata

Metadata

Labels

enhancementNew feature or requestneeds designingThe proposed feature needs to be discussed and designed before being implemented

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions