-
Notifications
You must be signed in to change notification settings - Fork 4
Running other pipelines #25
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
Comments
My own thoughts on the matter: |
@MicahZoltu Good point. Abstracting pipelines is non-trivial, you might find huggingface/diffusers#551 an interesting read. I'd like to keep models modular, but for now one pipeline ( I look forward to adding image interpolation, CLIP-guided generation and For example, in trying to implement interpolation. Let's add a new
The latter option feels more correct to me, and would allow parallelization among multiple workers, but would require lifting code similar to the |
In #23 I tried to implement running an arbitrary HuggingFace pipeline as it gets published in e.g. https://github.com/huggingface/diffusers/tree/main/examples/community.
I added a way to set the name of the pipeline to be constructed (referencing e.g., a community published pipeline), and the name of the method to be called on it (
None
referring to__call__
, otherwise usually eithertext2img
,img2img
andinpaint
).Extra parameters were also allowed. I got to the point where arbitrary arguments could be passed to the
pipe(**kwargs)
call:GET /pipeline?query1=a&query2=b
, arbitrary query strings were parsed byast.literal_eval
, able to express primitive types like strings, bytes, numbers, and even collections like tuples, lists, dictsPOST /task
took anextra_parameters
dict, able to express any JSON (string, number, boolean, list, dict)However, this would still mean no way of calling most of the community pipelines.
negative_prompt
, which is defined in our defaultstoken1 | token2
syntaxaudio
argument (probably some sort of blob), which can't be easily represented by the types expressable byast.literal_eval
and JSONwildcard_option_dict
along with a__clothing__
syntaxed prompt(token:1.3)
syntax and longer promptsEssentially, with #23 you would profit composable and wildcard pipeline. The truth is, I would prefer to allow all of these syntaxes at the same time, but the pipeline definitions aren't composable with one another (a gripe shared by others huggingface/diffusers#841).
Is there some other way to run arbitrary pipelines via API? What changes would we need to make to get there?
The text was updated successfully, but these errors were encountered: