o >g @s>ddlZddlmZGdddZGdddZeedZdS)NMAX_RESOLUTIONc@,eZdZeddZdZdZdZddZdS) CLIPTextEncodeSDXLRefinercCsDdddddddfdd d td fdd d td fd d d dfddiS)NrequiredFLOATg@gg@@g{Gz?)defaultminmaxstepINT@rrr r STRINGT multilinedynamicPromptsCLIP)ascorewidthheighttextcliprsrF/home/comdoleger1/zen-flux-style-shape/comfy_extras/nodes_clip_sdxl.py INPUT_TYPESs z%CLIPTextEncodeSDXLRefiner.INPUT_TYPES CONDITIONINGencodeadvanced/conditioningc Cs2||}|j|dd\}}|||||dggfS)NT return_pooled) pooled_outputaesthetic_scorerr)tokenizeencode_from_tokens) selfrrrrrtokenscondpooledrrrr!s z CLIPTextEncodeSDXLRefiner.encodeN __name__ __module__ __qualname__ classmethodr RETURN_TYPESFUNCTIONCATEGORYr!rrrrrs  rc@r) CLIPTextEncodeSDXLc Cszddddtdfdddtdfdddtdfdddtdfdddtdfdddtdfddddfd ddddfd d iS) Nrr r rrrTrr) rrcrop_wcrop_h target_width target_heighttext_grtext_lrrrrrrrszCLIPTextEncodeSDXL.INPUT_TYPESrr!r"c  Cs||} || d| d<t| dt| dkrc|d} t| dt| dkrA| d| d7<t| dt| dks+t| dt| dkrc| d| d7<t| dt| dksM|j| dd\} } | | ||||||dggfS)NlgTr#)r%rrr6r7r8r9)r'lenr()r)rrrr6r7r8r9r:r;r*emptyr+r,rrrr!)s  zCLIPTextEncodeSDXL.encodeNr-rrrrr5s   r5)rr5)torchnodesrrr5NODE_CLASS_MAPPINGSrrrrs