Skip to content

Commit a61bb6b

Browse files
UmerHApatrickvonplatenstevhliuDN6
authored
Add ControlNet-XS support (huggingface#5827)
* Check in 23-10-05 * check-in 23-10-06 * check-in 23-10-07 2pm * check-in 23-10-08 * check-in 231009T1200 * check-in 230109 * checkin 231010 * init + forward run * checkin * checkin * ControlNetXSModel is now saveable+loadable * Forward works * checkin * Pipeline works with `no_control=True` * checkin * debug: save intermediate outputs of resnet * checkin * Understood time error + fixed connection error * checkin * checkin 231106T1600 * turned off detailled debug prints * time debug logs * small fix * Separated control_scale for connections/time * simplified debug logging * Full denoising works with control scale = 0 * aligned logs * Added control_attention_head_dim param * Passing n_heads instead of dim_head into ctrl unet * Fixed ctrl midblock bug * Cleanup * Fixed time dtype bug * checkin * 1. from_unet, 2. base passed, 3. all unet params * checkin * Finished docstrings * cleanup * make style * checkin * more tests pass * Fixed tests * removed debug logs * make style + quality * make fix-copies * fixed documentation * added cnxs to doc toc * added control start/end param * Update controlnetxs_sdxl.md * tried to fix copies.. * Fixed norm_num_groups in from_unet * added sdxl-depth test * created SD2.1 controlnet-xs pipeline * re-added debug logs * Adjusting group norm ; readded logs * Added debug log statements * removed debug logs ; started tests for sd2.1 * updated sd21 tests * fixed tests * fixed tests * slightly increased error tolerance for 1 test * make style & quality * Added docs for CNXS-SD * make fix-copies * Fixed sd compile test ; fixed gradient ckpointing * vae downs = cnxs conditioning downs; removed guess * make style & quality * Fixed tests * fixed test * Incorporated review feedback * simplified control model surgery * fixed tests & make style / quality * Updated docs; deleted pip & cursor files * Rolled back minimal change to resnet * Update resnet.py * Update resnet.py * Update src/diffusers/models/controlnetxs.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/models/controlnetxs.py Co-authored-by: Patrick von Platen <[email protected]> * Incorporated review feedback * Update docs/source/en/api/pipelines/controlnetxs_sdxl.md Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/api/pipelines/controlnetxs.md Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/api/pipelines/controlnetxs.md Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/api/pipelines/controlnetxs.md Co-authored-by: Steven Liu <[email protected]> * Update src/diffusers/models/controlnetxs.py Co-authored-by: Steven Liu <[email protected]> * Update src/diffusers/models/controlnetxs.py Co-authored-by: Steven Liu <[email protected]> * Update src/diffusers/pipelines/controlnet_xs/pipeline_controlnet_xs.py Co-authored-by: Steven Liu <[email protected]> * Update docs/source/en/api/pipelines/controlnetxs.md Co-authored-by: Steven Liu <[email protected]> * Update src/diffusers/pipelines/controlnet_xs/pipeline_controlnet_xs_sd_xl.py Co-authored-by: Steven Liu <[email protected]> * Incorporated doc feedback --------- Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Steven Liu <[email protected]> Co-authored-by: Dhruv Nair <[email protected]>
1 parent a7c08a6 commit a61bb6b

File tree

9 files changed

+3171
-0
lines changed

9 files changed

+3171
-0
lines changed

__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"AutoencoderTiny",
8181
"ConsistencyDecoderVAE",
8282
"ControlNetModel",
83+
"ControlNetXSModel",
8384
"Kandinsky3UNet",
8485
"ModelMixin",
8586
"MotionAdapter",
@@ -250,6 +251,7 @@
250251
"StableDiffusionControlNetImg2ImgPipeline",
251252
"StableDiffusionControlNetInpaintPipeline",
252253
"StableDiffusionControlNetPipeline",
254+
"StableDiffusionControlNetXSPipeline",
253255
"StableDiffusionDepth2ImgPipeline",
254256
"StableDiffusionDiffEditPipeline",
255257
"StableDiffusionGLIGENPipeline",
@@ -273,6 +275,7 @@
273275
"StableDiffusionXLControlNetImg2ImgPipeline",
274276
"StableDiffusionXLControlNetInpaintPipeline",
275277
"StableDiffusionXLControlNetPipeline",
278+
"StableDiffusionXLControlNetXSPipeline",
276279
"StableDiffusionXLImg2ImgPipeline",
277280
"StableDiffusionXLInpaintPipeline",
278281
"StableDiffusionXLInstructPix2PixPipeline",
@@ -454,6 +457,7 @@
454457
AutoencoderTiny,
455458
ConsistencyDecoderVAE,
456459
ControlNetModel,
460+
ControlNetXSModel,
457461
Kandinsky3UNet,
458462
ModelMixin,
459463
MotionAdapter,
@@ -603,6 +607,7 @@
603607
StableDiffusionControlNetImg2ImgPipeline,
604608
StableDiffusionControlNetInpaintPipeline,
605609
StableDiffusionControlNetPipeline,
610+
StableDiffusionControlNetXSPipeline,
606611
StableDiffusionDepth2ImgPipeline,
607612
StableDiffusionDiffEditPipeline,
608613
StableDiffusionGLIGENPipeline,
@@ -626,6 +631,7 @@
626631
StableDiffusionXLControlNetImg2ImgPipeline,
627632
StableDiffusionXLControlNetInpaintPipeline,
628633
StableDiffusionXLControlNetPipeline,
634+
StableDiffusionXLControlNetXSPipeline,
629635
StableDiffusionXLImg2ImgPipeline,
630636
StableDiffusionXLInpaintPipeline,
631637
StableDiffusionXLInstructPix2PixPipeline,

models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
_import_structure["autoencoder_tiny"] = ["AutoencoderTiny"]
3333
_import_structure["consistency_decoder_vae"] = ["ConsistencyDecoderVAE"]
3434
_import_structure["controlnet"] = ["ControlNetModel"]
35+
_import_structure["controlnetxs"] = ["ControlNetXSModel"]
3536
_import_structure["dual_transformer_2d"] = ["DualTransformer2DModel"]
3637
_import_structure["embeddings"] = ["ImageProjection"]
3738
_import_structure["modeling_utils"] = ["ModelMixin"]
@@ -63,6 +64,7 @@
6364
from .autoencoder_tiny import AutoencoderTiny
6465
from .consistency_decoder_vae import ConsistencyDecoderVAE
6566
from .controlnet import ControlNetModel
67+
from .controlnetxs import ControlNetXSModel
6668
from .dual_transformer_2d import DualTransformer2DModel
6769
from .embeddings import ImageProjection
6870
from .modeling_utils import ModelMixin

0 commit comments

Comments
 (0)