o Ô>õgAã@s*ddlZGdd„dƒZdeiZddiZdS)éNc@sJeZdZedd„ƒZdZdZdZdZdd„Z d e j d e j d e fd d „Z dS)ÚDifferentialDiffusioncCs dddiiS)NÚrequiredÚmodel©ÚMODEL©)ÚsrrúS/home/comdoleger1/zen-flux-style-shape/comfy_extras/nodes_differential_diffusion.pyÚ INPUT_TYPESs z!DifferentialDiffusion.INPUT_TYPESrÚapplyÚ _for_testingFcCs| ¡}| |j¡|fS)N)ÚcloneÚset_model_denoise_mask_functionÚforward)Úselfrrrr r s zDifferentialDiffusion.applyÚsigmaÚ denoise_maskÚ extra_optionsc Cs„|d}|d}|jjj}|d|kr|d}|d}|jj |¡}|jj |¡} |jj |d¡} | | || } || k |j¡S)NrÚsigmaséÿÿÿÿr)Ú inner_modelÚmodel_samplingÚ sigma_minÚtimestepÚtoÚdtype) rrrrrZ step_sigmasÚsigma_toÚ sigma_fromZts_fromZts_toZ current_tsÚ thresholdrrr rs  zDifferentialDiffusion.forwardN)Ú__name__Ú __module__Ú __qualname__Ú classmethodr Ú RETURN_TYPESÚFUNCTIONÚCATEGORYÚINITr ÚtorchÚTensorÚdictrrrrr rs rzDifferential Diffusion)r'rÚNODE_CLASS_MAPPINGSÚNODE_DISPLAY_NAME_MAPPINGSrrrr Ús !ÿÿ