+
    „°ñj(  ã                   ó    € ^ RI Ht ^ RIt^ RIHtHt  ! R R]P                  4      t ! R R]P                  4      t ! R R	]4      t	R
 R lt
R# )é    )ÚoverrideN)ÚComfyExtensionÚioc                   óL   a € ] tR t^t o ]R 4       t]V 3R lR l4       tRtV tR# )Ú	RenormCFGc                ó<  € \         P                  ! R R\         P                  P                  R4      \         P                  P                  R^dRRRRR7      \         P                  P                  R	R
RRRRR7      .\         P                  P                  4       .R7      # )r   zmodel/patchÚmodelÚ	cfg_truncç        g      Y@g{®Gáz„?T)ÚdefaultÚminÚmaxÚstepÚadvancedÚ
renorm_cfgg      ð?)Únode_idÚcategoryÚinputsÚoutputs)r   ÚSchemaÚModelÚInputÚFloatÚOutput©Úclss   &Ú>C:\Ai_Coding\apps\studio\ComfyUI\comfy_extras\nodes_lumina2.pyÚdefine_schemaÚRenormCFG.define_schema   s   € ä�yŠyØØ"ä—‘—‘˜wÓ'Ü—‘—‘˜{°C¸SÀeÐRVÐae�ÓfÜ—‘—‘˜|°S¸cÀuÐSWÐbf�Ógðô —‘—‘Ó!ðô
ð 	
ó    c                ó4   <€ V ^8„  d   QhRS[ P                  /# ©é   Úreturn©r   Ú
NodeOutput)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚRenormCFG.__annotate__   s   ø€ ÷ ' ñ ' ±b·m±mñ ' r    c                ó†   aaa€ VVV3R  lpSP                  4       pVP                  V4       \        P                  ! V4      # )c                 óŽ  <€ V R ,          pV R,          pV R,          pV R,          pV R,          pSP                   P                  P                  pV^ ,          S8  Ed   VRRV13,          VRRV13,          r‡VRVR13,          VRVR13,          r©WƒWx,
          ,          ,           pT	p\        S4      R8”  d¸   \        P
                  P                  V\        \        ^\        VP                  4      4      4      RR	7      pV\        S4      ,          p\        P
                  P                  V\        \        ^\        VP                  4      4      4      RR	7      pWþ8¼  d   W¾V,          ,          pM6VRRV13,          VRRV13,          r‡VRVR13,          VRVR13,          r©TpT	p\        P                  ! W¼.^R
7      pVV,
          # )Úcond_denoisedÚuncond_denoisedÚ
cond_scaleÚtimestepÚinput:NNNNr   T)ÚdimÚkeepdim)r2   )r	   Údiffusion_modelÚin_channelsÚfloatÚtorchÚlinalgÚvector_normÚtupleÚrangeÚlenÚshapeÚcat)Úargsr-   r.   r/   r0   Úx_origr5   Úcond_epsÚ
uncond_epsÚ	cond_restÚ_Úhalf_epsÚ	half_restÚori_pos_normÚmax_new_normÚnew_pos_normÚ
cfg_resultr
   r	   r   s   &                €€€r   Úrenorm_cfg_funcÚ*RenormCFG.execute.<locals>.renorm_cfg_func   s¿  ø€ Ø  Õ1ˆMØ"Ð#4Õ5ˆOØ˜lÕ+ˆJØ˜JÕ'ˆHØ˜'•]ˆFØŸ+™+×5Ñ5×AÑAˆKà˜�{˜YÕ&Ø'4°Q¸¸¸°_Õ'EÀÐWXÐZfÐ[fÐZfÐWfÕGg˜*Ø,¨Q°±¨_Õ=¸ÈqÐR]ÑR^ÈÕ?_˜1Ø%°hÕ6KÕ(LÕL�Ø%�	ä˜Ó$ sÔ*Ü#(§<¡<×#;Ñ#;¸HÜ"'¬¨a´°X·^±^Ó1DÓ(EÓ"FÐPTð $<ó $�Lð $0´%¸
Ó2CÕ#C�LÜ#(§<¡<×#;Ñ#;Ø$¬%´°a¼¸X¿^¹^Ó9LÓ0MÓ*NÐX\ð $<ó $�Lð $Ô3Ø#+¸lÕ/JÕ#K˜øà'4°Q¸¸¸°_Õ'EÀÐWXÐZfÐ[fÐZfÐWfÕGg˜*Ø,¨Q°±¨_Õ=¸ÈqÐR]ÑR^ÈÕ?_˜1Ø#�Ø%�	äŸš HÐ#8¸aÔ@ˆJð ˜JÕ&Ð&r    )ÚcloneÚset_model_sampler_cfg_functionr   r&   )r   r	   r
   r   rK   Úms   &fff  r   ÚexecuteÚRenormCFG.execute   s3   ú€ ÷"	'ðH �K‰K‹MˆØ	×(Ñ(¨Ô9Ü�}Š}˜QÓÐr    © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Úclassmethodr   rP   Ú__static_attributes__Ú__classdictcell__©r(   s   @r   r   r      s+   ø‡ € Øñ
ó ð
ð ÷' ó ö' r    r   c                   ó\   a € ] tR t^Bt o RRRR/tRt]R 4       t]V 3R lR l4       tR	t	V t
R
# )ÚCLIPTextEncodeLumina2Úsuperiorz”You are an assistant designed to generate superior images with the superior degree of image-text alignment based on textual prompts or user prompts.Ú	alignmentz‡You are an assistant designed to generate high-quality images with the highest degree of image-text alignment based on textual prompts.a]  Lumina2 provide two types of system prompts:Superior: You are an assistant designed to generate superior images with the superior degree of image-text alignment based on textual prompts or user prompts. Alignment: You are an assistant designed to generate high-quality images with the highest degree of image-text alignment based on textual prompts.c                ó˜  € \         P                  ! R R.RRR\         P                  P                  R\	        V P
                  P                  4       4      V P                  R7      \         P                  P                  RRRR	R
7      \         P                  P                  RRR7      .\         P                  P                  RR7      .R7      # )r\   zlumina promptzCLIP Text Encode (Lumina 2)zmodel/conditioning/luminaz Encodes a system prompt and a user prompt using a CLIP model into an embedding that can be used to guide the diffusion model towards generating specific images.Úsystem_prompt)ÚoptionsÚtooltipÚuser_promptTzThe text to be encoded.)Ú	multilineÚdynamic_promptsrb   Úclipz*The CLIP model used for encoding the text.)rb   zNA conditioning containing the embedded text used to guide the diffusion model.)r   Úsearch_aliasesÚdisplay_namer   Údescriptionr   r   )r   r   ÚCombor   ÚlistÚSYSTEM_PROMPTÚkeysÚSYSTEM_PROMPT_TIPÚStringÚClipÚConditioningr   r   s   &r   r   Ú#CLIPTextEncodeLumina2.define_schemaN   sÂ   € ä�yŠyØ+Ø+Ð,Ø6Ø0ðlô —‘—‘Ø#Ü  ×!2Ñ!2×!7Ñ!7Ó!9Ó:Ø×1Ñ1ð ó ô
 —	‘	—‘Ø!Ø"Ø$(Ø5ð	  ó ô —‘—‘˜fÐ.Z�Ó[ðô —‘×&Ñ&Ølð 'ó ðô+
ð 	
r    c                ó4   <€ V ^8„  d   QhRS[ P                  /# r"   r%   )r'   r(   s   "€r   r)   Ú"CLIPTextEncodeLumina2.__annotate__m   s   ø€ ÷ Hñ H¹"¿-¹-ñ Hr    c                óÀ   € Vf   \        R4      hV P                  V,          pV RV 2pVP                  V4      p\        P                  ! VP                  V4      4      # )Nz•ERROR: clip input is invalid: None

If the clip is from a checkpoint loader node your checkpoint does not contain a valid clip or text encoder model.z <Prompt Start> )ÚRuntimeErrorrl   Útokenizer   r&   Úencode_from_tokens_scheduled)r   rf   rc   r`   ÚpromptÚtokenss   &&&&  r   rP   ÚCLIPTextEncodeLumina2.executel   se   € àŠ<Üð   yó  zð  zØ×)Ñ)¨-Õ8ˆØ!�?Ð"2°;°-Ð@ˆØ—‘˜vÓ&ˆÜ�}Š}˜T×>Ñ>¸vÓFÓGÐGr    rR   N)rS   rT   rU   rV   rl   rn   rW   r   rP   rX   rY   rZ   s   @r   r\   r\   B   sQ   ø‡ € àð Wàð Oð€MðCÐð
 ñ
ó ð
ð: ÷Hó öHr    r\   c                   ó<   a € ] tR t^vt o ]V 3R lR l4       tRtV tR# )ÚLumina2Extensionc                óT   <€ V ^8„  d   QhRS[ S[S[P                  ,          ,          /# r"   )rk   Útyper   Ú	ComfyNode)r'   r(   s   "€r   r)   ÚLumina2Extension.__annotate__x   s"   ø€ ÷ 
ñ 
¡T©$©r¯|©|Õ*<Õ%=ñ 
r    c              ƒ  ó"   "  € \         \        .# 5i©N)r\   r   )Úselfs   &r   Úget_node_listÚLumina2Extension.get_node_listw   s   é € ô "Üð
ð 	
ùs   ‚rR   N)rS   rT   rU   rV   r   r…   rX   rY   rZ   s   @r   r}   r}   v   s   ø‡ € Ø÷
ó ö
r    r}   c                ó$   € V ^8„  d   QhR\         /# r"   ©r}   )r'   s   "r   r)   r)      s   € ÷ ñ Ô 0ñ r    c               ƒ   ó   "  € \        4       # 5irƒ   rˆ   rR   r    r   Úcomfy_entrypointrŠ      s   é € ÜÓÐùs   ‚)Útyping_extensionsr   r7   Úcomfy_api.latestr   r   r€   r   r\   r}   rŠ   rR   r    r   Ú<module>r�      sC   ðÝ &Û ç /ô8 �—‘ô 8 ôv1H˜BŸL™Lô 1Hôh
�~ô 
÷r    