-
Notifications
You must be signed in to change notification settings - Fork 470
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
Widget for text to image generation #113
Comments
More than happy to take this one. |
You're going full speed! ⚡ The approach has been great so far, I think you can go ahead with the widget. |
Awesome! 🤗 |
Created draft PR #131 |
Some example motivation for this :) |
And this as well huggingface/transformers#12281 😉 |
Hi, I'm interested in this widget. |
There is an existing PR - #131 but at the moment this is not integrated to the Inference API (since there is no |
Btw, if you have model repos with a text to image generation model, I would be interested if you share them + some example on how to do inference. |
Would it make sense to allow custom pipelines? |
Yes, having a generic docker image to support custom inference is in our roadmap. We will require a very specific input/output requirement for the API to work, but other than that it will be up to the users to do their own implementations, including adding their custom dependencies. |
They can already submit a PR against https://github.com/huggingface/huggingface_hub/tree/main/api-inference-community though no? |
@julien-c you mean in the form of a new docker image just for this use case? |
Yes – the boundary between single model and "library" being rather slim as we've seen in other cases, wouldn't |
Should we change the API output: from image to an array of images? That way, we can show multiple generated images from a single text prompt, as it's currently done in most papers/demos/tweets. (See attached an image from @borisdayma's tweet) If the output changes to an array of images, I'm thinking that the widget would involve some kind of horizontal scrolling/switching between different images |
If this is a short-time solution, let's do it! @borisdayma, feel free to open a PR about this. For one-shot cases, instead of having to maintain a very large number of images, I would prefer to go down the generic image path so we don't end up with hundreds of images. I think the us from the future will thank us going that road. I can work on adding the generic docker image the first week of August (in two weeks from now).
I'll ask @Narsil to share his opinion on this, from an endpoint point of view it makes more sense to only return one imo. Alternatively users could maybe specify number of generated images as a param, but maybe it's just better to make multiple calls to the API |
I'm not sure if the best here would be to work with the inference API or HF spaces (which probably has more flexibility for these cases). |
Personally I'd like widgets to be a 1:1 representation of the underlying API call, so if we want to display multiple generated images in one click, I'd be in strong favor of doing it at the API level (for text generation, we do have an API param to generate multiple continuations, no?) |
It depends on what you wanna do exactly. |
Yep in that case Spaces are more flexible. (whereas widgets are meant to be the canonical 1:1 representation of a model's interface) |
(can confirm: for text generation, num_return_sequences param exists for multiple continuations) |
Closing this issue since now there's a widget! |
Input would be text
The output would be the image
The text was updated successfully, but these errors were encountered: