Buckets:
K-Diffusion
k-diffusion is a popular library created by Katherine Crowson. We provide StableDiffusionKDiffusionPipeline and StableDiffusionXLKDiffusionPipeline that allow you to run Stable DIffusion with samplers from k-diffusion.
Note that most the samplers from k-diffusion are implemented in Diffusers and we recommend using existing schedulers. You can find a mapping between k-diffusion samplers and schedulers in Diffusers here
StableDiffusionKDiffusionPipeline[[diffusers.StableDiffusionKDiffusionPipeline]]
class diffusers.StableDiffusionKDiffusionPipelinediffusers.StableDiffusionKDiffusionPipeline
- text_encoder (
CLIPTextModel) -- Frozen text-encoder. Stable Diffusion uses the text portion of CLIP, specifically the clip-vit-large-patch14 variant. - tokenizer (
CLIPTokenizer) -- Tokenizer of class CLIPTokenizer. - unet (UNet2DConditionModel) -- Conditional U-Net architecture to denoise the encoded image latents.
- scheduler (SchedulerMixin) --
A scheduler to be used in combination with
unetto denoise the encoded image latents. Can be one of DDIMScheduler, LMSDiscreteScheduler, or PNDMScheduler. - safety_checker (
StableDiffusionSafetyChecker) -- Classification module that estimates whether generated images could be considered offensive or harmful. Please, refer to the model card for details. - feature_extractor (
CLIPImageProcessor) -- Model that extracts features from generated images to be used as inputs for thesafety_checker.0
Pipeline for text-to-image generation using Stable Diffusion.
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.)
The pipeline also inherits the following loading methods:
- load_textual_inversion() for loading textual inversion embeddings
- load_lora_weights() for loading LoRA weights
- save_lora_weights() for saving LoRA weights
> This is an experimental pipeline and is likely to change in the future.
encode_promptdiffusers.StableDiffusionKDiffusionPipeline.encode_promptstr or List[str], optional) --
prompt to be encoded
- device -- (
torch.device): torch device - num_images_per_prompt (
int) -- number of images that should be generated per prompt - do_classifier_free_guidance (
bool) -- whether to use classifier free guidance or not - negative_prompt (
strorList[str], optional) -- The prompt or prompts not to guide the image generation. If not defined, one has to passnegative_prompt_embedsinstead. Ignored when not using guidance (i.e., ignored ifguidance_scaleis less than1). - prompt_embeds (
torch.Tensor, 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 frompromptinput argument. - negative_prompt_embeds (
torch.Tensor, 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 fromnegative_promptinput argument. - lora_scale (
float, optional) -- A LoRA scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded. - clip_skip (
int, optional) -- Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that the output of the pre-final layer will be used for computing the prompt embeddings.0
Encodes the prompt into text encoder hidden states.
StableDiffusionXLKDiffusionPipeline[[diffusers.StableDiffusionXLKDiffusionPipeline]]
class diffusers.StableDiffusionXLKDiffusionPipelinediffusers.StableDiffusionXLKDiffusionPipeline
encode_promptdiffusers.StableDiffusionXLKDiffusionPipeline.encode_promptstr or List[str], optional) --
prompt to be encoded
- prompt_2 (
strorList[str], optional) -- The prompt or prompts to be sent to thetokenizer_2andtext_encoder_2. If not defined,promptis used in both text-encoders - device -- (
torch.device): torch device - num_images_per_prompt (
int) -- number of images that should be generated per prompt - do_classifier_free_guidance (
bool) -- whether to use classifier free guidance or not - negative_prompt (
strorList[str], optional) -- The prompt or prompts not to guide the image generation. If not defined, one has to passnegative_prompt_embedsinstead. Ignored when not using guidance (i.e., ignored ifguidance_scaleis less than1). - negative_prompt_2 (
strorList[str], optional) -- The prompt or prompts not to guide the image generation to be sent totokenizer_2andtext_encoder_2. If not defined,negative_promptis used in both text-encoders - prompt_embeds (
torch.Tensor, 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 frompromptinput argument. - negative_prompt_embeds (
torch.Tensor, 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 fromnegative_promptinput argument. - pooled_prompt_embeds (
torch.Tensor, 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 frompromptinput argument. - negative_pooled_prompt_embeds (
torch.Tensor, optional) -- Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. If not provided, pooled negative_prompt_embeds will be generated fromnegative_promptinput argument. - lora_scale (
float, optional) -- A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded. - clip_skip (
int, optional) -- Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that the output of the pre-final layer will be used for computing the prompt embeddings.0
Encodes the prompt into text encoder hidden states.
Xet Storage Details
- Size:
- 12.1 kB
- Xet hash:
- ac166486a05ff1dedd045b7c4a318336f217bf98683b56a084917564c153dc1d
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.