text stringlengths 0 5.54k |
|---|
the expense of slower inference. For more specific timestep spacing, you can pass customized |
timesteps decoder_guidance_scale (float, optional, defaults to 0.0) β |
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. generator (torch.Generator or List[torch.Generator], optional) β |
One or a list of torch generator(s) |
to make generation deterministic. latents (torch.FloatTensor, optional) β |
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image |
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents |
tensor will ge generated by sampling using the supplied random generator. output_type (str, optional, defaults to "pil") β |
The output format of the generate image. Choose between: "pil" (PIL.Image.Image), "np" |
(np.array) or "pt" (torch.Tensor). return_dict (bool, optional, defaults to True) β |
Whether or not to return a ImagePipelineOutput instead of a plain tuple. prior_callback_on_step_end (Callable, optional) β |
A function that calls at the end of each denoising steps during the inference. The function is called |
with the following arguments: prior_callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict). prior_callback_on_step_end_tensor_inputs (List, optional) β |
The list of tensor inputs for the prior_callback_on_step_end function. The tensors specified in the |
list will be passed as callback_kwargs argument. You will only be able to include variables listed in |
the ._callback_tensor_inputs attribute of your pipeine class. callback_on_step_end (Callable, optional) β |
A function that calls at the end of each denoising steps during the inference. The function is called |
with the following arguments: callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict). callback_kwargs will include a list of all tensors as specified by |
callback_on_step_end_tensor_inputs. callback_on_step_end_tensor_inputs (List, optional) β |
The list of tensor inputs for the callback_on_step_end function. The tensors specified in the list |
will be passed as callback_kwargs argument. You will only be able to include variables listed in the |
._callback_tensor_inputs attribute of your pipeine class. Function invoked when calling the pipeline for generation. Examples: Copied >>> from diffusions import StableCascadeCombinedPipeline |
>>> pipe = StableCascadeCombinedPipeline.from_pretrained("stabilityai/stable-cascade-combined", torch_dtype=torch.bfloat16).to( |
... "cuda" |
... ) |
>>> prompt = "an image of a shiba inu, donning a spacesuit and helmet" |
>>> images = pipe(prompt=prompt) enable_model_cpu_offload < source > ( gpu_id = 0 ) Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared |
to enable_sequential_cpu_offload, this method moves one whole model at a time to the GPU when its forward |
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with |
enable_sequential_cpu_offload, but performance is much better due to the iterative execution of the unet. enable_sequential_cpu_offload < source > ( gpu_id = 0 ) Offloads all models (unet, text_encoder, vae, and safety checker state dicts) to CPU using π€ |
Accelerate, significantly reducing memory usage. Models are moved to a torch.device('meta') and loaded on a |
GPU only when their specific submoduleβs forward method is called. Offloading happens on a submodule basis. |
Memory savings are higher than using enable_model_cpu_offload, but performance is lower. StableCascadePriorPipeline class diffusers.StableCascadePriorPipeline < source > ( tokenizer: CLIPTokenizer text_encoder: CLIPTextModelWithProjection prior: StableCascadeUNet scheduler: DDPMWuerstchenScheduler resolution_multipl... |
The Stable Cascade prior to approximate the image embedding from the text and/or image embedding. text_encoder (CLIPTextModelWithProjection) β |
Frozen text-encoder (laion/CLIP-ViT-bigG-14-laion2B-39B-b160k). feature_extractor (CLIPImageProcessor) β |
Model that extracts features from generated images to be used as inputs for the image_encoder. image_encoder (CLIPVisionModelWithProjection) β |
Frozen CLIP image-encoder (clip-vit-large-patch14). tokenizer (CLIPTokenizer) β |
Tokenizer of class |
CLIPTokenizer. scheduler (DDPMWuerstchenScheduler) β |
A scheduler to be used in combination with prior to generate image embedding. resolution_multiple (βfloatβ, optional, defaults to 42.67) β |
Default resolution for multiple images generated. Pipeline for generating image prior for Stable Cascade. This model inherits from DiffusionPipeline. Check the superclass documentation for the generic methods the |
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.) __call__ < source > ( prompt: Union = None images: Union = None height: int = 1024 width: int = 1024 num_inference_steps: int = 20 timesteps: List = None guidance_scale: float = 4.0 negative_prompt: Union = ... |
The prompt or prompts to guide the image generation. height (int, optional, defaults to 1024) β |
The height in pixels of the generated image. width (int, optional, defaults to 1024) β |
The width in pixels of the generated image. num_inference_steps (int, optional, defaults to 60) β |
The number of denoising steps. More denoising steps usually lead to a higher quality image at the |
expense of slower inference. guidance_scale (float, optional, defaults to 8.0) β |
Guidance scale as defined in Classifier-Free Diffusion Guidance. |
decoder_guidance_scale is defined as w of equation 2. of Imagen |
Paper. Guidance scale is enabled by setting |
decoder_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. Ignored when not using guidance (i.e., ignored |
if decoder_guidance_scale is less than 1). 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. prompt_embeds_pooled (torch.FloatTensor, optional) β |
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. |
If not provided, pooled 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. negative_prompt_embeds_pooled (torch.FloatTensor, optional) β |
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, e.g. prompt |
weighting. If not provided, negative_prompt_embeds_pooled will be generated from negative_prompt input |
argument. image_embeds (torch.FloatTensor, optional) β |
Pre-generated image embeddings. Can be used to easily tweak image inputs, e.g. prompt weighting. |
If not provided, image embeddings will be generated from image input argument if existing. num_images_per_prompt (int, optional, defaults to 1) β |
The number of images to generate per prompt. generator (torch.Generator or List[torch.Generator], optional) β |
One or a list of torch generator(s) |
to make generation deterministic. latents (torch.FloatTensor, optional) β |
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image |
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents |
tensor will ge generated by sampling using the supplied random generator. output_type (str, optional, defaults to "pil") β |
The output format of the generate image. Choose between: "pil" (PIL.Image.Image), "np" |
(np.array) or "pt" (torch.Tensor). return_dict (bool, optional, defaults to True) β |
Whether or not to return a ImagePipelineOutput instead of a plain tuple. callback_on_step_end (Callable, optional) β |
A function that calls at the end of each denoising steps during the inference. The function is called |
with the following arguments: callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict). callback_kwargs will include a list of all tensors as specified by |
callback_on_step_end_tensor_inputs. callback_on_step_end_tensor_inputs (List, optional) β |
The list of tensor inputs for the callback_on_step_end function. The tensors specified in the list |
will be passed as callback_kwargs argument. You will only be able to include variables listed in the |
._callback_tensor_inputs attribute of your pipeline class. Function invoked when calling the pipeline for generation. Examples: Copied >>> import torch |
>>> from diffusers import StableCascadePriorPipeline |
>>> prior_pipe = StableCascadePriorPipeline.from_pretrained( |
... "stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16 |
... ).to("cuda") |
>>> prompt = "an image of a shiba inu, donning a spacesuit and helmet" |
>>> prior_output = pipe(prompt) StableCascadePriorPipelineOutput class diffusers.pipelines.stable_cascade.pipeline_stable_cascade_prior.StableCascadePriorPipelineOutput < source > ( image_embeddings: Union prompt_embeds: Union negative_prompt_embeds: Union ) Parameters image_embeddings (torch.FloatTensor or np.... |
Prior image embeddings for text prompt prompt_embeds (torch.FloatTensor) β |
Text embeddings for the prompt. negative_prompt_embeds (torch.FloatTensor) β |
Text embeddings for the negative prompt. Output class for WuerstchenPriorPipeline. StableCascadeDecoderPipeline class diffusers.StableCascadeDecoderPipeline < source > ( decoder: StableCascadeUNet tokenizer: CLIPTokenizer text_encoder: CLIPTextModel scheduler: DDPMWuerstchenScheduler vqgan: PaellaVQModel latent_d... |
The CLIP tokenizer. text_encoder (CLIPTextModel) β |
The CLIP text encoder. decoder (StableCascadeUNet) β |
The Stable Cascade decoder unet. vqgan (PaellaVQModel) β |
The VQGAN model. scheduler (DDPMWuerstchenScheduler) β |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.