text
stringlengths 0
5.54k
|
---|
prompt (str or List[str], optional) β |
The prompt or prompts to guide the image generation. If not defined, one has to pass prompt_embeds. |
instead. |
image (torch.FloatTensor or PIL.Image.Image) β |
Image, or tensor representing an image batch, that will be used as the starting point for the |
process. |
strength (float, optional, defaults to 0.8) β |
Conceptually, indicates how much to transform the reference image. Must be between 0 and 1. image |
will be used as a starting point, adding more noise to it the larger the strength. The number of |
denoising steps depends on the amount of noise initially added. When strength is 1, added noise will |
be maximum and the denoising process will run for the full number of iterations specified in |
num_inference_steps. A value of 1, therefore, essentially ignores image. |
num_inference_steps (int, optional, defaults to 50) β |
The number of denoising steps. More denoising steps usually lead to a higher quality image at the |
expense of slower inference. This parameter will be modulated by strength. |
guidance_scale (float, optional, defaults to 7.5) β |
Guidance scale as defined in Classifier-Free Diffusion Guidance. |
guidance_scale is defined as w of equation 2. of Imagen |
Paper. Guidance scale is enabled by setting guidance_scale > 1. Higher guidance scale encourages to generate images that are closely linked to the text prompt, |
usually at the expense of lower image quality. |
negative_prompt (str or List[str], optional) β |
The prompt or prompts not to guide the image generation. If not defined, one has to pass |
negative_prompt_embeds. instead. Ignored when not using guidance (i.e., ignored if guidance_scale |
is less than 1). |
num_images_per_prompt (int, optional, defaults to 1) β |
The number of images to generate per prompt. |
eta (float, optional, defaults to 0.0) β |
Corresponds to parameter eta (Ξ·) in the DDIM paper: https://arxiv.org/abs/2010.02502. Only applies to |
schedulers.DDIMScheduler, will be ignored for others. |
generator (torch.Generator, optional) β |
One or a list of torch generator(s) |
to make generation deterministic. |
prompt_embeds (torch.FloatTensor, optional) β |
Pre-generated text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. If not |
provided, text embeddings will be generated from prompt input argument. |
negative_prompt_embeds (torch.FloatTensor, optional) β |
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, e.g. prompt |
weighting. If not provided, negative_prompt_embeds will be generated from negative_prompt input |
argument. |
output_type (str, optional, defaults to "pil") β |
The output format of the generate image. Choose between |
PIL: PIL.Image.Image or np.array. |
return_dict (bool, optional, defaults to True) β |
Whether or not to return a ~pipelines.stable_diffusion.AltDiffusionPipelineOutput instead of a |
plain tuple. |
callback (Callable, optional) β |
A function that will be called every callback_steps steps during inference. The function will be |
called with the following arguments: callback(step: int, timestep: int, latents: torch.FloatTensor). |
callback_steps (int, optional, defaults to 1) β |
The frequency at which the callback function will be called. If not specified, the callback will be |
called at every step. |
Returns |
~pipelines.stable_diffusion.AltDiffusionPipelineOutput or tuple |
~pipelines.stable_diffusion.AltDiffusionPipelineOutput if return_dict is True, otherwise a tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of bools denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the safety_checker`. |
Function invoked when calling the pipeline for generation. |
Examples: |
Copied |
>>> import requests |
>>> import torch |
>>> from PIL import Image |
Subsets and Splits