+
    „°ñjÁ7  ã                   óº   € ^ RI HtHt ^ RIt^ RIt^ RIHt  ! R R]P                  4      t	 ! R R]	4      t
 ! R R	]	4      t ! R
 R]	4      t ! R R]4      tR tR# )é    )ÚComfyExtensionÚioN)Úvideo_latent_tc                   ód   a € ] tR t^t o ]V 3R lR l4       t]. R. R3V 3R lR ll4       tRtV tR# )	ÚContextWindowsManualNodec                ó4   <€ V ^8„  d   QhRS[ P                  /# ©é   Úreturn©r   ÚSchema)ÚformatÚ__classdict__s   "€ÚFC:\Ai_Coding\apps\studio\ComfyUI\comfy_extras\nodes_context_windows.pyÚ__annotate__Ú%ContextWindowsManualNode.__annotate__	   s   ø€ ÷ 
ñ 
™bŸi™iñ 
ó    c                óÄ  € \         P                  ! R RRR\         P                  P                  RRR7      \         P                  P                  R^^RR	7      \         P                  P                  R
^ ^RR	7      \         P
                  P                  R\        P                  P                  P                  \        P                  P                  P                  \        P                  P                  P                  \        P                  P                  P                  .\        P                  P                  P                  RR7      \         P                  P                  R^^RR	7      \         P                  P                  RRRR7      \         P
                  P                  R\        P                  P                  P                  \        P                  P                  P                   RR7      \         P                  P                  R^ ^^ RR7      \         P                  P                  RRRR7      \         P"                  P                  RRRR7      \         P                  P                  RRR R7      \         P"                  P                  R!RR"R7      \         P                  P                  R#R$R%R7      .\         P                  P%                  R&R7      .R$R'7      # )(ÚContextWindowsManualzContext Windows (Manual)zmodel/patchzManually set context windows.Úmodelú6The model to apply context windows to during sampling.©ÚtooltipÚcontext_lengthz!The length of the context window.©ÚminÚdefaultr   Úcontext_overlapz"The overlap of the context window.Úcontext_scheduleú8Step-dependent scheduling algorithm for context windows.©Úoptionsr   r   Úcontext_strideúGThe stride of the context window; only applicable to uniform schedules.Úclosed_loopFúNWhether to close the context window loop; only applicable to looped schedules.©r   r   Úfuse_methodú.The method to use to fuse the context windows.Údimz.The dimension to apply the context windows to.)r   Úmaxr   r   Ú	freenoiseúEWhether to apply FreeNoise noise shuffling, improves window blending.Úcond_retain_index_listÚ a7  List of latent indices to retain in the conditioning tensors for each window. For concat-style I2V models (e.g. Wan I2V, HunyuanVideo I2V, Cosmos I2V, SVD) the encoded start image lives in the c_concat conditioning channels; setting this to '0' will retain that start image content at sub-pos 0 of every window.Úsplit_conds_to_windowsúkWhether to split multiple conditionings (created by ConditionCombine) to each window based on region index.Úlatent_retain_index_lista4  List of latent indices to retain in the noise latent itself for each window. Use for workflows where reference content (e.g. a start image) lives directly in the noise latent rather than in separate conditioning channels (e.g. inplace-style I2V like LTXV, AnimateDiff). Independent of cond_retain_index_list.Úcausal_window_fixTzCWhether to add a causal fix frame to non-0-indexed context windows.z7The model with context windows applied during sampling.)Únode_idÚdisplay_nameÚcategoryÚdescriptionÚinputsÚoutputsÚis_experimental)r   r   ÚModelÚInputÚIntÚComboÚcomfyÚcontext_windowsÚContextSchedulesÚSTATIC_STANDARDÚUNIFORM_STANDARDÚUNIFORM_LOOPEDÚBATCHEDÚBooleanÚContextFuseMethodsÚLIST_STATICÚPYRAMIDÚStringÚOutput)Úclss   &r   Údefine_schemaÚ&ContextWindowsManualNode.define_schema   s{  € ä�yŠyØ*Ø3Ø"Ø7ä—‘—‘˜wÐ0h�ÓiÜ—‘—‘Ð-°1¸bÐJm�ÓnÜ—‘—‘Ð.°A¸qÐJn�ÓoÜ—‘—‘Ð1Ü×)Ñ)×:Ñ:×JÑJÜ×)Ñ)×:Ñ:×KÑKÜ×)Ñ)×:Ñ:×IÑIÜ×)Ñ)×:Ñ:×BÑBð	<ô
  %×4Ñ4×EÑE×UÑUð  `Zð ó [ô —‘—‘Ð-°1¸að  JS�ó  TÜ—
‘
× Ñ  ¸ð  HXÐ ó  YÜ—‘—‘˜}´e×6KÑ6K×6^Ñ6^×6jÑ6jÔty÷  uJñ  uJ÷  u]ñ  u]÷  ueñ  ueð  o_�ó  `Ü—‘—‘˜U¨¨q¸!ÐEu�ÓvÜ—
‘
× Ñ  °eð  FMÐ ó  NÜ—	‘	—‘Ð 8À"ð  OH�ó  IÜ—
‘
× Ñ Ð!9À5ð  S@Ð ó  AÜ—	‘	—‘Ð :ÀBð  QG�ó  HÜ—
‘
× Ñ Ð!4¸dð  MRÐ ó  Sð%ô* —‘—‘Ð(a�Óbðð !ô9
ð 	
r   FTc                óÊ   <€ V ^8„  d   QhRS[ P                  P                  RS[RS[RS[RS[RS[RS[RS[R	S[R
S[S[,          RS[RS[S[,          RS[RS[ P                  /# )r
   r   r   r   r   r#   r%   r(   r*   r,   r.   r0   r2   r3   r   )r   r;   ÚTypeÚintÚstrÚboolÚlist)r   r   s   "€r   r   r   *   s·   ø€ ÷ $ñ $™BŸH™HŸM™Mð $¹3ð $ÑQTð $Ñhkð $ñ  ~Að $ñ  PTð $ñ  cfð $ñ  mpð $ñ  }Að $Ù(,©S­	ð$ÙNRð$ÙtxÑy|Õt}ð$ñ VZð$ñ df÷  dlñ  dlñ$r   c                ó¾  € VP                  4       p\        P                  P                  \        P                  P	                  V4      \        P                  P                  V4      VVVVVV	V
VVVR 7      VP                  R&   \        P                  P                  V4       V	'       d    \        P                  P                  V4       \        P                  ! V4      # ))r   r(   r   r   r#   r%   r*   r,   r.   r0   r2   r3   Úcontext_handler)Úcloner?   r@   ÚIndexListContextHandlerÚget_matching_context_scheduleÚget_matching_fuse_methodÚmodel_optionsÚcreate_prepare_sampling_wrapperÚcreate_sampler_sample_wrapperr   Ú
NodeOutput)rL   r   r   r   r   r#   r%   r(   r*   r,   r.   r0   r2   r3   s   &&&&&&&&&&&&&&r   ÚexecuteÚ ContextWindowsManualNode.execute)   sº   € ð —‘“ˆÜ16×1FÑ1F×1^Ñ1^Ü"×2Ñ2×PÑPÐQaÓbÜ×-Ñ-×FÑFÀ{ÓSØ)Ø+Ø)Ø#ØØØ#9Ø#9Ø%=Ø/ð 2_ó 2
ˆ×ÑÐ-Ñ.ô 	×Ñ×=Ñ=¸eÔDßÜ×!Ñ!×?Ñ?ÀÔFÜ�}Š}˜UÓ#Ð#r   © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚclassmethodrM   r_   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      sE   ø‡ € Ø÷
ó ð
ð@ à24ÐSXð  Að  [_÷$ñ $ó ö$r   r   c                   ón   a a€ ] tR t^At o]V3R lV 3R ll4       t]RV3R lV 3R lll4       tRtVtV ;t	# )ÚWanContextWindowsManualNodec                ó4   <€ V ^8„  d   QhRS[ P                  /# r	   r   )r   r   s   "€r   r   Ú(WanContextWindowsManualNode.__annotate__C   s   ø€ ÷ ñ ™bŸi™iñ r   c                ó   <€ \         SV `  4       pR Vn        RVn        RVn        RVn        RVn        \        P                  P                  RRR7      \        P                  P                  R^\        P                  ^^QR	R
7      \        P                  P                  R^ ^RR7      \        P                  P                  R\        P                  P                  P                   \        P                  P                  P"                  \        P                  P                  P$                  \        P                  P                  P&                  .\        P                  P                  P"                  RR7      \        P                  P                  R^^RRR7      \        P(                  P                  RRRRR7      \        P                  P                  R\        P                  P*                  P,                  \        P                  P*                  P.                  RR7      \        P(                  P                  RRRRR7      \        P(                  P                  RRRR7      \        P(                  P                  R RR!RR7      .
Vn        V# )"ÚWanContextWindowsManualzWAN Context Windows (Manual)zWan Context Windowsz(Set context windows for Wan-like models.zmodel/patch/wanr   r   r   r   zAThe length of the context window in real frames. Must be 4*n + 1.©r   r+   Ústepr   r   r   ú1The overlap of the context window in real frames.r   r   r    r!   r#   r$   T©r   r   r   Úadvancedr%   Fr&   ©r   r   rt   r(   r)   r,   r-   Úretain_first_framezWRetain the first I2V frame in every context window (may help retain initial reference).r'   r0   r1   ©ÚsuperrM   r4   r5   r7   r6   r   r;   r<   r=   ÚnodesÚMAX_RESOLUTIONr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   r8   ©rL   ÚschemaÚ	__class__s   & €r   rM   Ú)WanContextWindowsManualNode.define_schemaB   sT  ø€ ä‘Ñ&Ó(ˆØ2ˆŒØ<ˆÔØ3ˆÔØGˆÔØ)ˆŒä�H‰H�N‰N˜7Ð,dˆNÓeÜ—‘—‘Ð-°1¼%×:NÑ:NÐUVÐ`bð  mp�ó  qÜ—‘—‘Ð.°A¸rÐK~�ÓÜ—‘—‘Ð1Ü×)Ñ)×:Ñ:×JÑJÜ×)Ñ)×:Ñ:×KÑKÜ×)Ñ)×:Ñ:×IÑIÜ×)Ñ)×:Ñ:×BÑBð	<ô
  %×4Ñ4×EÑE×VÑVð  a[ð ó \ô —‘—‘Ð-°1¸að  JSð  ^b�ó  cÜ—
‘
× Ñ  ¸ð  HXð  cgÐ ó  hÜ—‘—‘˜}´e×6KÑ6K×6^Ñ6^×6jÑ6jÔty÷  uJñ  uJ÷  u]ñ  u]÷  ueñ  ueð  o_�ó  `Ü—
‘
× Ñ  °dð  ELð  W[Ð ó  \Ü—
‘
× Ñ Ð!5¸uð  OhÐ ó  iÜ—
‘
× Ñ Ð!9À5ð  S@ð  KOÐ ó  Pð
ˆŒð" ˆr   c                ó˜   <€ V ^8„  d   QhRS[ P                  P                  RS[RS[RS[RS[RS[RS[RS[R	S[R
S[RS[ P                  /# )r
   r   r   r   r   r#   r%   r(   r,   rv   r0   r   ©r   r;   rP   rQ   rR   rS   )r   r   s   "€r   r   rm   ^   sŽ   ø€ ÷ xñ x™BŸH™HŸM™Mð x¹3ð xÑQTð xÑhkð xñ  ~Að xñ  PTð xñ  cfð xñ  swð xÙ$(ðxÙHLðxÙWY×W_ÑW_ñxr   c                ó°   <€ \        V^,
          ^,          ^,           ^4      p\        V^,          ^ 4      pV	'       d   RMRp\        SV `	  WW4WVV^W‹V
R7      # )é   Ú0r/   )r*   r,   r.   r0   ©r+   rx   r_   )rL   r   r   r   r   r#   r%   r(   r,   rv   r0   Úretain_index_listr}   s   &&&&&&&&&&& €r   r_   Ú#WanContextWindowsManualNode.execute]   ss   ø€ ô ˜~°Õ1°aÕ7¸1Õ<¸aÓ@ˆÜ˜o°Õ2°AÓ6ˆß#5™C¸2ÐÜ‰w‰˜u°oÐYgð  wBð  HIð  U^ð  awˆó  xð  	xr   ra   )FF©
rb   rc   rd   re   rf   rM   r_   rg   rh   Ú__classcell__©r}   r   s   @@r   rk   rk   A   s>   ù‡ € Ø÷ò ó ðð4 ÷xô xó ÷xð xr   rk   c                   ón   a a€ ] tR t^ft o]V3R lV 3R ll4       t]RV3R lV 3R lll4       tRtVtV ;t	# )ÚLTXVContextWindowsNodec                ó4   <€ V ^8„  d   QhRS[ P                  /# r	   r   )r   r   s   "€r   r   Ú#LTXVContextWindowsNode.__annotate__h   s   ø€ ÷ ñ ™bŸi™iñ r   c                ó  <€ \         SV `  4       pR Vn        RVn        RVn        RVn        \        P                  P                  RRR7      \        P                  P                  R^\        P                  ^^‘RR	7      \        P                  P                  R
^ ^^(RR7      \        P                  P                  R\        P                  P                  P                   \        P                  P                  P"                  \        P                  P                  P$                  \        P                  P                  P&                  .\        P                  P                  P"                  RR7      \        P                  P                  R^^RRR7      \        P(                  P                  RRRRR7      \        P                  P                  R\        P                  P*                  P,                  \        P                  P*                  P.                  RR7      \        P(                  P                  RRRRR7      \        P(                  P                  RRRR7      \        P(                  P                  RRR RR7      .
Vn        V# )!ÚLTXVContextWindowszLTXV Context Windowsz)Set context windows for LTXV-like models.zmodel/patch/ltxvr   r   r   r   zAThe length of the context window in real frames. Must be 8*n + 1.rp   r   rr   ©r   rq   r   r   r   r    r!   r#   r$   Trs   r%   Fr&   ru   r(   r)   r,   r-   rv   zZRetain the first latent frame in every context window (may help retain initial reference).r'   r0   r1   rw   r{   s   & €r   rM   Ú$LTXVContextWindowsNode.define_schemag   sU  ø€ ä‘Ñ&Ó(ˆØ-ˆŒØ4ˆÔØHˆÔØ*ˆŒä�H‰H�N‰N˜7Ð,dˆNÓeÜ�F‰F�L‰LÐ)¨q´e×6JÑ6JÐQRÐ\_ð  jmˆLó  nÜ�F‰F�L‰LÐ*°¸À2ð  PCˆLó  DÜ�H‰H�N‰NÐ-Ü×%Ñ%×6Ñ6×FÑFÜ×%Ñ%×6Ñ6×GÑGÜ×%Ñ%×6Ñ6×EÑEÜ×%Ñ%×6Ñ6×>Ñ>ð	8ô
 !×0Ñ0×AÑA×RÑRð  ]Wð ó Xô �F‰F�L‰LÐ)¨q¸!ð  FOð  Z^ˆLó  _Ü�J‰J×Ñ˜]°Eð  DTð  _cÐó  dÜ�H‰H�N‰N˜=´%×2GÑ2G×2ZÑ2Z×2fÑ2fÔpu÷  qFñ  qF÷  qYñ  qY÷  qañ  qað  k[ˆNó  \Ü�J‰J×Ñ˜[°$ð  AHð  SWÐó  XÜ�J‰J×ÑÐ1¸5ð  KgÐó  hÜ�J‰J×ÑÐ5¸uð  O|ð  GKÐó  Lð
ˆŒð" ˆr   c                ó˜   <€ V ^8„  d   QhRS[ P                  P                  RS[RS[RS[RS[RS[RS[RS[R	S[R
S[RS[ P                  /# )r
   r   r   r   r   r(   r,   rv   r0   r#   r%   r   r€   )r   r   s   "€r   r   r�   ‚   sŽ   ø€ ÷ dñ d™BŸH™HŸM™Mð d¹3ð dÑQTð dÑhkð dÑz}ð dñ  KOð dÙ$(ðdÙHLðdÙdgðdÙx|ðdñ HJ÷  HPñ  HPñdr   c                ó²   <€ \        V^,
          ^,          ^,           ^4      p\        V^,          ^ 4      pV'       d   RMRp\        SV `	  WW4WšV^VW»VR7      # )r‚   rƒ   r/   )r*   r,   r.   r2   r0   r„   )rL   r   r   r   r   r(   r,   rv   r0   r#   r%   r…   r}   s   &&&&&&&&&&& €r   r_   ÚLTXVContextWindowsNode.execute�   sy   ø€ ô ˜~°Õ1°aÕ7¸1Õ<¸aÓ@ˆÜ˜o°Õ2°AÓ6ˆß#5™C¸2ÐÜ‰w‰˜u°oÐYgð  wBð  HIð  U^Ø6Gð  Mcð ó dð 	dr   ra   )FFr‚   Fr‡   r‰   s   @@r   r‹   r‹   f   s>   ù‡ € Ø÷ò ó ðð2 ÷dô dó ÷dð dr   r‹   c                   ón   a a€ ] tR t^‹t o]V3R lV 3R ll4       t]RV3R lV 3R lll4       tRtVtV ;t	# )ÚMiniMaxH3ContextWindowsNodec                ó4   <€ V ^8„  d   QhRS[ P                  /# r	   r   )r   r   s   "€r   r   Ú(MiniMaxH3ContextWindowsNode.__annotate__�   s   ø€ ÷ ñ ™bŸi™iñ r   c                ó¨  <€ \         SV `  4       pR Vn        RVn        RVn        RVn        \        P                  P                  RRR7      \        P                  P                  R^\        P                  ^^|RR	7      \        P                  P                  R
^^^'RR7      \        P                  P                  R\        P                  P                  P                   \        P                  P                  P"                  RR7      \        P$                  P                  RRRRR7      \        P$                  P                  RRRRR7      .Vn        V# )ÚMiniMaxH3ContextWindowszMiniMax H3 Context WindowszqSet context windows for MiniMax H3. Windows start on the model's 17-frame chunks to keep video and audio in sync.zmodel/patch/minimaxr   r   r   r   zBThe length of the context window in real frames. Must be 17*n + 5.rp   r   zCThe overlap of the context window in real frames. Must be 17*n + 5.r�   r(   r)   r!   r,   Tr-   ru   r0   Fr1   )rx   rM   r4   r5   r7   r6   r   r;   r<   r=   ry   rz   r>   r?   r@   rG   rH   rI   rF   r8   r{   s   & €r   rM   Ú)MiniMaxH3ContextWindowsNode.define_schemaŒ   sT  ø€ ä‘Ñ&Ó(ˆØ2ˆŒØ:ˆÔð QˆÔØ/ˆŒä�H‰H�N‰N˜7Ð,dˆNÓeÜ�F‰F�L‰LÐ)¨r´u×7KÑ7KÐRTÐ^að  lpˆLó  qÜ�F‰F�L‰LÐ*°¸ÀBð  QVˆLó  WÜ�H‰H�N‰N˜=´%×2GÑ2G×2ZÑ2Z×2fÑ2fÔpu÷  qFñ  qF÷  qYñ  qY÷  qañ  qað  k[ˆNó  \Ü�J‰J×Ñ˜[°$ð  AHð  SWÐó  XÜ�J‰J×ÑÐ5¸uð  O|ð  GKÐó  Lð
ˆŒð ˆr   c                ó€   <€ V ^8„  d   QhRS[ P                  P                  RS[RS[RS[RS[RS[RS[ P                  /# )r
   r   r   r   r(   r,   r0   r   r€   )r   r   s   "€r   r   r˜   ž   sX   ø€ ÷ gñ g™BŸH™HŸM™Mð g¹3ð gÑQTð gÑcfð gÑswð gÙ(,ðgÙ79·x±xñgr   c                óÈ   <€ \        V4      p\        \        V4      V^,
          4      p\        SV `  WV\        P
                  P                  P                  ^RV^VVRR7      # )é   F)r*   r,   r0   r3   )r   r   rx   r_   r?   r@   rA   rB   )rL   r   r   r   r(   r,   r0   r}   s   &&&&&&&€r   r_   Ú#MiniMaxH3ContextWindowsNode.execute�   s   ø€ ô (¨Ó7ˆÜœn¨_Ó=¸~ÐPQÕ?QÓRˆÜ‰w‰˜u°oÄu×G\ÑG\×GmÑGm×G}ÑG}ð  @Að  CHð  JUð  [\ð  hqØ6LÐ`eð ó gð 	gr   ra   )Fr‡   r‰   s   @@r   r–   r–   ‹   s>   ù‡ € Ø÷ò ó ðð  ÷gô gó ÷gð gr   r–   c                   ó2   a € ] tR t^§t o V 3R lR ltRtV tR# )ÚContextWindowsExtensionc                óT   <€ V ^8„  d   QhRS[ S[S[P                  ,          ,          /# r	   )rT   Útyper   Ú	ComfyNode)r   r   s   "€r   r   Ú$ContextWindowsExtension.__annotate__¨   s"   ø€ ÷ 
ñ 
¡T©$©r¯|©|Õ*<Õ%=ñ 
r   c              ƒ  ó6   "  € \         \        \        \        .# 5i©N)r   rk   r‹   r–   )Úselfs   &r   Úget_node_listÚ%ContextWindowsExtension.get_node_list¨   s   é € ä$Ü'Ü"Ü'ð	
ð 	
ùs   ‚ra   N)rb   rc   rd   re   r©   rg   rh   ri   s   @r   r¡   r¡   §   s   ø‡ € ÷
ö 
r   r¡   c                  ó   € \        4       # r§   )r¡   ra   r   r   Úcomfy_entrypointr¬   °   s   € Ü"Ó$Ð$r   )Úcomfy_api.latestr   r   Úcomfy.context_windowsr?   ry   Úcomfy_extras.nodes_minimax_h3r   r¤   r   rk   r‹   r–   r¡   r¬   ra   r   r   Ú<module>r°      sb   ðß /Û Û Ý 8ô8$˜rŸ|™|ô 8$ôt"xÐ":ô "xôJ"dÐ5ô "dôJgÐ":ô gô8
˜nô 
ô%r   