
    
3js                         S SK Jr  S SKrS SKJr  SSKJrJr  SSKJ	r	J
r
Jr  SSKJr  SSKJrJrJrJr  SSKJr  SS	KJr  SS
KJr  \R2                  " \5      r " S S\R8                  5      r " S S5      rg)    )CallableN   )BasicTransformerBlockFreeNoiseTransformerBlock)Downsample2DResnetBlock2D
Upsample2D)Transformer2DModel)AnimateDiffTransformer3DCrossAttnDownBlockMotionDownBlockMotionUpBlockMotion)DiffusionPipeline)logging)randn_tensorc                      ^  \ rS rSrSrSSS/4S\R                  S\S\S	\\	   S
S4
U 4S jjjr
S
\R                  \\R                     -  4S jrSrU =r$ )SplitInferenceModule%   a  
A wrapper module class that splits inputs along a specified dimension before performing a forward pass.

This module is useful when you need to perform inference on large tensors in a memory-efficient way by breaking
them into smaller chunks, processing each chunk separately, and then reassembling the results.

Args:
    module (`nn.Module`):
        The underlying PyTorch module that will be applied to each chunk of split inputs.
    split_size (`int`, defaults to `1`):
        The size of each chunk after splitting the input tensor.
    split_dim (`int`, defaults to `0`):
        The dimension along which the input tensors are split.
    input_kwargs_to_split (`list[str]`, defaults to `["hidden_states"]`):
        A list of keyword arguments (strings) that represent the input tensors to be split.

Workflow:
    1. The keyword arguments specified in `input_kwargs_to_split` are split into smaller chunks using
    `torch.split()` along the dimension `split_dim` and with a chunk size of `split_size`.
    2. The `module` is invoked once for each split with both the split inputs and any unchanged arguments
    that were passed.
    3. The output tensors from each split are concatenated back together along `split_dim` before returning.

Example:
    ```python
    >>> import torch
    >>> import torch.nn as nn

    >>> model = nn.Linear(1000, 1000)
    >>> split_module = SplitInferenceModule(model, split_size=2, split_dim=0, input_kwargs_to_split=["input"])

    >>> input_tensor = torch.randn(42, 1000)
    >>> # Will split the tensor into 21 slices of shape [2, 1000].
    >>> output = split_module(input=input_tensor)
    ```

It is also possible to nest `SplitInferenceModule` across different split dimensions for more complex
multi-dimensional splitting.
   r   hidden_statesmodule
split_size	split_diminput_kwargs_to_splitreturnNc                 f   > [         TU ]  5         Xl        X l        X0l        [        U5      U l        g )N)super__init__r   r   r   setr   )selfr   r   r   r   	__class__s        ^/home/wildlama/miniconda3/lib/python3.13/site-packages/diffusers/pipelines/free_noise_utils.pyr   SplitInferenceModule.__init__N   s-     	$"%()>%?"    c           
      \   0 n[        UR                  5       5       Hr  nX@R                  ;  d  [        R                  " X$   5      (       d  M1  [        R
                  " X$   U R                  U R                  5      X4'   UR                  U5        Mt     / n[        UR                  5       6  HZ  n[        [        UR                  5       U5      5      nUR                  U5        U R                  " U0 UD6nUR                  U5        M\     [        US   [        R                   5      (       a  [        R"                  " XPR                  S9$ [        US   [$        5      (       a>  [%        [        U6  V	s/ s H!  n	[        R"                  " XR                  S9PM#     sn	5      $ ['        S5      es  sn	f )a0  Forward method for the `SplitInferenceModule`.

This method processes the input by splitting specified keyword arguments along a given dimension, running the
underlying module on each split, and then concatenating the results. The splitting is controlled by the
`split_size` and `split_dim` parameters specified during initialization.

Args:
    *args (`Any`):
        Positional arguments that are passed directly to the `module` without modification.
    **kwargs (`dict[str, torch.Tensor]`):
        Keyword arguments passed to the underlying `module`. Only keyword arguments whose names match the
        entries in `input_kwargs_to_split` and are of type `torch.Tensor` will be split. The remaining keyword
        arguments are passed unchanged.

Returns:
    `torch.Tensor | tuple[torch.Tensor]`:
        The outputs obtained from `SplitInferenceModule` are the same as if the underlying module was inferred
        without it.
        - If the underlying module returns a single tensor, the result will be a single concatenated tensor
        along the same `split_dim` after processing all splits.
        - If the underlying module returns a tuple of tensors, each element of the tuple will be concatenated
        along the `split_dim` across all splits, and the final result will be a tuple of concatenated tensors.
r   dimzIn order to use the SplitInferenceModule, it is necessary for the underlying `module` to either return a torch.Tensor or a tuple of torch.Tensor's.)listkeysr   torch	is_tensorsplitr   r   popzipvaluesdictupdater   append
isinstanceTensorcattuple
ValueError)
r    argskwargssplit_inputskeyresultssplit_inputinputs#intermediate_tensor_or_tensor_tuplexs
             r"   forwardSplitInferenceModule.forward\   sN   0  &C444EOOFK<X<X %FK$.. YLJJsO	 '  3 3 56K#l//1;?@FMM&!26++t2Nv2N/NN>? 7 gaj%,,//99W..99
E**CMRMq%))A>>:MRSS f  Ss   /(F))r   r   r   r   )__name__
__module____qualname____firstlineno____doc__nnModuleintr(   strr   r*   r4   r6   rA   __static_attributes____classcell__)r!   s   @r"   r   r   %   s    &V ,;+<@		@ @ 	@
  $Cy@ 
@ @2%,,u||9L*L 2 2r$   r   c                   T   \ rS rSrSrS\\-  \-  4S jrS\\-  \-  4S jr	  S5S jr
     S6S	\\\\4   -  S
\S\R                  S\S\S\\\\4   -  S-  S\R"                  S-  S\R"                  S-  S\S-  S\S-  S\R"                  4S jjr  S7S\S\S
\S\S\S\R(                  S\R                  S\R*                  S-  S\R"                  S-  4S jjrS\S\S\R"                  S\R"                  S\R"                  4
S  jr     S8S!\S-  S"\S#\S$\S%\\\\\R"                  \R"                  /\R"                  4   S-  SS4S& jjrS5S' jrS(\\   S)\SS4S* jrS+\\   S,\SS4S- jr S.\\!   S,\SS4S/ jr"S0\\#   \\$   -  S,\SS4S1 jr%S9S)\S,\SS4S2 jjr&\'S3 5       r(S4r)g):AnimateDiffFreeNoiseMixin   zFMixin class for [FreeNoise](https://huggingface.co/papers/2310.15169).blockc                    UR                    GH  n[        UR                  5      n[        U5       GH  n[	        UR                  U   [
        5      (       a@  UR                  U   R                  U R                  U R                  U R                  5        Mf  [	        UR                  U   [        5      (       d   eUR                  U   n[        UR                  UR                  UR                  UR                  UR                  UR                   UR"                  UR$                  UR&                  UR(                  UR*                  U R                  U R                  U R                  S9R-                  U R.                  U R0                  S9UR                  U'   UR                  U   R3                  UR5                  5       SS9  UR                  U   R7                  UR8                  UR:                  5        GM     GM     g)z:Helper function to enable FreeNoise in transformer blocks.)r'   num_attention_headsattention_head_dimdropoutcross_attention_dimactivation_fnattention_biasonly_cross_attentiondouble_self_attentionpositional_embeddingsnum_positional_embeddingscontext_lengthcontext_strideweighting_schemedevicedtypeTstrictN)motion_moduleslentransformer_blocksranger3   r   set_free_noise_properties_free_noise_context_length_free_noise_context_stride_free_noise_weighting_schemer   r'   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   tora   rb   load_state_dict
state_dictset_chunk_feed_forward_chunk_size
_chunk_dim)r    rQ   motion_modulenum_transformer_blocksibasic_transfomer_blocks         r"   _enable_free_noise_in_block5AnimateDiffFreeNoiseMixin._enable_free_noise_in_block   s    #11M%()I)I%J"12m>>qAC\]]!44Q7QQ777799 &m&F&Fq&IK`aaaa-:-M-Ma-P*:S266,B,V,V+A+T+T 6 > >,B,V,V&<&J&J'='L'L-C-X-X.D.Z.Z.D.Z.Z2H2b2b'+'F'F'+'F'F)-)J)J; b4::b> "44Q7" "44Q7GG.99;D H  "44Q7NN.::<R<]<]? 3 2r$   c                    UR                    GHn  n[        UR                  5      n[        U5       GHE  n[	        UR                  U   [
        5      (       d  M(  UR                  U   n[        UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                   UR"                  S9R%                  U R&                  U R(                  S9UR                  U'   UR                  U   R+                  UR-                  5       SS9  UR                  U   R/                  UR0                  UR2                  5        GMH     GMq     g)z;Helper function to disable FreeNoise in transformer blocks.)r'   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r`   Trc   N)re   rf   rg   rh   r3   r   r   r'   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   rm   ra   rb   rn   ro   rp   rq   rr   )r    rQ   rs   rt   ru   free_noise_transfomer_blocks         r"   _disable_free_noise_in_block6AnimateDiffFreeNoiseMixin._disable_free_noise_in_block   sO    #11M%()I)I%J"12m>>qAC\]]2?2R2RST2U/:O7;;,G,[,[+F+Y+Y ; C C,G,[,[&A&O&O'B'Q'Q-H-]-].I._._.I._._2M2g2g; b4::b> "44Q7 "44Q7GG3>>@ H  "44Q7NN3??A\AgAg+ 3 2r$   r   Nc                    [        U[        [        45      (       d  [        S[	        U5      < 35      eUb3  [        U[        [        45      (       d  [        S[	        U5      < 35      eUc  Ub  [        S5      eUR                  5        Vs/ s H  n[        U[        5      PM     nnUR                  5        Vs/ s H  n[        U[        5      PM     nn[        [        UR                  5       5      5      n	[        [        UR                  5       5      5      n
[        U5      (       d  [        S5      e[        U5      (       d  [        S5      eU	S:w  a  [        S5      eX:  a  [        SU< S	35      eg s  snf s  snf )
NzFExpected `prompt` to have type `str` or `dict` but found type(prompt)=zXExpected `negative_prompt` to have type `str` or `dict` but found type(negative_prompt)=zO`prompt_embeds` and `negative_prompt_embeds` is not supported in FreeNoise yet.z5Expected integer keys in `prompt` dict for FreeNoise.z3Expected str values in `prompt` dict for FreeNoise.r   zUThe minimum frame index in `prompt` dict must be 0 as a starting prompt is necessary.zHThe maximum frame index in `prompt` dict must be lesser than num_frames=z and follow 0-based indexing.)r3   rK   r0   r7   typer)   rJ   r/   minr(   maxall)r    promptnegative_promptprompt_embedsnegative_prompt_embeds
num_framesr@   frame_indicesframe_prompts	min_frame	max_frames              r"   _check_inputs_free_noise2AnimateDiffFreeNoiseMixin._check_inputs_free_noise   s\    &3+..fY]^dYeXghii&oT{;; oY]^mYnXpq  $(>(Jnoo5;[[]C]As+]C5;]]_E_As+_EV[[]+,	V[[]+,	=!!TUU=!!RSS>tuu"[PZ}\yz  # DEs   E8;E=r   r   ra   num_videos_per_promptdo_classifier_free_guidancer   r   r   
lora_scale	clip_skipc                 ~   Uc  Sn[        U[        5      (       a  SU0n[        U[        5      (       a  SU0nU R                  XXxU5        [        [	        UR                  5       5      5      n[        [	        UR                  5       5      5      nU[        UR                  5       5      S      XS-
  '   U[        UR                  5       5      S      XbS-
  '   [        UR                  5       5      n[        UR                  5       5      n[        UR                  5       5      n[        UR                  5       5      nU R                  UUUSS S S U	U
S9	u  pU/UR                  SS  Q7nUR                  U5      n[        [        U5      S-
  5       HU  nUU   nUUS-      nUU   R                  S5      nUUS-      R                  S5      nU R                  UUUU5      UUUS-   & MW     S nS nU(       a  U R                  S/[        U5      -  UUSUS S U	U
S9	u  pUR                  U5      n[        [        U5      S-
  5       HU  nUU   nUUS-      nUU   R                  S5      nUUS-      R                  S5      nU R                  UUUU5      UUUS-   & MW     UnUnU(       a  [         R"                  " X/5      nXx4$ )N r   r   F)	r   ra   num_images_per_promptr   r   r   r   r   r   T)r3   rK   r   r0   sorteditemsr(   r)   r/   encode_promptshape	new_zerosrh   rf   	unsqueeze)_free_noise_prompt_interpolation_callbackr*   r5   )r    r   r   ra   r   r   r   r   r   r   r   r   r   frame_negative_indicesframe_negative_prompts_r   prompt_interpolation_embedsru   start_frame	end_framestart_tensor
end_tensor$negative_prompt_interpolation_embedss                           r"   _encode_prompt_free_noise3AnimateDiffFreeNoiseMixin._encode_prompt_free_noise   s    " O fc""[Fos++ /2O%%f}fpq fV\\^,-vo&;&;&=>? "(V[[](;B(?!@A~*9$?S?S?U:VWY:Z*[Q'V[[]+V]]_-!%o&:&:&<!=!%o&<&<&>!?  -- "7(- #'! . 

 6m11!"56&3&=&=e&D#s=)A-.A'*K%a!e,I(+55a8L&q1u-77:JGKGuGuYjH'i!mD / "&/3,&(,(:(:tc"899&;,0 6"'+%# ); 
)%A 4J3S3STY3Z0356:;4Q721q59	5a8BB1E3AE:DDQG
 BB;PY[gist 5[9q=Q < 4!E&!II'=&MNM44r$   
batch_sizenum_channels_latentsheightwidthrb   	generatorlatentsc
           
         [        U[        5      (       a*  [        U5      U:w  a  [        S[        U5       SU S35      eU R                  S:X  a  U R                  OUn
UUU
X@R
                  -  XPR
                  -  4nU	c  [        XXvS9n	U R                  S:X  a  U	$ OtU	R                  S5      U:X  a  U	$ U	R                  S5      U R                  :w  a-  [        SU S	U R                   S
U	R                  S5       35      eU	R                  U5      n	U R                  S:X  a  [        U R                  X0R                  5       H  n[        SXR                  -
  5      n[        X=U R                  -   5      nX-
  nUS:X  a    O[        R                  " [        [        X5      5      5      nU[        R                   " XS9   nUn[        UUU-   5      nUUU-   :X  a  U	S S 2S S 2U4   U	S S 2S S 2UU24'   M  UU-
  nUS U nU	S S 2S S 2U4   U	S S 2S S 2UU24'   M     OGU R                  S:X  a7  X0R                  -   S-
  U R                  -  n[        R"                  " U	/U-  SS9n	U	S S 2S S 2S U24   n	U	$ )Nz/You have passed a list of generators of length z+, but requested an effective batch size of z@. Make sure the batch size matches the length of the generators.repeat_context)r   ra   rb   randomr   z_You have passed `latents` as a parameter to FreeNoise. The expected number of frames is either z or z, but found shuffle_contextr   )r   r   r&   )r3   r(   rf   r7   rj   vae_scale_factorr   _free_noise_noise_typesizerm   rh   rk   r   r   r*   
LongTensorrandpermr5   )r    r   r   r   r   r   rb   ra   r   r   context_num_framesr   ru   window_start
window_endwindow_lengthindicesshuffled_indicescurrent_startcurrent_endprefix_lengthnum_repeatss                         r"   _prepare_latents_free_noise5AnimateDiffFreeNoiseMixin._prepare_latents_free_noised  s    i&&3y>Z+GA#i.AQ R&<'gi  04/N/NRb/bD++hr 	
  +++***
 ?"5fZG**h6 7 ||A*,aD$C$CC u  wA  vB  BF  GK  Gf  Gf  Fg  gs  t{  t@  t@  AB  tC  sD  E  jj(G&&*;;4::JHgHgh"1a*I*I&IJ D<[<[-[\
 * 9 A%**4l0O+PQ#*5>>-+]#^  !!*mm.KL--"???Fq!M]G]?^GAq-";;< %0-$?M'7'G$?Fq!M]G]?^GAq-";;<+ i. ((,<<%(G(GG!KPTPoPooKii	K 7Q?G!Q+,r$   start_index	end_indexr   r   c                     X!-
  S-   n/ n[        U5       H(  nXuS-
  -  nSU-
  U-  X-  -   n	UR                  U	5        M*     [        R                  " U5      nU$ )Nr   )rh   r2   r*   r5   )
r    r   r   r   r   num_indicesinterpolated_tensorsru   alphainterpolated_tensors
             r"   _lerpAnimateDiffFreeNoiseMixin._lerp  sp      -1!{#Aq)E#$u9"<u?Q"Q ''(;< $
  %yy)=>##r$   r]   r^   r_   
noise_typeprompt_interpolation_callbackc                 F   / SQn/ SQnXR                   R                  R                  :  a<  [        R	                  SU< SU R                   R                  R                  < S35        X6;  a  [        SU SU< 35      eXG;  a  [        SU S	U< 35      eU=(       d     U R                   R                  R                  U l        X l        X0l        X@l	        U=(       d    U R                  U l        [        U R                  R                  S
5      (       aE  / U R                  R                  QU R                  R                  PU R                  R                   QnO./ U R                  R                  QU R                  R                   QnU H  n	U R#                  U	5        M     g)a\  
Enable long video generation using FreeNoise.

Args:
    context_length (`int`, defaults to `16`, *optional*):
        The number of video frames to process at once. It's recommended to set this to the maximum frames the
        Motion Adapter was trained with (usually 16/24/32). If `None`, the default value from the motion
        adapter config is used.
    context_stride (`int`, *optional*):
        Long videos are generated by processing many frames. FreeNoise processes these frames in sliding
        windows of size `context_length`. Context stride allows you to specify how many frames to skip between
        each window. For example, a context length of 16 and context stride of 4 would process 24 frames as:
            [0, 15], [4, 19], [8, 23] (0-based indexing)
    weighting_scheme (`str`, defaults to `pyramid`):
        Weighting scheme for averaging latents after accumulation in FreeNoise blocks. The following weighting
        schemes are supported currently:
            - "flat"
               Performs weighting averaging with a flat weight pattern: [1, 1, 1, 1, 1].
            - "pyramid"
                Performs weighted averaging with a pyramid like weight pattern: [1, 2, 3, 2, 1].
            - "delayed_reverse_sawtooth"
                Performs weighted averaging with low weights for earlier frames and high-to-low weights for
                later frames: [0.01, 0.01, 3, 2, 1].
    noise_type (`str`, defaults to "shuffle_context"):
        Must be one of ["shuffle_context", "repeat_context", "random"].
            - "shuffle_context"
                Shuffles a fixed batch of `context_length` latents to create a final latent of size
                `num_frames`. This is usually the best setting for most generation scenarios. However, there
                might be visible repetition noticeable in the kinds of motion/animation generated.
            - "repeated_context"
                Repeats a fixed batch of `context_length` latents to create a final latent of size
                `num_frames`.
            - "random"
                The final latents are random without any repetition.
)flatpyramiddelayed_reverse_sawtooth)r   r   r   zYou have set context_length=zH which is greater than self.motion_adapter.config.motion_max_seq_length=z*. This can lead to bad generation results.z0The parameter `weighting_scheme` must be one of z, but got weighting_scheme=z*The parameter `noise_type` must be one of z, but got noise_type=re   N)motion_adapterconfigmotion_max_seq_lengthloggerwarningr7   rj   rk   rl   r   r   r   hasattrunet	mid_blockdown_blocks	up_blocksrw   )
r    r]   r^   r_   r   r   allowed_weighting_schemeallowed_noise_typeblocksrQ   s
             r"   enable_free_noise+AnimateDiffFreeNoiseMixin.enable_free_noise  s   ^ $S L//66LLLNN/00yH[H[HbHbHxHxGz  {e  f ;BC[B\\xgwfyz  /IJ\I]]shrgtuvv*8*lD<O<O<V<V<l<l'*8',<)&0#9V9dZ^ZdZd6499&&(899Xtyy,,Xdii.A.AXDIIDWDWXFCtyy,,Ctyy/B/BCFE,,U3 r$   c                    SU l         [        U R                  R                  S5      (       aE  / U R                  R                  QU R                  R                  PU R                  R
                  QnO./ U R                  R                  QU R                  R
                  Qn/ U R                  R                  QU R                  R                  PU R                  R
                  QnU H  nU R                  U5        M     g)z)Disable the FreeNoise sampling mechanism.Nre   )rj   r   r   r   r   r   r{   )r    r   rQ   s      r"   disable_free_noise,AnimateDiffFreeNoiseMixin.disable_free_noise  s    *.'499&&(899Xtyy,,Xdii.A.AXDIIDWDWXFCtyy,,Ctyy/B/BCFT499((T$))*=*=T		@S@STE--e4 r$   re   spatial_split_sizec           	      ,   U H  n[        UR                  USS/5      Ul        [        [        UR                  5      5       H-  n[        UR                  U   USSS/5      UR                  U'   M/     [        UR
                  USS/5      Ul        M     g )Nr   inputr   encoder_hidden_states)r   proj_inrh   rf   rg   proj_out)r    re   r   rs   ru   s        r"   '_enable_split_inference_motion_modules_AAnimateDiffFreeNoiseMixin._enable_split_inference_motion_modules_  s     ,M$89N9NPbdehogp$qM!3}??@A6J!44Q7&$&=>	7003 B &:-:P:PRdfgjqir%sM" ,r$   
attentionstemporal_split_sizec                 b    [        [        U5      5       H  n[        X   USSS/5      X'   M     g )Nr   r   r   rh   rf   r   )r    r   r   ru   s       r"   #_enable_split_inference_attentions_=AnimateDiffFreeNoiseMixin._enable_split_inference_attentions_$  s5     s:'A02AI`7aJM (r$   resnetsc                 b    [        [        U5      5       H  n[        X   USSS/5      X'   M     g )Nr   input_tensortembr   )r    r   r   ru   s       r"    _enable_split_inference_resnets_:AnimateDiffFreeNoiseMixin._enable_split_inference_resnets_,  s1    s7|$A-gj:MqSaciRjkGJ %r$   samplersc                 `    [        [        U5      5       H  n[        X   USS/5      X'   M     g )Nr   r   r   )r    r   r   ru   s       r"   !_enable_split_inference_samplers_;AnimateDiffFreeNoiseMixin._enable_split_inference_samplers_0  s1     s8}%A.x{<OQRUdTefHK &r$   c                 F   / U R                   R                  QU R                   R                  PU R                   R                  QnU H  n[	        USS5      b  U R                  UR                  U5        [	        USS5      b  U R                  UR                  U5        [	        USS5      b  U R                  UR                  U5        [	        USS5      b  U R                  UR                  U5        [	        USS5      c  M  U R                  UR                  U5        M     g)a  
Enable FreeNoise memory optimizations by utilizing
[`~diffusers.pipelines.free_noise_utils.SplitInferenceModule`] across different intermediate modeling blocks.

Args:
    spatial_split_size (`int`, defaults to `256`):
        The split size across spatial dimensions for internal blocks. This is used in facilitating split
        inference across the effective batch dimension (`[B x H x W, F, C]`) of intermediate tensors in motion
        modeling blocks.
    temporal_split_size (`int`, defaults to `16`):
        The split size across temporal dimensions for internal blocks. This is used in facilitating split
        inference across the effective batch dimension (`[B x F, H x W, C]`) of intermediate tensors in spatial
        attention, resnets, downsampling and upsampling blocks.
re   Nr   r   downsamplers
upsamplers)r   r   r   r   getattrr   re   r   r   r   r   r   r   r   )r    r   r   r   rQ   s        r"   !enable_free_noise_split_inference;AnimateDiffFreeNoiseMixin.enable_free_noise_split_inference6  s      U499((T$))*=*=T		@S@STEu.5A<<U=Q=QSefulD1=889I9IK^_ui.:55emmEXYund3?66u7I7IK^_ulD1=66u7G7GI\] r$   c                 D    [        U S5      =(       a    U R                  S L$ )Nrj   )r   rj   )r    s    r"   free_noise_enabled,AnimateDiffFreeNoiseMixin.free_noise_enabledS  s!    t9:jt?^?^fj?jjr$   )rj   rk   r   r   rl   )r   N)NNNNN)NN)      r   r   N)   r  )*rC   rD   rE   rF   rG   r   r   r   rw   r{   r   rK   r0   rJ   r*   ra   boolr4   floatr   rb   	Generatorr   r   r   r   r   r   r(   r   r   r
   r   r   r   r   r	   r   r   propertyr  rL    r$   r"   rO   rO      sA   Q'1IO1[^k1k 'R2J_2\_l2l >" 
"V 8<-16:#' $b5d38n$b5 b5 	b5
  #b5 &*b5 tCH~-4b5 ||d*b5 !&t 3b5 DLb5 :b5 
b5Z -1'+HH "H 	H
 H H {{H H ??T)H $HT$$+.$>Cll$X]XdXd$	$  &( )+ I4d
I4 I4 	I4
 I4 (0S%,,Eu||S(
 (I4 
I4V5t"#;<tRUt	t 12IL	l]8K lbe ljn lg\*T*-==gTWg	g^C ^dg ^qu ^: k kr$   rO   )typingr   r*   torch.nnrH   models.attentionr   r   models.resnetr   r   r	   "models.transformers.transformer_2dr
   models.unets.unet_motion_modelr   r   r   r   pipelines.pipeline_utilsr   utilsr   utils.torch_utilsr   
get_loggerrC   r   rI   r   rO   r  r$   r"   <module>r     sd       O C C C  9  , 
		H	%i299 iXDk Dkr$   