Skip to content

Add PAG support to StableDiffusionControlNetPAGInpaintPipeline #8875

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

Merged
merged 21 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5885d74
Add pag to controlnet inpainting pipeline
juancopi81 Jul 6, 2024
2c11062
Fix minor but with timeste_cond
juancopi81 Jul 6, 2024
6267102
Add code to dummy_torch_and_transformers_objects and use autopipeline…
juancopi81 Jul 6, 2024
d152e16
Fix logic in auto_pipeline when pag and controlnet are present
juancopi81 Jul 8, 2024
d4093e0
Add some debug prints
juancopi81 Jul 8, 2024
3f502f1
Change replacement logic for now so it can take ControlNetPAGInpaintP…
juancopi81 Jul 8, 2024
f6a98cd
Add check of shapes when unet channels == 9
juancopi81 Jul 9, 2024
7d1a260
Remove some print statements, add some debug prints to shapes when un…
juancopi81 Jul 9, 2024
088f0c8
Expand mask and masked_image_latents if necessary when unet has 9 cha…
juancopi81 Jul 9, 2024
bb01aba
Adjust repeat factor so mask, and masked_image_latents match latent_m…
juancopi81 Jul 9, 2024
102ce9d
Concatenate tensors when unet has 9 channels
juancopi81 Jul 10, 2024
f9e4543
Add tests to pag controlnet sd inpaint pipeline
juancopi81 Jul 17, 2024
512a252
Make style changes
juancopi81 Jul 17, 2024
ce28845
Final changes based on @a-r-r-o-w feedback and run make style make qu…
juancopi81 Jul 19, 2024
00f8c7a
Fix incorrect comment for message 'Copied from ...'
juancopi81 Jul 20, 2024
f7a183e
Add test to ensure StableDiffusionControlNetPAGInpaintPipeline works …
juancopi81 Jul 24, 2024
93fca2d
Remove cn_inpainting test for now and change logic if cn and enable_p…
juancopi81 Jul 29, 2024
2fb4fd4
Merge branch 'main' into pag_controlnet_inpaint_sd15
yiyixuxu Sep 4, 2024
d5214db
Merge branch 'main' into pag_controlnet_inpaint_sd15
yiyixuxu Oct 1, 2024
7b2368b
style
yiyixuxu Oct 1, 2024
669052a
loraloadermixin -> stablediffusionloraloadermixin
yiyixuxu Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/source/en/api/pipelines/pag.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Since RegEx is supported as a way for matching layer identifiers, it is crucial

## StableDiffusionControlNetPAGPipeline
[[autodoc]] StableDiffusionControlNetPAGPipeline

## StableDiffusionControlNetPAGInpaintPipeline
[[autodoc]] StableDiffusionControlNetPAGInpaintPipeline
- all
- __call__

Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
"StableDiffusionAttendAndExcitePipeline",
"StableDiffusionControlNetImg2ImgPipeline",
"StableDiffusionControlNetInpaintPipeline",
"StableDiffusionControlNetPAGInpaintPipeline",
"StableDiffusionControlNetPAGPipeline",
"StableDiffusionControlNetPipeline",
"StableDiffusionControlNetXSPipeline",
Expand Down Expand Up @@ -778,6 +779,7 @@
StableDiffusionAttendAndExcitePipeline,
StableDiffusionControlNetImg2ImgPipeline,
StableDiffusionControlNetInpaintPipeline,
StableDiffusionControlNetPAGInpaintPipeline,
StableDiffusionControlNetPAGPipeline,
StableDiffusionControlNetPipeline,
StableDiffusionControlNetXSPipeline,
Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
)
_import_structure["pag"].extend(
[
"StableDiffusionControlNetPAGInpaintPipeline",
"AnimateDiffPAGPipeline",
"KolorsPAGPipeline",
"HunyuanDiTPAGPipeline",
Expand Down Expand Up @@ -566,6 +567,7 @@
KolorsPAGPipeline,
PixArtSigmaPAGPipeline,
StableDiffusion3PAGPipeline,
StableDiffusionControlNetPAGInpaintPipeline,
StableDiffusionControlNetPAGPipeline,
StableDiffusionPAGPipeline,
StableDiffusionXLControlNetPAGImg2ImgPipeline,
Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/pipelines/auto_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
HunyuanDiTPAGPipeline,
PixArtSigmaPAGPipeline,
StableDiffusion3PAGPipeline,
StableDiffusionControlNetPAGInpaintPipeline,
StableDiffusionControlNetPAGPipeline,
StableDiffusionPAGPipeline,
StableDiffusionXLControlNetPAGImg2ImgPipeline,
Expand Down Expand Up @@ -148,6 +149,7 @@
("kandinsky", KandinskyInpaintCombinedPipeline),
("kandinsky22", KandinskyV22InpaintCombinedPipeline),
("stable-diffusion-controlnet", StableDiffusionControlNetInpaintPipeline),
("stable-diffusion-controlnet-pag", StableDiffusionControlNetPAGInpaintPipeline),
("stable-diffusion-xl-controlnet", StableDiffusionXLControlNetInpaintPipeline),
("stable-diffusion-xl-pag", StableDiffusionXLPAGInpaintPipeline),
("flux", FluxInpaintPipeline),
Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/pipelines/pag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
_dummy_objects.update(get_objects_from_module(dummy_torch_and_transformers_objects))
else:
_import_structure["pipeline_pag_controlnet_sd"] = ["StableDiffusionControlNetPAGPipeline"]
_import_structure["pipeline_pag_controlnet_sd_inpaint"] = ["StableDiffusionControlNetPAGInpaintPipeline"]
_import_structure["pipeline_pag_controlnet_sd_xl"] = ["StableDiffusionXLControlNetPAGPipeline"]
_import_structure["pipeline_pag_controlnet_sd_xl_img2img"] = ["StableDiffusionXLControlNetPAGImg2ImgPipeline"]
_import_structure["pipeline_pag_hunyuandit"] = ["HunyuanDiTPAGPipeline"]
Expand All @@ -44,6 +45,7 @@
from ...utils.dummy_torch_and_transformers_objects import *
else:
from .pipeline_pag_controlnet_sd import StableDiffusionControlNetPAGPipeline
from .pipeline_pag_controlnet_sd_inpaint import StableDiffusionControlNetPAGInpaintPipeline
from .pipeline_pag_controlnet_sd_xl import StableDiffusionXLControlNetPAGPipeline
from .pipeline_pag_controlnet_sd_xl_img2img import StableDiffusionXLControlNetPAGImg2ImgPipeline
from .pipeline_pag_hunyuandit import HunyuanDiTPAGPipeline
Expand Down
Loading
Loading