text
stringlengths
0
5.54k
The direct output from the learned diffusion model. timestep (int) β€”
The current discrete timestep in the diffusion chain. prev_timestep (int) β€”
The previous discrete timestep in the diffusion chain. sample (torch.FloatTensor) β€”
A current instance of a sample created by the diffusion process. Returns
torch.FloatTensor
The sample tensor at the previous timestep.
One step for the first-order DPMSolver (equivalent to DDIM). get_order_list < source > ( num_inference_steps: int ) Parameters num_inference_steps (int) β€”
The number of diffusion steps used when generating samples with a pre-trained model. Computes the solver order at each time step. scale_model_input < source > ( sample: FloatTensor *args **kwargs ) β†’ torch.FloatTensor Parameters sample (torch.FloatTensor) β€”
The input sample. Returns
torch.FloatTensor
A scaled input sample.
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep. set_timesteps < source > ( num_inference_steps: int device: Union = None ) Parameters num_inference_steps (int) β€”
The number of diffusion steps used when generating samples with a pre-trained model. device (str or torch.device, optional) β€”
The device to which the timesteps should be moved to. If None, the timesteps are not moved. Sets the discrete timesteps used for the diffusion chain (to be run before inference). singlestep_dpm_solver_second_order_update < source > ( model_output_list: List *args sample: FloatTensor = None **kwargs ) β†’ torch.Floa...
The direct outputs from learned diffusion model at current and latter timesteps. timestep (int) β€”
The current and latter discrete timestep in the diffusion chain. prev_timestep (int) β€”
The previous discrete timestep in the diffusion chain. sample (torch.FloatTensor) β€”
A current instance of a sample created by the diffusion process. Returns
torch.FloatTensor
The sample tensor at the previous timestep.
One step for the second-order singlestep DPMSolver that computes the solution at time prev_timestep from the
time timestep_list[-2]. singlestep_dpm_solver_third_order_update < source > ( model_output_list: List *args sample: FloatTensor = None **kwargs ) β†’ torch.FloatTensor Parameters model_output_list (List[torch.FloatTensor]) β€”
The direct outputs from learned diffusion model at current and latter timesteps. timestep (int) β€”
The current and latter discrete timestep in the diffusion chain. prev_timestep (int) β€”
The previous discrete timestep in the diffusion chain. sample (torch.FloatTensor) β€”
A current instance of a sample created by diffusion process. Returns
torch.FloatTensor
The sample tensor at the previous timestep.
One step for the third-order singlestep DPMSolver that computes the solution at time prev_timestep from the
time timestep_list[-3]. singlestep_dpm_solver_update < source > ( model_output_list: List *args sample: FloatTensor = None order: int = None **kwargs ) β†’ torch.FloatTensor Parameters model_output_list (List[torch.FloatTensor]) β€”
The direct outputs from learned diffusion model at current and latter timesteps. timestep (int) β€”
The current and latter discrete timestep in the diffusion chain. prev_timestep (int) β€”
The previous discrete timestep in the diffusion chain. sample (torch.FloatTensor) β€”
A current instance of a sample created by diffusion process. order (int) β€”
The solver order at this step. Returns
torch.FloatTensor
The sample tensor at the previous timestep.
One step for the singlestep DPMSolver. step < source > ( model_output: FloatTensor timestep: int sample: FloatTensor return_dict: bool = True ) β†’ SchedulerOutput or tuple Parameters model_output (torch.FloatTensor) β€”
The direct output from learned diffusion model. timestep (int) β€”
The current discrete timestep in the diffusion chain. sample (torch.FloatTensor) β€”
A current instance of a sample created by the diffusion process. return_dict (bool) β€”
Whether or not to return a SchedulerOutput or tuple. Returns
SchedulerOutput or tuple
If return_dict is True, SchedulerOutput is returned, otherwise a
tuple is returned where the first element is the sample tensor.
Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with
the singlestep DPMSolver. SchedulerOutput class diffusers.schedulers.scheduling_utils.SchedulerOutput < source > ( prev_sample: FloatTensor ) Parameters prev_sample (torch.FloatTensor of shape (batch_size, num_channels, height, width) for images) β€”
Computed sample (x_{t-1}) of previous timestep. prev_sample should be used as next model input in the
denoising loop. Base class for the output of a scheduler’s step function.
unCLIP Hierarchical Text-Conditional Image Generation with CLIP Latents is by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen. The unCLIP model in πŸ€— Diffusers comes from kakaobrain’s karlo. The abstract from the paper is following: Contrastive models like CLIP have been shown to learn robust repres...
Frozen text-encoder. tokenizer (CLIPTokenizer) β€”
A CLIPTokenizer to tokenize text. prior (PriorTransformer) β€”
The canonical unCLIP prior to approximate the image embedding from the text embedding. text_proj (UnCLIPTextProjModel) β€”
Utility class to prepare and combine the embeddings before they are passed to the decoder. decoder (UNet2DConditionModel) β€”
The decoder to invert the image embedding into an image. super_res_first (UNet2DModel) β€”
Super resolution UNet. Used in all but the last step of the super resolution diffusion process. super_res_last (UNet2DModel) β€”
Super resolution UNet. Used in the last step of the super resolution diffusion process. prior_scheduler (UnCLIPScheduler) β€”
Scheduler used in the prior denoising process (a modified DDPMScheduler). decoder_scheduler (UnCLIPScheduler) β€”
Scheduler used in the decoder denoising process (a modified DDPMScheduler). super_res_scheduler (UnCLIPScheduler) β€”
Scheduler used in the super resolution denoising process (a modified DDPMScheduler). Pipeline for text-to-image generation using unCLIP. This model inherits from DiffusionPipeline. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.). __call__ < source > ( prompt: Union = None num_images_per_prompt: int = 1 prior_num_inference_steps: int = 25 decoder_num_inference_steps: int = 25 super_res_num_inference_steps: int = 7 generator: Union = None prior_latents: O...
The prompt or prompts to guide image generation. This can only be left undefined if text_model_output
and text_attention_mask is passed. num_images_per_prompt (int, optional, defaults to 1) β€”
The number of images to generate per prompt. prior_num_inference_steps (int, optional, defaults to 25) β€”
The number of denoising steps for the prior. More denoising steps usually lead to a higher quality
image at the expense of slower inference. decoder_num_inference_steps (int, optional, defaults to 25) β€”
The number of denoising steps for the decoder. More denoising steps usually lead to a higher quality
image at the expense of slower inference. super_res_num_inference_steps (int, optional, defaults to 7) β€”
The number of denoising steps for super resolution. More denoising steps usually lead to a higher
quality image at the expense of slower inference. generator (torch.Generator or List[torch.Generator], optional) β€”
A torch.Generator to make
generation deterministic. prior_latents (torch.FloatTensor of shape (batch size, embeddings dimension), optional) β€”
Pre-generated noisy latents to be used as inputs for the prior. decoder_latents (torch.FloatTensor of shape (batch size, channels, height, width), optional) β€”
Pre-generated noisy latents to be used as inputs for the decoder. super_res_latents (torch.FloatTensor of shape (batch size, channels, super res height, super res width), optional) β€”
Pre-generated noisy latents to be used as inputs for the decoder. prior_guidance_scale (float, optional, defaults to 4.0) β€”
A higher guidance scale value encourages the model to generate images closely linked to the text
prompt at the expense of lower image quality. Guidance scale is enabled when guidance_scale > 1. decoder_guidance_scale (float, optional, defaults to 4.0) β€”
A higher guidance scale value encourages the model to generate images closely linked to the text
prompt at the expense of lower image quality. Guidance scale is enabled when guidance_scale > 1. text_model_output (CLIPTextModelOutput, optional) β€”
Pre-defined CLIPTextModel outputs that can be derived from the text encoder. Pre-defined text
outputs can be passed for tasks like text embedding interpolations. Make sure to also pass
text_attention_mask in this case. prompt can the be left None. text_attention_mask (torch.Tensor, optional) β€”
Pre-defined CLIP text attention mask that can be derived from the tokenizer. Pre-defined text attention
masks are necessary when passing text_model_output. output_type (str, optional, defaults to "pil") β€”
The output format of the generated image. Choose between PIL.Image or np.array. return_dict (bool, optional, defaults to True) β€”
Whether or not to return a ImagePipelineOutput instead of a plain tuple. Returns
ImagePipelineOutput or tuple
If return_dict is True, ImagePipelineOutput is returned, otherwise a tuple is
returned where the first element is a list with the generated images.
The call function to the pipeline for generation. UnCLIPImageVariationPipeline class diffusers.UnCLIPImageVariationPipeline < source > ( decoder: UNet2DConditionModel text_encoder: CLIPTextModelWithProjection tokenizer: CLIPTokenizer text_proj: UnCLIPTextProjModel feature_extractor: CLIPImageProcessor image_encode...
Frozen text-encoder. tokenizer (CLIPTokenizer) β€”
A CLIPTokenizer to tokenize text. feature_extractor (CLIPImageProcessor) β€”