)2hVddlZddlZddlmZddlmZmZidfdZdZdZ dZ d Z dS) N)args) ImageFileUnidentifiedImageErrorFcg}|D]v}|d|dg}|D]:}||}|r#|d|d}|||z}||d|<;||w|S)Nr)copygetappend) conditioningvaluesr ctnkvalold_vals 3D:\ComfyUI_windows_portable\ComfyUI\node_helpers.pyconditioning_set_valuesrs A    qT1Q499;;   A)C (A$((1d++&!C-CAaDGG  Hcd} ||}n@#tttf$r&tj}dt_||}YnwxYw| |t_n#| |t_wxYw|S)NT)OSErrorr ValueErrorrLOAD_TRUNCATED_IMAGES)fnarg prev_valuexs rpillowrsJ9 BsGG +Z 84 *. ' BsGG  !.8I +  !.8I + 8 8 8 8 Hs& A:A  A A  AA/ctjtjtjtjd}|t jS)N)md5sha1sha256sha512)hashlibr r!r"r#rdefault_hashing_function) hashfuncss rhasherr'%s2{ .. I T2 33rcr|dkr tjS|dkr tjS|dkr tjSdS)Nfp32fp16bf16)torchfloat32float16bfloat16)strings rstring_to_torch_dtyper1.sC } } ~rc|jd|jdkr|dd|jdf}nF|jd|jdkr*tjj|d}d|d<||fS)N.)rrg?).r3)shaper,nn functionalpad) destinationsources rimage_alpha_fixr:6sv|B///2[.r2223  2 b!1 1 1h)--k6BB " G  r) r$r,comfy.cli_argsrPILrrrrr'r1r:rrr>s 1111111113E       444r