Skip to content

Commit 5eeedd9

Browse files
yiyixuxuyiyixuxupatrickvonplaten
authored
add StableDiffusionXLControlNetImg2ImgPipeline (#4592)
--------- Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen <[email protected]>
1 parent a971c59 commit 5eeedd9

File tree

7 files changed

+1746
-0
lines changed

7 files changed

+1746
-0
lines changed

src/diffusers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
StableDiffusionPix2PixZeroPipeline,
192192
StableDiffusionSAGPipeline,
193193
StableDiffusionUpscalePipeline,
194+
StableDiffusionXLControlNetImg2ImgPipeline,
194195
StableDiffusionXLControlNetPipeline,
195196
StableDiffusionXLImg2ImgPipeline,
196197
StableDiffusionXLInpaintPipeline,

src/diffusers/pipelines/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
StableDiffusionControlNetImg2ImgPipeline,
5252
StableDiffusionControlNetInpaintPipeline,
5353
StableDiffusionControlNetPipeline,
54+
StableDiffusionXLControlNetImg2ImgPipeline,
5455
StableDiffusionXLControlNetPipeline,
5556
)
5657
from .deepfloyd_if import (

src/diffusers/pipelines/auto_pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
StableDiffusionControlNetImg2ImgPipeline,
2323
StableDiffusionControlNetInpaintPipeline,
2424
StableDiffusionControlNetPipeline,
25+
StableDiffusionXLControlNetImg2ImgPipeline,
2526
StableDiffusionXLControlNetPipeline,
2627
)
2728
from .deepfloyd_if import IFImg2ImgPipeline, IFInpaintingPipeline, IFPipeline
@@ -73,6 +74,7 @@
7374
("kandinsky", KandinskyImg2ImgCombinedPipeline),
7475
("kandinsky22", KandinskyV22Img2ImgCombinedPipeline),
7576
("stable-diffusion-controlnet", StableDiffusionControlNetImg2ImgPipeline),
77+
("stable-diffusion-xl-controlnet", StableDiffusionXLControlNetImg2ImgPipeline),
7678
]
7779
)
7880

src/diffusers/pipelines/controlnet/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .pipeline_controlnet_img2img import StableDiffusionControlNetImg2ImgPipeline
1818
from .pipeline_controlnet_inpaint import StableDiffusionControlNetInpaintPipeline
1919
from .pipeline_controlnet_sd_xl import StableDiffusionXLControlNetPipeline
20+
from .pipeline_controlnet_sd_xl_img2img import StableDiffusionXLControlNetImg2ImgPipeline
2021

2122

2223
if is_transformers_available() and is_flax_available():

src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py

Lines changed: 1381 additions & 0 deletions
Large diffs are not rendered by default.

src/diffusers/utils/dummy_torch_and_transformers_objects.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,21 @@ def from_pretrained(cls, *args, **kwargs):
902902
requires_backends(cls, ["torch", "transformers"])
903903

904904

905+
class StableDiffusionXLControlNetImg2ImgPipeline(metaclass=DummyObject):
906+
_backends = ["torch", "transformers"]
907+
908+
def __init__(self, *args, **kwargs):
909+
requires_backends(self, ["torch", "transformers"])
910+
911+
@classmethod
912+
def from_config(cls, *args, **kwargs):
913+
requires_backends(cls, ["torch", "transformers"])
914+
915+
@classmethod
916+
def from_pretrained(cls, *args, **kwargs):
917+
requires_backends(cls, ["torch", "transformers"])
918+
919+
905920
class StableDiffusionXLControlNetPipeline(metaclass=DummyObject):
906921
_backends = ["torch", "transformers"]
907922

0 commit comments

Comments
 (0)