Skip to content

Add PAG support to SD1.5 #8710

Closed
Closed
@yiyixuxu

Description

@yiyixuxu
Collaborator

We recently integrated PAG into diffusers! See this PR [here] (#7944) we added PAG to SDXL

we also want to add PAG support to SD1.5 pipelines! we will need:

  1. You should put it under the pag folder
  2. you can use the implementation of SDXL PAG pipelines as a reference (see this PRhttps://github.com/add PAG support  #7944 and you can find all the sdxl pag pipelines here https://github.com/huggingface/diffusers/tree/main/src/diffusers/pipelines/pag)
  3. you need to add AutoPipeline so that you can use this API to create it
       AutoPipelineForImage2Image.from_pretrained(repo_id, controlnet=controlnet, enable_pag=True ...)
  4. tests and docs

If you are interested in working on this, Let me know which pipeline(s) you want to work on:)

Activity

blaisedmello

blaisedmello commented on Jun 26, 2024

@blaisedmello

Hello, I would like to have a go at it. Can I work on the StableDiffusionPAGInpaintPipeline?

yiyixuxu

yiyixuxu commented on Jun 26, 2024

@yiyixuxu
CollaboratorAuthor
shauray8

shauray8 commented on Jun 26, 2024

@shauray8
Contributor

Looks rather interesting, adding support for StableDiffusionPAGPipeline.

sajadn

sajadn commented on Jun 26, 2024

@sajadn
Contributor

Hey, I'll work on StableDiffusionPAGImg2ImgPipeline

tuanh123789

tuanh123789 commented on Jun 27, 2024

@tuanh123789
Contributor

Hi, can i take StableDiffusionControlNetPAGPipeline

yiyixuxu

yiyixuxu commented on Jun 27, 2024

@yiyixuxu
CollaboratorAuthor
Bhavay-2001

Bhavay-2001 commented on Jun 27, 2024

@Bhavay-2001
Contributor

Hi @yiyixuxu, I think I can work on StableDiffusionControlNetPAGImg2ImgPipeline. Pls assign this to me.

yiyixuxu

yiyixuxu commented on Jun 27, 2024

@yiyixuxu
CollaboratorAuthor
AbhinavJangra29

AbhinavJangra29 commented on Jun 29, 2024

@AbhinavJangra29

@yiyixuxu can i try ?

3 remaining items

darshil0805

darshil0805 commented on Aug 17, 2024

@darshil0805
Contributor

Hi, I'd like to work on StableDiffusionPAGInpaintPipeline if it's still open

yiyixuxu

yiyixuxu commented on Aug 17, 2024

@yiyixuxu
CollaboratorAuthor
darshil0805

darshil0805 commented on Sep 7, 2024

@darshil0805
Contributor

Hi @yiyixuxu , @a-r-r-o-w. I have opened a PR for SD Inpainting PAG Pipeline, can you review and help me to test this pipeline?

crapthings

crapthings commented on Sep 17, 2024

@crapthings

how do i know the layer names?
only
up mid down?

yiyixuxu

yiyixuxu commented on Sep 17, 2024

@yiyixuxu
CollaboratorAuthor

cc @a-r-r-o-w, maybe we should update doc? (did we?)

a-r-r-o-w

a-r-r-o-w commented on Sep 17, 2024

@a-r-r-o-w
Member

how do i know the layer names?
only
up mid down?

The correct usage is to look at either the modeling code, or state dict keys, to see what the layer naming looks like. Then you can specify either the full layer names or partial layer names as valid regular expressions when initializing the pipeline (via pag_applied_layers). For more advanced usage, you can take a look at helper methods in the PAGMixin.

See the docs and examples usages here.

TLDR; Our naming convention follows the pattern of something_blocks.whatever or something_blocks.[layer_index} or blocks.{layer_index} or transformer_blocks.{layer_index}, so the easiest way to enable them without looking into the state dict or modeling code is to specify something like pag_applied_layers="blocks.(10|20|42)" or pag_applied_layers="mid"

cc @a-r-r-o-w, maybe we should update doc? (did we?)

I think we did, but I noticed that the introduction docs are out of sync with the current usage, and I'm not sure if the current example works. I'll test and open a PR soon

saikomals

saikomals commented on Sep 19, 2024

@saikomals

HI @yiyixuxu I'd like to work on StableDiffusionPAGImg2ImgPipeline if it's still open. Thanks

yiyixuxu

yiyixuxu commented on Sep 20, 2024

@yiyixuxu
CollaboratorAuthor

@airookie17
I think I'm about to merge in this #9463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @crapthings@yiyixuxu@sajadn@shauray8@tuanh123789

      Issue actions

        Add PAG support to SD1.5 · Issue #8710 · huggingface/diffusers