File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,7 +139,11 @@ def _get_submodels_for_export_diffusion(
139139 # https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L571
140140 unet .config .requires_aesthetics_score = getattr (pipeline .config , "requires_aesthetics_score" , False )
141141 unet .config .time_cond_proj_dim = getattr (pipeline .unet .config , "time_cond_proj_dim" , None )
142- unet .config .text_encoder_projection_dim = pipeline .text_encoder .config .projection_dim
142+ unet .config .text_encoder_projection_dim = (
143+ pipeline .text_encoder .config .projection_dim
144+ if not is_sdxl
145+ else pipeline .text_encoder_2 .config .projection_dim
146+ )
143147 unet .config .export_model_type = _get_diffusers_submodel_type (unet )
144148 models_for_export ["unet" ] = unet
145149
You can’t perform that action at this time.
0 commit comments