Skip to content

Conversation

akiseakusa
Copy link
Contributor

Draft PR Description:

This PR (#12221) is a draft aimed at adding support for DiffSynth Blockwise ControlNet in diffusers.
References / Useful Links:

Model implementation & weights: Canny ControlNet

Model implementation & weights: Depth ControlNet

The PR is open for feedback, testing, and further adjustments from the community.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR!
I left some comments, it seems that it would work with our existing contorlnet with minimum changes, is this the case?

@@ -25,7 +25,11 @@
_import_structure["modeling_qwenimage"] = ["ReduxImageEncoder"]
_import_structure["pipeline_qwenimage"] = ["QwenImagePipeline"]
_import_structure["pipeline_qwenimage_controlnet"] = ["QwenImageControlNetPipeline"]
<<<<<<< Updated upstream
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove these?

_import_structure["pipeline_qwenimage_controlnet_inpaint"] = ["QwenImageControlNetInpaintPipeline"]
=======
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=======

_import_structure["pipeline_qwenimage_controlnet_inpaint"] = ["QwenImageControlNetInpaintPipeline"]
=======
_import_structure["pipeline_qwenimage_block_controlnet"] = ["QwenImageBlockControlNetPipeline"]
>>>>>>> Stashed changes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>>>>>>> Stashed changes


@torch.no_grad()
@replace_example_docstring(EXAMPLE_DOC_STRING)
def __call__(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem same at first, but controlnet is different, with some parameter and scheduler changes.

@@ -1068,3 +1068,4 @@ def forward(
z = posterior.mode()
dec = self.decode(z, return_dict=return_dict)
return dec

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

controlnet_block_samples: Tuple[torch.Tensor]


class BlockWiseControlBlock(torch.nn.Module):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the only difference between Diffsynth & instantX controlnet, can we just add the change to the existing one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants