Shortcuts

mmagic.models.editors.controlnet.controlnet_utils

Module Contents

Functions

change_base_model(→ torch.nn.Module)

This function is used to change the base model of ControlNet. Refers to

mmagic.models.editors.controlnet.controlnet_utils.change_base_model(controlnet: torch.nn.Module, curr_model: torch.nn.Module, base_model: torch.nn.Module, save_path: Optional[str] = None, *args, **kwargs) torch.nn.Module[source]

This function is used to change the base model of ControlNet. Refers to https://github.com/lllyasviel/ControlNet/blob/main/tool_transfer_control.py .

# noqa.

Parameters
  • controlnet (nn.Module) – The model for ControlNet to convert.

  • curr_model (nn.Module) – The model of current Stable Diffusion’s Unet.

  • base_model (nn.Module) – The model of Stable Diffusion’s Unet which ControlNet initialized with.

  • save_path (str, optional) – The path to save the converted model. Defaults to None.

  • *args – Arguments for save_checkpoint.

  • **kwargs

    Arguments for save_checkpoint.

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.