@@ -68,59 +68,61 @@ describeLive("comfy live", () => {
6868 ) ;
6969 } ) ;
7070
71- it . skipIf ( ! isComfyCapabilityConfigured ( { cfg : cfg as never , agentDir, capability : "image" } ) ) (
72- "runs an image workflow" ,
73- async ( ) => {
74- const provider = requireProvider ( imageProviders , "comfy" ) ;
75- const result = await provider . generateImage ( {
76- provider : "comfy" ,
77- model : "workflow" ,
78- prompt : "A tiny orange lobster icon on a clean background." ,
79- cfg : cfg as never ,
80- agentDir,
81- } ) ;
82- expect ( result . images . length ) . toBeGreaterThan ( 0 ) ;
83- expect ( result . images [ 0 ] ?. mimeType . startsWith ( "image/" ) ) . toBe ( true ) ;
84- expect ( result . images [ 0 ] ?. buffer . byteLength ) . toBeGreaterThan ( 128 ) ;
85- } ,
86- 120_000 ,
87- ) ;
71+ // Capability gates must run after beforeAll loads the isolated live config;
72+ // declaration-time skipIf checks would only see the empty placeholders above.
73+ it ( "runs an image workflow" , async ( { skip } ) => {
74+ if ( ! isComfyCapabilityConfigured ( { cfg : cfg as never , agentDir, capability : "image" } ) ) {
75+ skip ( "No Comfy image workflow is configured" ) ;
76+ return ;
77+ }
78+ const provider = requireProvider ( imageProviders , "comfy" ) ;
79+ const result = await provider . generateImage ( {
80+ provider : "comfy" ,
81+ model : "workflow" ,
82+ prompt : "A tiny orange lobster icon on a clean background." ,
83+ cfg : cfg as never ,
84+ agentDir,
85+ } ) ;
86+ expect ( result . images . length ) . toBeGreaterThan ( 0 ) ;
87+ expect ( result . images [ 0 ] ?. mimeType . startsWith ( "image/" ) ) . toBe ( true ) ;
88+ expect ( result . images [ 0 ] ?. buffer . byteLength ) . toBeGreaterThan ( 128 ) ;
89+ } , 120_000 ) ;
8890
89- it . skipIf ( ! isComfyCapabilityConfigured ( { cfg : cfg as never , agentDir , capability : "video" } ) ) (
90- "runs a video workflow" ,
91- async ( ) => {
92- const provider = requireProvider ( videoProviders , "comfy" ) ;
93- const result = await provider . generateVideo ( {
94- provider : "comfy" ,
95- model : "workflow" ,
96- prompt : "A tiny paper lobster gently waving, cinematic motion. " ,
97- cfg : cfg as never ,
98- agentDir ,
99- } ) ;
100- expect ( result . videos . length ) . toBeGreaterThan ( 0 ) ;
101- expect ( result . videos [ 0 ] ?. mimeType . startsWith ( "video/" ) ) . toBe ( true ) ;
102- expect ( result . videos [ 0 ] ?. buffer . byteLength ) . toBeGreaterThan ( 512 ) ;
103- } ,
104- 180_000 ,
105- ) ;
91+ it ( "runs a video workflow" , async ( { skip } ) => {
92+ if ( ! isComfyCapabilityConfigured ( { cfg : cfg as never , agentDir , capability : "video" } ) ) {
93+ skip ( "No Comfy video workflow is configured" ) ;
94+ return ;
95+ }
96+ const provider = requireProvider ( videoProviders , "comfy" ) ;
97+ const result = await provider . generateVideo ( {
98+ provider : "comfy " ,
99+ model : "workflow" ,
100+ prompt : "A tiny paper lobster gently waving, cinematic motion." ,
101+ cfg : cfg as never ,
102+ agentDir ,
103+ } ) ;
104+ expect ( result . videos . length ) . toBeGreaterThan ( 0 ) ;
105+ expect ( result . videos [ 0 ] ?. mimeType . startsWith ( "video/" ) ) . toBe ( true ) ;
106+ expect ( result . videos [ 0 ] ?. buffer . byteLength ) . toBeGreaterThan ( 512 ) ;
107+ } , 180_000 ) ;
106108
107- it . skipIf ( ! isComfyCapabilityConfigured ( { cfg : cfg as never , agentDir , capability : "music" } ) ) (
108- "runs a music workflow" ,
109- async ( ) => {
110- const provider = requireProvider ( musicProviders , "comfy" ) ;
111- const result = await provider . generateMusic ( {
112- provider : "comfy" ,
113- model : "workflow" ,
114- prompt : "A gentle ambient synth loop with warm analog pads. " ,
115- cfg : cfg as never ,
116- agentDir ,
117- } ) ;
118- expect ( result . tracks . length ) . toBeGreaterThan ( 0 ) ;
119- expect ( result . tracks [ 0 ] ?. mimeType . startsWith ( "audio/" ) ) . toBe ( true ) ;
120- expect ( result . tracks [ 0 ] ?. buffer . byteLength ) . toBeGreaterThan ( 512 ) ;
121- } ,
122- 180_000 ,
123- ) ;
109+ it ( "runs a music workflow" , async ( { skip } ) => {
110+ if ( ! isComfyCapabilityConfigured ( { cfg : cfg as never , agentDir , capability : "music" } ) ) {
111+ skip ( "No Comfy music workflow is configured" ) ;
112+ return ;
113+ }
114+ const provider = requireProvider ( musicProviders , "comfy" ) ;
115+ const result = await provider . generateMusic ( {
116+ provider : "comfy " ,
117+ model : "workflow" ,
118+ prompt : "A gentle ambient synth loop with warm analog pads." ,
119+ cfg : cfg as never ,
120+ agentDir ,
121+ } ) ;
122+ expect ( result . tracks . length ) . toBeGreaterThan ( 0 ) ;
123+ expect ( result . tracks [ 0 ] ?. mimeType . startsWith ( "audio/" ) ) . toBe ( true ) ;
124+ expect ( result . tracks [ 0 ] ?. buffer . byteLength ) . toBeGreaterThan ( 512 ) ;
125+ } , 180_000 ) ;
124126
125127 it ( "documents the effective comfy config shape for live debugging" , ( ) => {
126128 const comfyConfig = getComfyConfigForTesting ( cfg as never ) ;
0 commit comments