Shortcuts

mmagic.apis.inferencers.diffusers_pipeline_inferencer

Module Contents

Classes

DiffusersPipelineInferencer

inferencer that predicts with text2image models.

class mmagic.apis.inferencers.diffusers_pipeline_inferencer.DiffusersPipelineInferencer(config: Union[mmagic.utils.ConfigType, str], ckpt: Optional[str], device: Optional[str] = None, extra_parameters: Optional[Dict] = None, seed: int = 2022, **kwargs)[源代码]

Bases: mmagic.apis.inferencers.base_mmagic_inferencer.BaseMMagicInferencer

inferencer that predicts with text2image models.

func_kwargs[源代码]
preprocess(text: mmagic.apis.inferencers.base_mmagic_inferencer.InputsType = None, negative_prompt: mmagic.apis.inferencers.base_mmagic_inferencer.InputsType = None, num_inference_steps: int = 20, height=None, width=None) Dict[源代码]

Process the inputs into a model-feedable format.

参数
  • text (InputsType) – text input for text-to-image model.

  • negative_prompt (InputsType) – negative prompt.

返回

Results of preprocess.

返回类型

result(Dict)

forward(inputs: mmagic.apis.inferencers.base_mmagic_inferencer.InputsType) mmagic.apis.inferencers.base_mmagic_inferencer.PredType[源代码]

Forward the inputs to the model.

visualize(preds: mmagic.apis.inferencers.base_mmagic_inferencer.PredType, result_out_dir: str = None) List[numpy.ndarray][源代码]

Visualize predictions.

参数
  • preds (List[Union[str, np.ndarray]]) – Forward results by the inferencer.

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

返回

Result of visualize

返回类型

List[np.ndarray]

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.