
    +h                     f   S SK Jr  SSKJrJrJr  SSKJrJrJ	r	  S r
\	" 5       (       a  S r0 r\" 5       (       aD  S/\S'   S	/\S
'   S/\S'   S/\S'   S/\S'   \	" 5       (       a  S/\S'   / SQ\S'   S/\S'   / SQ\S'   S/\S'   \(       d  \(       a}  \" 5       (       aj  SSKJr  SSKJr  SSKJr  SSKJr  SS KJr  \	" 5       (       a@  SS!KJrJrJrJr  SS"KJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-  SS#K.J/r/  SS$K0J1r1  SS%K2J3r3  g&S S&K4r4\" \5\6" 5       S'   \\7S(9\4Rp                  \5'   g&))    )TYPE_CHECKING   )DIFFUSERS_SLOW_IMPORT_LazyModule	deprecate)is_peft_availableis_torch_availableis_transformers_availablec                 p   [        SSS5        0 n[        U 5       GH  u  p#UR                  R                  R	                  5       R                  5        H  u  pEXQU SU 3'   M     UR                  R                  R	                  5       R                  5        H  u  pEXQU SU 3'   M     UR                  R                  R	                  5       R                  5        H  u  pEXQU SU 3'   M     UR                  R                  R	                  5       R                  5        H  u  pEXQU SU 3'   M     GM     U$ )Nz(text_encoder_load_state_dict in `models`0.27.0`text_encoder_lora_state_dict` is deprecated and will be removed in 0.27.0. Make sure to retrieve the weights using `get_peft_model`. See https://huggingface.co/docs/peft/v0.6.2/en/quicktour#peftmodel for more information.z.q_proj.lora_linear_layer.z.k_proj.lora_linear_layer.z.v_proj.lora_linear_layer.z.out_proj.lora_linear_layer.)	r   text_encoder_attn_modulesq_projlora_linear_layer
state_dictitemsk_projv_projout_proj)text_encoderr   namemodulekvs         T/home/james-whalen/.local/lib/python3.13/site-packages/diffusers/loaders/__init__.pytext_encoder_lora_state_dictr      s1   2 	i
 J1,?MM33>>@FFHDAAB$9!=> I MM33>>@FFHDAAB$9!=> I MM33>>@FFHDAAB$9!=> I OO55@@BHHJDACD$;A3?@ K @     c                 H   [        SSS5        SSKJnJn  / n[	        XU45      (       aX  [        U R                  R                  R                  5       H)  u  pESU S3nUR                  nUR                  Xg45        M+     U$ [        SU R                  R                   35      e)	Nz%text_encoder_attn_modules in `models`r   r   r   )CLIPTextModelCLIPTextModelWithProjectionztext_model.encoder.layers.z
.self_attnz.do not know how to get attention modules for: )r   transformersr   r    
isinstance	enumerate
text_modelencoderlayers	self_attnappend
ValueError	__class____name__)r   r   r    attn_modulesilayerr   mods           r   r   r   !   s    3 m	

 	Ll4O$PQQ%l&=&=&E&E&L&LM3A3jAoo##TK0 N  MlNdNdNmNmMnoppr   FromOriginalModelMixinsingle_file_modelFluxTransformer2DLoadersMixintransformer_fluxSD3Transformer2DLoadersMixintransformer_sd3UNet2DConditionLoadersMixinunetAttnProcsLayersutilsFromSingleFileMixinsingle_file)AmusedLoraLoaderMixinStableDiffusionLoraLoaderMixinSD3LoraLoaderMixinAuraFlowLoraLoaderMixin StableDiffusionXLLoraLoaderMixinLTXVideoLoraLoaderMixinLoraLoaderMixinFluxLoraLoaderMixinCogVideoXLoraLoaderMixinCogView4LoraLoaderMixinMochi1LoraLoaderMixinHunyuanVideoLoraLoaderMixinSanaLoraLoaderMixinLumina2LoraLoaderMixinWanLoraLoaderMixinHiDreamImageLoraLoaderMixinSkyReelsV2LoraLoaderMixinQwenImageLoraLoaderMixinlora_pipelineTextualInversionLoaderMixintextual_inversion)IPAdapterMixinFluxIPAdapterMixinSD3IPAdapterMixinModularIPAdapterMixin
ip_adapterPeftAdapterMixinpeft   )r0   )r2   )r4   )r6   )r8   )rR   rQ   rT   rS   )r<   r?   rD   rE   rC   rK   rG   rB   rA   rI   rF   rM   rH   r>   rL   r=   r@   rJ   )r:   )rO   )rV   N__file__)module_spec)9typingr   r9   r   r   r   utils.import_utilsr   r	   r
   r   r   _import_structurer1   r0   r3   r2   r5   r4   r7   r6   r8   rU   rR   rQ   rT   rS   rN   r<   r?   rD   rE   rC   rK   rG   rB   rA   rI   rF   rM   rH   r>   rL   r=   r@   rJ   r;   r:   rP   rO   rW   rV   sysr+   globals__spec__modules r   r   <module>rc      sR     A A a a0 *  .F-G)*-L,M(),J+K'(!> ?f"3!4g "",A+B-(.
/*( 3P1P-.+
,' 00 &  )=CA5*$&&     ( 9F&'')J2GIZhpqCKKr   