+
    #j*"                        R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
Ht  ! R R4      t ! R R4      t ! R	 R
4      t ! R R4      tR# )uM   Tests for run_workflow.py — focuses on logic that doesn't require a server.)annotationsN)extract_schema)ComfyRunnerdownload_outputsinject_paramsparse_input_image_argc                  (    ] tR t^tR tR tR tRtR# )TestParseInputImageArgc                	|    VR ,          pVP                  R4       \        RV 24      w  r4VR8X  g   Q hWB8X  g   Q hR# )x.pngxzimage=imageN
write_textr   selftmp_pathfnps   &&   i/opt/hermes-venv/lib/python3.14/site-packages/../../../skills/creative/comfyui/tests/test_run_workflow.pytest_with_name%TestParseInputImageArg.test_with_name   s?    w	S$vaS\2G||vv    c                	x    VR ,          pVP                  R4       \        \        V4      4      w  r4VR8X  g   Q hR# )r   r   r   N)r   r   strr   s   &&   r   test_without_name_defaults1TestParseInputImageArg.test_without_name_defaults   s4    w	S$SV,G||r   c                	l    VR ,          pVP                  R4       \        RV 24      w  r4VR8X  g   Q hR# )r   r   zmask_image=
mask_imageNr   r   s   &&   r   test_custom_name'TestParseInputImageArg.test_custom_name!   s9    w	S${1#%67L   r    N)__name__
__module____qualname____firstlineno__r   r   r    __static_attributes__r"   r   r   r	   r	      s    !r   r	   c                  :    ] tR t^(tR tR tR tR tR tR t	Rt
R# )	TestInjectParamsc           
     	
   \        V4      p\        WR RRRR^/4      w  r4VR,          R,          R,          R8X  g   Q hVR,          R,          R,          R8X  g   Q hVR,          R,          R,          ^8X  g   Q hV. 8X  g   Q hR	# )
promptz
new promptseedi  steps6inputstext3Nr   r   r   sd15_workflowschemawfwarningss   &&   r   test_basic_injection%TestInjectParams.test_basic_injection)   s    .$]lCR=
 
 #wx (L888#wx (C///#wx )R///2~~r   c                	    \        V4      p\        WR R/4      w  r4\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g   Q hR# )foobarr   c              3  ,   "   T F
  pR V9   x  K  	  R# 5i)r;   Nr"   .0ws   & r   	<genexpr><TestInjectParams.test_unknown_param_warns.<locals>.<genexpr>8   s     3(Q8q=(   TFN)r   r   any)r   r4   r5   _r7   s   &&   r   test_unknown_param_warns)TestInjectParams.test_unknown_param_warns5   sE    .#MHc?Ks3(3sss3(33333r   c                	J   \        V4      p\        WR R/4      w  r4VR,          R,          R ,          R8w  g   Q h\        VR,          R,          R ,          \        4      '       g   Q h\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g   Q hR# )r,   r1   r/   c              3  H   "   T F  pR VP                  4       9   x  K  	  R# 5i)expandedNlowerr=   s   & r   r@   BTestInjectParams.test_seed_minus_one_randomizes.<locals>.<genexpr>?   s     =Hq:*H    "TFN)r   r   
isinstanceintrC   r3   s   &&   r   test_seed_minus_one_randomizes/TestInjectParams.test_seed_minus_one_randomizes:   s    .$]VRLI#wx (B..."S'(+F3S9999s=H=sss=H=====r   c                	    \        V4      pVR ,          R,          R,          p\        W/ RR7      w  rEVR ,          R,          R,          V8w  g   Q h\        VR ,          R,          R,          \        4      '       g   Q hR# )r1   r/   r,   T)randomize_seed_if_unsetN)r   r   rO   rP   )r   r4   r5   originalr6   r7   s   &&    r   test_randomize_seed_when_unset/TestInjectParams.test_randomize_seed_when_unsetA   sn    . %h/7$]BX\]#wx (H444"S'(+F3S9999r   c                	    \        V4      pVR ,          R,          R,          p\        WRR/4       VR ,          R,          R,          V8X  g   Q hR# )r.   r/   r0   r+   MUTATEDNr2   )r   r4   r5   original_texts   &&  r   test_does_not_mutate_original.TestInjectParams.test_does_not_mutate_originalH   sL    .%c*84V<mh	-BCS!(+F3}DDDr   c                	   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^ .///pR$R%R&RR'RR(R)R*R+///p\        WR%R,/4      w  r4VR,          R,          R,          R^ .8X  g   Q h\        ;QJ d    R- V 4       F  '       g   K   R.M	  R/M! R- V 4       4      '       g   Q hR0# )11
class_typeCheckpointLoaderSimpler/   	ckpt_namer   5EmptyLatentImagewidthi   height
batch_sizer.   CLIPTextEncoder0   r1   clipKSamplerr,   r-   cfgg      @sampler_nameeuler	schedulernormaldenoiseg      ?modelpositivenegativelatent_image9	SaveImagefilename_prefiximages
parametersr+   node_idfieldtypestringvalue zliteral valuec              3  H   "   T F  pR VP                  4       9   x  K  	  R# 5i)linkNrJ   r=   s   & r   r@   BTestInjectParams.test_refuses_to_overwrite_link.<locals>.<genexpr>e   s     916QWWY&rM   TFN)r   rC   )r   r6   r5   wf2r7   s   &    r   test_refuses_to_overwrite_link/TestInjectParams.test_refuses_to_overwrite_linkN   s[   , 8([RUDVW, 2Wc8S,JL, 0Vc1XvQx@B,
VQUC+Wk8YX[$sAh
S!HjSVXYRZ+c1X78
 ,X8I3PX[^`aZb7cd
 9c7FFHgWYZ

 &b8_2MN3x!&)c1X555s99sss999999r   r"   N)r#   r$   r%   r&   r8   rE   rQ   rV   r[   r   r'   r"   r   r   r)   r)   (   s!    
4
>:E:r   r)   c                  ,    ] tR t^ltRtR tR tR tRtR# )TestDownloadOutputsWalkz9Test that download_outputs walks the structure correctly.c                   a . o ! V3R lR4      pRRRRRRR	R
/./RRRRRRR	R
/./RRRRRRR	R
/.//p\        V! 4       WA4      p\        R V 4       4      pV. RO8X  g   Q hR# )z1Local ComfyUI uses 'videos'/'gifs' (plural) keys.c                  $   < ] tR t^stV 3R ltRtR# )FTestDownloadOutputsWalk.test_handles_videos_plural.<locals>.FakeRunnerc               	   < SP                  WV34       WA,          pVP                  P                  R R R7       VP                  R4       V# T)parentsexist_ok   x)appendparentmkdirwrite_bytes)	r   filename	subfolder	file_type
output_dirpreserve_subfolder	overwriter   	downloadss	   &$$$$$$ r   download_outputVTestDownloadOutputsWalk.test_handles_videos_plural.<locals>.FakeRunner.download_outputt   sC      (y!AB)td;d#r   r"   Nr#   r$   r%   r&   r   r'   )r   s   r   
FakeRunnerr   s   s     r   r   rt   rw   r   img1.pngr   r~   r{   output10videosvid1.mp411gifs	anim1.gifc              3  2   "   T F  qR ,          x  K  	  R# 5i)r   Nr"   )r>   ds   & r   r@   ETestDownloadOutputsWalk.test_handles_videos_plural.<locals>.<genexpr>   s     5f}}fs   N)r   r   r   )r   sorted)r   r   monkeypatchr   outputsresultfilesr   s   &&&    @r   test_handles_videos_plural2TestDownloadOutputsWalk.test_handles_videos_pluralo   s    		 	 (j*k2vxXYZ8z:{BPXYZ[6Zk2vxXYZ
 "*,B5f55====r   c                     ! R R4      pRRRRRRR	R
/.//p\        V! 4       W14      p\        V4      ^8X  g   Q hV^ ,          R,          R8X  g   Q hR# )zCloud uses 'video' (singular).c                      ] tR t^tR tRtR# )MTestDownloadOutputsWalk.test_handles_video_singular_cloud.<locals>.FakeRunnerc               	r    WA,          pVP                   P                  R R R7       VP                  R4       V# r   r   r   r   r   r   r   r   r   r   r   r   s   &$$$$$$ r   r   ]TestDownloadOutputsWalk.test_handles_video_singular_cloud.<locals>.FakeRunner.download_output   s/    )td;d#r   r"   Nr   r"   r   r   r   r      s    r   r   r   videor   z	cloud.mp4r   r~   r{   r   N)r   len)r   r   r   r   r   s   &&   r   !test_handles_video_singular_cloud9TestDownloadOutputsWalk.test_handles_video_singular_cloud   si    	 	 7j+{BPXYZ[
 "*,B6{aay$333r   c           	         ! R R4      pRRRRRRR	R
/RRRRR	R
/.//p\        V! 4       W1RR7      pV Uu. uF  qUR,          NK  	  pp\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g   Q h\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g   Q h\        V Uu0 uF  p\        V4      kK  	  up4      ^8X  g   Q hR# u upi u upi )zDWhen preserve_subfolder=True, server subfolder becomes local subdir.c                      ] tR t^tR tRtR# )DTestDownloadOutputsWalk.test_preserves_subfolder.<locals>.FakeRunnerc               	    V'       d   V'       d   WB,          V,          pMWA,          pVP                   P                  R R R7       VP                  R4       V# r   r   r   s   &$$$$$$ r   r   TTestDownloadOutputsWalk.test_preserves_subfolder.<locals>.FakeRunner.download_output   sA    %)".9A"-Atd;d#r   r"   Nr   r"   r   r   r   r      s    r   r   rt   rw   r   zimg.pngr   myrunr{   r   otherrunT)r   filec              3  ,   "   T F
  pR V9   x  K  	  R# 5i)r   Nr"   r>   r   s   & r   r@   CTestDownloadOutputsWalk.test_preserves_subfolder.<locals>.<genexpr>   s     /A7a<rB   Fc              3  ,   "   T F
  pR V9   x  K  	  R# 5i)r   Nr"   r   s   & r   r@   r      s     2Eq:?ErB   N)r   rC   r   r   )r   r   r   r   r   r   r   r   s   &&      r   test_preserves_subfolder0TestDownloadOutputsWalk.test_preserves_subfolder   s    	 	 (YWfhOYZR 
 "*,VZ[$*+Fq6F+s//sss//////s2E2sss2E22222E*EqCFE*+q000	 , +s   C.
C3r"   N)	r#   r$   r%   r&   __doc__r   r   r   r'   r"   r   r   r   r   l   s    C>,4 1r   r   c                  @    ] tR t^tR tR tR tR tR tR t	R t
RtR	# )
TestRunnerConstructionc                	d    \        4       pVP                  R J g   Q hVP                  R8X  g   Q hR# )Fzhttp://127.0.0.1:8188N)r   is_cloudhostr   rs   & r   test_local_default)TestRunnerConstruction.test_local_default   s.    MzzU"""vv0000r   c                	j    \        R RR7      pVP                  RJ g   Q hRVP                  9   g   Q hR# )https://cloud.comfy.orgabcr   api_keyTz	X-API-KeyN)r   r   headersr   s   & r   test_cloud_detection+TestRunnerConstruction.test_cloud_detection   s3    6FzzT!!!aii'''r   c                	D    \        R RR7      pVP                  RJ g   Q hR# )zhttps://staging.cloud.comfy.orgr   r   TN)r   r   r   s   & r   test_cloud_subdomain_detected4TestRunnerConstruction.test_cloud_subdomain_detected   s!    >NzzT!!!r   c                	@    \        R RR7      pVP                  e   Q hR# )r   zauth-keyr   N)r   partner_keyr   s   & r   ,test_partner_key_does_not_pollute_extra_dataCTestRunnerConstruction.test_partner_key_does_not_pollute_extra_data   s!    6
K }}$$$r   c                	N    \        4       pVP                  R 4      pVR8X  g   Q hR# )/promptzhttp://127.0.0.1:8188/promptNr   _urlr   r   urls   &  r   test_url_routing_local-TestRunnerConstruction.test_url_routing_local   s&    MffY4444r   c                	T    \        R RR7      pVP                  R4      pVR8X  g   Q hR# )r   r   r   r   z"https://cloud.comfy.org/api/promptNr   r   s   &  r   test_url_routing_cloud-TestRunnerConstruction.test_url_routing_cloud   s,    6DffY::::r   c                	T    \        R RR7      pVP                  R4      pVR8X  g   Q hR# )r   r   r   z/history/abc-123z.https://cloud.comfy.org/api/history_v2/abc-123Nr   r   s   &  r   &test_url_routing_cloud_history_renamed=TestRunnerConstruction.test_url_routing_cloud_history_renamed   s-    6Dff'(FFFFr   r"   N)r#   r$   r%   r&   r   r   r   r   r   r   r   r'   r"   r   r   r   r      s&    1
(
"%5
;
Gr   r   )r   
__future__r   copyjsonpytestr   run_workflowr   r   r   r   r	   r)   r   r   r"   r   r   <module>r      sO    S "    ) ! !*=: =:H@1 @1N"G "Gr   