Shortcuts

mmagic.apis.inferencers.controlnet_animation_inferencer

Module Contents

Classes

ControlnetAnimationInferencer

Base inferencer.

Functions

load_image(→ PIL.Image.Image)

Args:

Attributes

VIDEO_EXTENSIONS

IMAGE_EXTENSIONS

mmagic.apis.inferencers.controlnet_animation_inferencer.VIDEO_EXTENSIONS = ('.mp4', '.mov', '.avi')[source]
mmagic.apis.inferencers.controlnet_animation_inferencer.IMAGE_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.JPG', '.JPEG', '.PNG')[source]
mmagic.apis.inferencers.controlnet_animation_inferencer.load_image(image: Union[str, PIL.Image.Image]) PIL.Image.Image[source]

Args: Loads image to a PIL Image.

image (str or PIL.Image.Image):

The image to convert to the PIL Image format.

Returns

A PIL Image.

Return type

PIL.Image.Image

class mmagic.apis.inferencers.controlnet_animation_inferencer.ControlnetAnimationInferencer(config: Union[mmagic.utils.ConfigType, str], device: Optional[str] = None, extra_parameters: Optional[Dict] = None, dtype=torch.float32, **kwargs)[source]

Bases: mmagic.apis.inferencers.base_mmagic_inferencer.BaseMMagicInferencer

Base inferencer.

Parameters
  • config (str or ConfigType) – Model config or the path to it.

  • ckpt (str, optional) – Path to the checkpoint.

  • device (str, optional) – Device to run inference. If None, the best device will be automatically used.

  • result_out_dir (str) – Output directory of images. Defaults to ‘’.

func_kwargs[source]
func_order[source]
extra_parameters[source]
__call__(prompt=None, video=None, negative_prompt=None, controlnet_conditioning_scale=0.7, image_width=512, image_height=512, save_path=None, strength=0.75, num_inference_steps=20, seed=1, output_fps=None, reference_img=None, **kwargs) Union[Dict, List[Dict]][source]

Call the inferencer.

Parameters

kwargs – Keyword arguments for the inferencer.

Returns

Results of inference pipeline.

Return type

Union[Dict, List[Dict]]

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.