Skip to content

Reducing model loads on pipeline switches #3147

Closed
@pdoane

Description

@pdoane

What API design would you like to have changed or added to the library? Why?

When switching between txt2img and img2img, it is possible to use the constructor directly:

StableDiffusionImg2ImgPipeline(**prev_pipeline.pipe.components)

I would like to enable similar patterns when using ControlNet. There are potentially 3 different scenarios here:

  1. Same pipeline but different controlnet. It doesn't look like there is anything in the constructor prohibiting this but I have hit some issues - possibly bugs in my own code.

  2. Different pipeline but same base model. I get some errors about unallocated storage when testing this.

  3. Different controlnet pipeline but same base model. This also seems to sometimes work but I've hit some issues.

What use case would this enable or better enable? Can you give us a code example?

Model loading is slow and to a lesser extent, the control net models. I would like to minimize the loading times and re-use existing components that are in memory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions