@@ -333,32 +333,31 @@ public async Task<ComfyTask> QueuePromptAsync(
333333{
334334 var request = new ComfyPromptRequest { ClientId = ClientId , Prompt = nodes } ;
335335
336- // DEBUG: dump final workflow JSON
337- try
338- {
339- var json = JsonSerializer . Serialize ( request , jsonSerializerOptions ) ;
336+ #if DEBUG
337+ try
338+ {
339+ var json = JsonSerializer . Serialize ( request , jsonSerializerOptions ) ;
340340
341- var debugDir = Path . Combine (
342- Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) ,
343- "StabilityMatrix" ,
344- "Debug"
345- ) ;
341+ var debugDir = Path . Combine (
342+ Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) ,
343+ "StabilityMatrix" ,
344+ "Debug"
345+ ) ;
346346
347- Directory . CreateDirectory ( debugDir ) ;
347+ Directory . CreateDirectory ( debugDir ) ;
348348
349- var path = Path . Combine (
350- debugDir ,
351- $ "wan_workflow_debug_request.json"
352- ) ;
349+ var path = Path . Combine ( debugDir , "wan_workflow_debug_request.json" ) ;
353350
354- File . WriteAllText ( path , json ) ;
351+ File . WriteAllText ( path , json ) ;
352+
353+ Logger . Debug ( "WAN DEBUG: Dumped final request JSON to {0}" , path ) ;
354+ }
355+ catch ( Exception ex )
356+ {
357+ Logger . Error ( ex , "WAN DEBUG: Failed to dump final request JSON" ) ;
358+ }
359+ #endif
355360
356- Logger . Warn ( "WAN DEBUG: Dumped final request JSON to {0}" , path ) ;
357- }
358- catch ( Exception ex )
359- {
360- Logger . Error ( ex , "WAN DEBUG: Failed to dump final request JSON" ) ;
361- }
362361
363362 var result = await comfyApi . PostPrompt ( request , cancellationToken ) . ConfigureAwait ( false ) ;
364363
0 commit comments