Skip to content

add device map and accelerate to DiffusionPipeline abstraction to reduce memory footprint when loading model #725

@piEsposito

Description

@piEsposito

Is your feature request related to a problem? Please describe.
As a follow up for #281 we could add the device map and the possibility to load weights using accelerate to DiffusionPipeline abstraction for smaller memory footprint when loading models.

Describe the solution you'd like

from diffusers import DiffusionPipeline



pipeline = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-3", device_map="auto")

Describe alternatives you've considered

  • Load models by hand every time
  • Have a larger memory footprint when loading models

Additional context
This is a follow up for #281.

I can work on that if you folks would let me.

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