+
    #j                    "   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ]P                  P                  ^ ]! ]! ]4      P                  4       P                  4      4       ^ RIHtHtHtHtHtHtHtHt R R ltR R ltR	 R
 ltRRRRR^R^RRRRRRRRRR^ .RR^ .RR^ .RR ^ ./
/RRR!RR"R#//R RR$RR%R&R'R&R(^//RRR)RR*R+R,R^.//RRR)RR*R-R,R^.//R.RR/RR0R1R2R^ .///tR3 R4 ltR8R5 R6 llt]R78X  d   ]P>                  ! ]! 4       4       R# R# )9u:  
health_check.py — One-stop verification that the ComfyUI environment is ready.

Runs through the verification checklist:
  1. comfy-cli on PATH
  2. server reachable (/system_stats)
  3. at least one checkpoint installed
  4. (optional) a specific workflow's deps are met
  5. (optional) actually submit a tiny test workflow and verify round-trip

Usage:
    python3 health_check.py
    python3 health_check.py --host https://cloud.comfy.org
    python3 health_check.py --workflow my.json
    python3 health_check.py --smoke-test    # actually submit a tiny workflow
)annotationsN)Path)DEFAULT_LOCAL_HOSTENV_API_KEY	emit_jsonhttp_getparse_model_listresolve_api_keyresolve_urlunwrap_workflowc                   V ^8  d   QhRR/# )   returndict )formats   "f/opt/hermes-venv/lib/python3.14/site-packages/../../../skills/creative/comfyui/scripts/health_check.py__annotate__r   "   s     	 	$ 	    c                     \         P                  ! R 4      '       d   RRRR R\         P                  ! R 4      /# \         P                  ! R4      '       d	   RRRRRR/# RRRR	/# )
comfy	availableTmethodpathuvxhintz*Invoke as `uvx --from comfy-cli comfy ...`FzAInstall with: pipx install comfy-cli (or `pip install comfy-cli`))shutilwhichr   r   r   comfy_cli_statusr   "   sn    ||GT8Wffll7>STT||ET8UDF 	F 	US r   c               $    V ^8  d   QhRRRRRR/# r   hoststrheadersr   r   r   )r   s   "r   r   r   .   s&     A A Ad At Ar   c           	     j   \        V R 4      p \        W!^^
R7      pVP                  ^8X  d$    VP                  4       ;'       g    / pRRRVRV/# RRRVRVP                  RVP                  4       R	,          /#   \         d    / p L@i ; i  \         d   pRRRTR
\        T4      /u Rp?# Rp?ii ; i)z/system_statsr#   retriestimeout	reachableTurlstatsFhttp_statusbodyN   NerrorN)r
   r   statusjson	Exceptiontextr"   )r!   r#   r)   rr*   es   &&    r   server_statusr6   .   s    
dO
,C
AS1bA88s?B  uc7EBBUE3qxxQRQWQWQYZ^Q_``    AUE3Q@@AsL   B A9 A9 B (B 9B	B B		B B2B-'B2-B2c               $    V ^8  d   QhRRRRRR/# r    r   )r   s   "r   r   r   =   s!     - -C -$ -4 -r   c           	        \        V R 4      p \        W!^^R7      pTP                  ^8w  d*   RRRTP                  RTRTP                  4       R	,          /#  \        TP                  4       4      pRR
R\        T4      R\        T4      R,          /#   \         d   pRRR\        T4      /u Rp?# Rp?ii ; i  \         d    \        4       p L_i ; i)z/models/checkpointsr%   	queryableFr/   Nr+   r)   r,   r-   Tcount	first_few:N   N)r
   r   r2   r"   r0   r3   r   r1   setlensorted)r!   r#   r)   r4   r5   modelss   &&    r   checkpoint_statusrA   =   s    
d1
2C5S1bA 	xx3UM188UCQRQWQWQYZ^Q_``!!&&(+ wF+- -  5UGSV445  s/   B B8 B5B0*B50B58CC3
class_typeKSamplerinputsseedstepscfgg      @sampler_nameeuler	schedulernormaldenoiseg      ?model4positive6negative7latent_image5CheckpointLoaderSimple	ckpt_name
REPLACE_MEEmptyLatentImagewidth   height
batch_sizeCLIPTextEncoder3   testclip 9	SaveImagefilename_prefixsmokeimagesc               (    V ^8  d   QhRRRRRRRR/# )r   r!   r"   r#   r   rW   z
str | Noner   r   )r   s   "r   r   r   g   s(     " "S "4 "J "4 "r   c           
        V'       g   RRRR/# \         P                  ! \         P                  ! \        4      4      pW#R,          R,          R&   ^ RIHp VP                  R	4      pV! WR
7      pVP                  V4      pRV9   d!   RRRRRVR,          RVP                  R4      /# VP                  R4      pV'       g	   RRRRRV/# Rp	 VP                  V4      p	RRRRRVRV	RR/#   \         d     Li ; i)zSubmit a tiny workflow and verify the server accepts it.

Cancels the job immediately after acceptance so we don't burn GPU
time / cloud minutes on a smoke test.
ranFreasonzno checkpoint availablerO   rE   rW   )ComfyRunner	X-API-Keyr!   api_key_http_errorT	submittedr+   r,   	prompt_idresponsecancelled_after_submitnotezBSubmission accepted; cancelled to avoid running the full pipeline.)
r1   loadsdumpsSMOKE_WORKFLOWrun_workflowrk   getsubmitcancelr2   )
r!   r#   rW   wfrk   rn   runnersubpid	cancelleds
   &&&       r   
smoke_testr   g   s    uh(ABB	DJJ~.	/B%.sGHk" )kk+&Gd4F
--
Ct[%s=163776?L 	L
''+
Ct[%SAA IMM#&	
 	t[$S )T   s   C( (C65C6c                    V ^8  d   QhRRRR/# )r   argvzlist[str] | Noner   intr   )r   s   "r   r   r      s     O O O3 Or   c                   \         P                  ! R R7      pVP                  R\        R7       VP                  RR\         2R7       VP                  RRR7       VP                  R	R
RR7       VP                  RR
RR7       VP                  V 4      p\        VP                  4      pV'       d   RV/M/ p\        4       p\        VP                  V4      pVP                  R4      '       d   \        VP                  V4      MRpRpVP                  '       d   \        VP                  4      P                  4       p	V	P!                  4       '       g   RR/pM\ V	P#                  4       ;_uu_ 4       p
\%        \&        P(                  ! V
4      4      pRRR4       ^ RIHp V! XVP                  VR7      pRpVP2                  '       d_   VP                  R4      '       dH   V'       d(   VP                  R4      '       d   VR,          ^ ,          MRp\3        VP                  WO4      pRp. pVP                  R4      '       g   RpVP5                  R4       V'       dK   VP                  R4      '       d4   VP                  R^ 4      ^ 8X  d   VR8X  d   RMTpVP5                  R4       V'       d6   VP                  R4      '       d   RpVP5                  RVR,           24       M[V'       dT   VP                  R4      '       g=   VP                  R 4      '       d   VP5                  R!4       MRpVP5                  R"4       V'       dB   VP                  R#4      '       d+   VP                  R$4      '       g   RpVP5                  R%4       VP                  R&4      '       g   VR8X  d   RMTpVP5                  R'4       R(VR)VR*VP                  R+VR,VR-VR.VR/V/p\7        V4       VR8X  d   ^ # VR8X  d   VP8                  '       d   ^# ^ # ^#   + '       g   i     EL; i  \,        \&        P.                  3 d   pR\1        T4      /p Rp?ELRp?ii ; i)0zOne-stop ComfyUI health check)descriptionz--host)defaultz	--api-keyzor set $)helpz
--workflowz.Optional: also run check_deps on this workflowz--smoke-test
store_truez1Submit a tiny test workflow and verify round-trip)actionr   z--strictz<Exit non-zero on any non-pass condition (including warnings)rl   r(   Nr/   zworkflow file not found)
check_depsrm   r;   passfailzserver unreachabler9   r:   warnzno checkpoints installedzworkflow check failed: is_readynode_check_skippedz$node check skipped (cloud free tier)zworkflow has missing depsri   rp   zsmoke-test submission failedr   z5comfy-cli not on PATH (lifecycle commands won't work)verdictreasonsr!   	comfy_cliservercheckpointsworkflow_checkr   )argparseArgumentParseradd_argumentr   r   
parse_argsr	   rn   r   r6   r!   ry   rA   workflowr   
expanduserexistsopenr   r1   loadr   
ValueErrorJSONDecodeErrorr"   r   appendr   strict)r   pargsrn   r#   clir   ckptsr   wf_pathfr   r   r5   re   
first_ckptr   r   reports   &                  r   mainr      s   ,KLANN8%7N8NN;x}%=N>NN<&VNWNN>,K  MNN:lV  X<<Ddll+G(/{G$RG

C499g.F5;ZZ5L5Ldii1RVE #'N}}}t}}%002~~%'@AN3\\^^q.tyy|<H $1!+H499g!V E6::k22.3		+8N8NU;'*TX
499g: GG::k""+,;''EIIgq,AQ,F#v-&712.,,W5501H0IJK	 2 2: > >233NNABGNN675!!%))K*@*@5677;#v-&7NO 	77		S&u.e	F f&&KKKq&Q&k $^^  4 45 3")3q6!23s0   P 2 P
#P 
P		P Q9QQ__main__)N) __doc__
__future__r   r   r1   r   syspathlibr   r   insertr"   __file__resolveparent_commonr   r   r   r   r   r	   r
   r   r   r6   rA   rw   r   r   __name__exitr   r   r   <module>r      s  " #    
  3tH~--/667 8  	A-( jAw5#G[(Isc1XzC8Z#qS!H	

 ,0
[,/
1,*
Wc8S,B
D,(
VVVc1X6
8,(
VR#q2
4,
&C8D
F+4"JOd zHHTV r   