o Ô>õg¸ã@s*ddlZddlZGdd„dƒZdeiZdS)éNc@s0eZdZedd„ƒZdZdZdZdZdd„Z d S) ÚSD_4XUpscale_Conditioningc Cs0dddddddddd œfdddd d d œfd œiS) NÚrequired)ÚIMAGE)Ú CONDITIONINGÚFLOATg@gg$@g{®Gáz„?)ÚdefaultÚminÚmaxÚstepçð?gü©ñÒMbP?)ÚimagesÚpositiveÚnegativeÚ scale_ratioÚnoise_augmentation©)ÚsrrúF/home/comdoleger1/zen-flux-style-shape/comfy_extras/nodes_sdupscale.pyÚ INPUT_TYPESs üz%SD_4XUpscale_Conditioning.INPUT_TYPES)rrÚLATENT)r rÚlatentÚencodezconditioning/upscale_diffusioncCstdt|jd|ƒƒ}tdt|jd|ƒƒ}tj | dd¡dd|d|ddd ¡}g} g} |D]} | d | d ¡g} || dd <|| dd <|  | ¡q4|D]} | d | d ¡g} || dd <|| dd <|  | ¡qTt   |jd d|d|dg¡} | | d | ifS)Nééþÿÿÿéýÿÿÿéÿÿÿÿg@r éÚbilinearÚcenterrÚ concat_imagerÚsamples) r ÚroundÚshapeÚcomfyÚutilsÚcommon_upscaleÚmovedimÚcopyÚappendÚtorchÚzeros)Úselfr r rrrÚwidthÚheightÚpixelsZout_cpZout_cnÚtÚnrrrrrs",       z SD_4XUpscale_Conditioning.encodeN) Ú__name__Ú __module__Ú __qualname__Ú classmethodrÚ RETURN_TYPESÚ RETURN_NAMESÚFUNCTIONÚCATEGORYrrrrrrs  r)r)Ú comfy.utilsr#rÚNODE_CLASS_MAPPINGSrrrrÚs )ÿ