)2h\/,ddlZejddlZddlZddlZddlZddl m Z ddl m Z ddl Z ddlZddlZddlZedkrdejd<dejd<e e je jd Zd ZeeddlZddlZddlZddlZejd kr$ejd d edkre jXe e jejd<e e jejd<ej!d"e je j#7e j#ejd<ej!d"e j#e j$rdejvr dejd<ddl%Z%ddl&Zddl'Z'ddl(Z(ddl(m)Z)ddl*Z*ddl+Zddl,Z,ddl Z-ddl.Z.dZ/dZ0d"dZ1dZ2dZ3d#dZ4edkrej!d"ej5ej!d "e,j6e4\Z7Z8Z9 e9Z:e-j;<e7=e:n#e>$rej!d!YnwxYwe3dSdS)$N)args) setup_logger__main__1HF_HUB_DISABLE_TELEMETRY DO_NOT_TRACK) log_level use_stdoutctjtjtjt d}tj|rtj |tj r:tj tj D]!}tj |"tjrTtjtj}t!jd|t%j|t%jdtjt%jdt%jdtjt%jdt%jdtjt%jdt%jdtjt%jdt%jdtjt%jdtjrTtjtj}t!jd|t%j|tjrVtjtj}t!jd |t%j|dSdS) Nzextra_model_paths.yamlzSetting output directory to: checkpointsclipvaediffusion_modelsloraszSetting input directory to: zSetting user directory to: )ospathjoindirnamerealpath__file__isfileutils extra_configload_extra_path_configrextra_model_paths_config itertoolschainoutput_directoryabspathlogginginfo folder_pathsset_output_directoryadd_model_folder_pathget_output_directoryinput_directoryset_input_directoryuser_directoryset_user_directory)extra_model_paths_config_path config_path output_dir input_diruser_dirs +D:\ComfyUI_windows_portable\ComfyUI\main.pyapply_custom_pathsr0s$&GLLAQAQRZA[A[1\1\^v$w$w! w~~344Q 112OPPP $C$?D,IJ C CK   5 5k B B B B 6W__T%:;;  AZAABBB)*555&}bgll>>'1111122c ~d}tjrdStjd}|D]}t j|}g}|D]}tj||}tj|s| ds|dkr]tj|d}tj |rJtj }||} | tj |z || ft|dkr~tjdt#|D]D} | drd } nd } tjd | d| | d Etjd dSdS) Ncjtj|d} tj||}tj|}|j|dS#t$r$}tj d|d|Yd}~nd}~wwxYwdS)NrTz"Failed to execute startup-script: z / F) rrsplitext importlibutilspec_from_file_locationmodule_from_specloader exec_module Exceptionr error) script_path module_namespecmodulees r/execute_scriptz1execute_prestartup_script..execute_script;sg&&{33A6  T>99+{SSD^44T::F K # #F + + +4 T T T MR{RRqRR S S S S S S S S TusAB B0 B++B0 custom_nodesz .disabled __pycache__zprestartup_script.pyrz# Prestartup times for custom nodes:z (PRESTARTUP FAILED)z{:6.1f} seconds{}: {})rdisable_all_custom_nodesr"get_folder_pathsrlistdirrrrendswithexiststime perf_counterappendlenr r!sortedformat) rB node_pathscustom_node_pathpossible_modulesnode_prestartup_timespossible_module module_pathr= time_beforesuccessnimport_messages r/execute_prestartup_scriptr]:s    $.~>>J& h h:&677 "/ h hO',,'7IIKw~~k** k.B.B;.O.O S^boSoSo',,{4JKKKw~~k** h"/11 (.55%,,d.?.A.AK.OQ\^e-fggg h !!A%% ;<<<-.. U UAt 8!#!7 L077!naPQdSS T T T T R&%r1ntxformersc.d|vS)Nz"A matching Triton is not available) getMessage)records r/rcns;_gmgxgxgzgz;zr1CUDA_VISIBLE_DEVICESHIP_VISIBLE_DEVICESzSet cuda device to: {}ONEAPI_DEVICE_SELECTORz!Set oneapi device selector to: {}CUBLAS_WORKSPACE_CONFIGz:4096:8)BinaryEventTypesctj}tj|}d}d|vr-tjD]}||vrd} |rt jddSdSdS)NFcudaMallocAsyncTz WARNING: this card most likely does not support cuda-malloc, if you get "CUDA error" please run ComfyUI with: --disable-cuda-malloc )comfymodel_managementget_torch_deviceget_torch_device_name cuda_malloc blacklistr warning)device device_namecuda_malloc_warningbs r/rtrts  # 4 4 6 6F(>>vFFKK''& + +AK&*#  i Oh i i i i i (' i ir1c 4d}tjj}tjdkrtjj}ntjrtjj}tj||tj}d}d}d} d}|rt|||z z d}| |} | | \} } tj } | d } | |_ || d | | d | d d}|| |jtj|jrd nd|j|j|j|dd| d|jtj }|| z }t/jd||}| dd}| d|r"t6jd}d}|r|d}d}|rdtj }||z |krHt?j t6j!|}d}tEj#)Ngr) cache_type cache_sizeFg$@Tg@@)timeoutrGrErZr<) status_str completedmessages)status executing)node prompt_idz!Prompt executed in {:.2f} seconds free_memory unload_models)$ execution CacheTypeCLASSICr cache_lruLRU cache_noneDEPENDENCY_AWAREPromptExecutormaxgetrMrNlast_prompt_idexecute task_donehistory_result PromptQueueExecutionStatusrZstatus_messages client_id send_syncr r!rR get_flagsrkrlunload_all_modelsresetgccollectsoft_empty_cachehook_breaker_ac10a0restore_functions)qserver_instance current_timerwrAlast_gc_collectneed_gcgc_collect_intervalry queue_itemitemitem_idexecution_start_timerexecution_timeflagsrs r/ prompt_workerrsL$,J ~(, :(9  ZTXTbcccAOG/8  W-1OPRUVVGUU7U++  !&MD'#'#4#6#6 QI-6O * IId1gy$q'47 ; ; ;G KK((4DD45I'Jyy7&'i%&%6 E 8 8  9 9 9 (4))+S\7]7]_n_xyyy,..L),@@N L<CCNSS T T T ii u55 99_k 2 2  " 4 4 6 6 6GO  GGIIIGO  8,..L.2EEE &77999".#5777_/8r1rFTcKg}|dD]}|||ftj|||||d{VdS)N,)splitrOasynciogatherstart_multi_address publish_loop)raddressportverbose call_on_start addressesaddrs r/runrsI c""''$&&&& .++I}gNNP_PlPlPnPn  r1cPfd}tj|dS)Nctj||jjd}d|j|(tj|jdSdS)N)valuerrrprogress) rkrl)throw_exception_if_processing_interruptedr last_node_idrrrhUNENCODED_PREVIEW_IMAGE)rtotal preview_imagerrs r/hookzhijack_progress..hooks HHJJJ"5?]gvhDEE!!*h8QRRR  $  % %&6&NP]_n_x y y y y y % $r1)rkrset_progress_bar_global_hook)rrs` r/hijack_progressrs?zzzzz K,,T22222r1ctj}tj|rt j|ddSdS)NT) ignore_errors)r"get_temp_directoryrrrLshutilrmtree)temp_dirs r/ cleanup_temprsK.00H w~~h4 hd33333344r1c"tjrrtjtjtjd}t jd|tj |ttj r! ddl }| n#YnxYw|s'tj}tj|t#j|t'jt+jtj tj t'jt5t9t;jt>dj f!tj"rtGdtj$tj%ddtj&rd }|fd }||fS) z Starts the ComfyUI server using the provided asyncio event loop or creates a new one. Returns the event loop, server instance, and a function to start the server asynchronously. tempzSetting temp directory to: rN)init_custom_nodesinit_api_nodesT)targetdaemonr)exist_okcddl}tjdkr|dkrd}d|vrd|}||d|d|dS)Nrr^z0.0.0.0z 127.0.0.1:z[{}]z://) webbrowserrnamerRopen)schemerrrs r/startup_serverz%start_comfyui..startup_serversp    w$7i#7#7%g~~ --00 OOv::'::D:: ; ; ; ; ;r1cKd{Vttjtjtj d{VdS)N)rrrr)setuprrlistenrdont_print_server)r prompt_serversr/ start_allz start_comfyui..start_all"s!!#########-49RVRhNhyFGGG G G G G G G G G Gr1)'rtemp_directoryrrrrr r!r"set_temp_directoryrwindows_standalone_build new_updaterupdate_windows_updaterrnew_event_loopset_event_loopserver PromptServerrsave_functionsnodesinit_extra_nodesrHdisable_api_nodesrrt add_routesr threadingThreadr prompt_queuestartquick_test_for_ciexitmakedirsr auto_launch) asyncio_looprrrrrrs @@r/ start_comfyuirs  27<<0C D DfMM =8==>>>'111NNN $       . . 0 0 0 0  D --// |,,,' 55M&((( 1N-Ncgcy_yzzzz)+++M""" M$m>XZg=ijjjpprrr  QK /11DAAAAM ' < < <' GGGGGG  11s B55B9zPython version: {}zComfyUI version: {}z Stopped server)rFrTN)N)? comfy.optionsrkoptionsenable_args_parsingrimportlib.utilr5r"rMcomfy.cli_argsr app.loggerrrutils.extra_configrr sys__name__environr log_stdoutr0r]rrrrr getLogger addFilter cuda_devicestrr!rRoneapi_device_selector deterministicro comfy.utilsrrrhrcomfy.model_managementcomfyui_versionapprrtrrrrrversion __version__ event_loop_start_all_funcxloggerprint_startup_warningsrun_until_completeKeyboardInterruptr1r/rs !!###  ######  z-0BJ)*!$BJ~ t|@@@@ 2 2 2F&&&P  7d??Gj!!++,z,z{{{ z #-0S1A-B-B )*,/C0@,A,A () -44T5EFFGGG "./3/J +, 8??@[\\]]] > $BJ 6 64=BJ0 1 ######  i i i<8<8<8~ 3 3 3444 62626262r zGL%,,S[99:::GL&--o.IJJKKK$1MOO!J>) N   ))+++%%a(((( ))) '((((()LNNNNNs48I--JJ