Diffusers documentation
SD3Transformer2D
Get started
Tutorials
OverviewUnderstanding pipelines, models and schedulersAutoPipelineTrain a diffusion modelLoad LoRAs for inferenceAccelerate inference of text-to-image diffusion modelsWorking with big models
Load pipelines and adapters
Load pipelinesLoad community pipelines and componentsLoad schedulers and modelsModel files and layoutsLoad adaptersPush files to the Hub
Generative tasks
Unconditional image generationText-to-imageImage-to-imageInpaintingText or image-to-videoDepth-to-image
Inference techniques
OverviewCreate a serverDistributed inferenceMerge LoRAsScheduler featuresPipeline callbacksReproducible pipelinesControlling image qualityPrompt techniques
Advanced inference
Specific pipeline examples
CogVideoXStable Diffusion XLSDXL TurboKandinskyIP-AdapterPAGControlNetT2I-AdapterLatent Consistency ModelTextual inversionShap-EDiffEditTrajectory Consistency Distillation-LoRAStable Video DiffusionMarigold Computer Vision
Training
Quantization Methods
Accelerate inference and reduce memory
Speed up inferenceReduce memory usagePyTorch 2.0xFormersToken mergingDeepCacheTGATExDiT
Optimized model formats
Optimized hardware
Conceptual Guides
PhilosophyControlled generationHow to contribute?Diffusers' Ethical GuidelinesEvaluating Diffusion Models
Community Projects
API
Main Classes
Loaders
Models
Pipelines
Schedulers
Internal classes
You are viewing v0.32.2 version. A newer version v0.38.0 is available.
SD3Transformer2D
This class is useful when only loading weights into a SD3Transformer2DModel. If you need to load weights into the text encoder or a text encoder and SD3Transformer2DModel, check SD3LoraLoaderMixin class instead.
The SD3Transformer2DLoadersMixin class currently only loads IP-Adapter weights, but will be used in the future to save weights and load LoRAs.
To learn more about how to load LoRA weights, see the LoRA loading guide.
SD3Transformer2DLoadersMixin
Load IP-Adapters and LoRA layers into a [SD3Transformer2DModel].
_load_ip_adapter_weights
< source >( state_dict: typing.Dict low_cpu_mem_usage: bool = True )
Parameters
- state_dict (
Dict) — State dict with keys “ip_adapter”, which contains parameters for attention processors, and “image_proj”, which contains parameters for image projection net. - low_cpu_mem_usage (
bool, optional, defaults toTrueif torch version >= 1.9.0 elseFalse) — Speed up model loading only loading the pretrained weights and not initializing the weights. This also tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model. Only supported for PyTorch >= 1.9.0. If you are using an older version of PyTorch, setting this argument toTruewill raise an error.
Sets IP-Adapter attention processors, image projection, and loads state_dict.