text
stringlengths
0
5.54k
**kwargs
)
Call self as a function.
StableDiffusionPipelineSafe
class diffusers.StableDiffusionPipelineSafe
<
source
>
(
vae: AutoencoderKL
text_encoder: CLIPTextModel
tokenizer: CLIPTokenizer
unet: UNet2DConditionModel
scheduler: KarrasDiffusionSchedulers
safety_checker: SafeStableDiffusionSafetyChecker
feature_extractor: CLIPImageProcessor
requires_safety_checker: bool = True
)
Parameters
vae (AutoencoderKL) β€”
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
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 unet to 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 the safety_checker.
Pipeline for text-to-image generation using Safe Latent Diffusion.
The implementation is based on the StableDiffusionPipeline
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: typing.Union[str, typing.List[str]]
height: typing.Optional[int] = None
width: typing.Optional[int] = None
num_inference_steps: int = 50
guidance_scale: float = 7.5
negative_prompt: typing.Union[str, typing.List[str], NoneType] = None
num_images_per_prompt: typing.Optional[int] = 1
eta: float = 0.0
generator: typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None
latents: typing.Optional[torch.FloatTensor] = None
output_type: typing.Optional[str] = 'pil'
return_dict: bool = True
callback: typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None
callback_steps: int = 1
sld_guidance_scale: typing.Optional[float] = 1000
sld_warmup_steps: typing.Optional[int] = 10
sld_threshold: typing.Optional[float] = 0.01
sld_momentum_scale: typing.Optional[float] = 0.3
sld_mom_beta: typing.Optional[float] = 0.4
)
β†’
StableDiffusionPipelineOutput or tuple
Parameters