Skip to content

include input parameters in PipelineOutput #526

@keturn

Description

@keturn

It's useful to be able to associate a pipeline result with the parameters that generated it. It provides a record for the experimenter themselves, other people looking to learn from them, those interested in reproducible results, and community-wide surveys.

Current pipelines have a number of values they set by default when they are not provided, so the only way for an application to know all the inputs is either
a) use a pipeline that provides no defaults for optional arguments, requiring the application to explicitly specify every value, or
b) have the output of a pipeline run include the values of all the inputs it used, including any that were set from a default value or heuristic.

I propose throwing a bunch more fields on StableDiffusionPipelineOutput (and presumably other PipelineOutput classes too), that include most of the args in their __call__ signature.

Potential complications:

  • batching. With current pipeline implementations, most parameters are consistent across the batch, but prompt may vary.
  • seed. People want this, but the current StableDiffusionPipeline doesn't bother to explicitly seed the PRNG at all, so there's nothing for it to report. There is a way for the calling application to handle this: provide its own seeded Generator, or its own latents, The pipeline run can return its initial latents as well (as proposed in Add better compatibility with diffusers-interpret (and possibly other use cases!) #506).

This is a fairly straightforward change. The reason I ask about it up front instead of diving right in to a PR is because I have the feeling I don't understand all the existing PipelineOutput use cases, i.e. whether there are places that depend on PipelineOutput.to_tuple to stay a particular size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions