@@ -52,7 +52,7 @@ return false;
5252
5353let isOnline = false ;
5454async function comfyui_monitorConnection_v2 ( ) {
55- console . log ( "comfyui_monitorConnection_v2" ) ;
55+ comfyuiLogger . debug ( "comfyui_monitorConnection_v2" ) ;
5656while ( true ) {
5757const currentStatus = await comfyui_apiHeartbeat_v2 ( ) ;
5858if ( currentStatus !== isOnline ) {
@@ -143,7 +143,7 @@ workflow[nodeId].inputs[inputName]=uploadResult.name;
143143}
144144}
145145} catch ( error ) {
146- console . error ( "ファイルアップロードエラー:" , error ) ;
146+ comfyuiLogger . error ( "ファイルアップロードエラー:" , error ) ;
147147}
148148}
149149
@@ -165,15 +165,15 @@ throw new Error(`HTTPエラー! ステータス: ${response.status}`);
165165const blob = await response . blob ( ) ;
166166return URL . createObjectURL ( blob ) ;
167167} catch ( error ) {
168- console . error ( "画像取得エラー:" , error ) ;
168+ comfyuiLogger . error ( "画像取得エラー:" , error ) ;
169169return null ;
170170}
171171}
172172
173173async function comfyui_fixWorkflowTypes_v2 ( workflow ) {
174174const objectInfo = await objectInfoRepository . getObjectInfo ( ) ;
175175if ( ! objectInfo ) {
176- console . warn ( "ObjectInfo not available, skipping type fix" ) ;
176+ comfyuiLogger . warn ( "ObjectInfo not available, skipping type fix" ) ;
177177return workflow ;
178178}
179179const fixed = JSON . parse ( JSON . stringify ( workflow ) ) ;
@@ -255,7 +255,7 @@ subfolder: imageDataToReceive.subfolder,
255255type : imageDataToReceive . type ,
256256} ) ;
257257const response = await fetch ( comfyUIUrls . view + "?" + params . toString ( ) ) ;
258- console . log ( "画像データをサーバーから取得しました。" ,
258+ comfyuiLogger . debug ( "画像データをサーバーから取得しました。" ,
259259imageDataToReceive . filename ,
260260imageDataToReceive . subfolder ,
261261imageDataToReceive . type , ) ;
@@ -266,11 +266,11 @@ throw new Error(`HTTPエラー! ステータス: ${response.status}`);
266266
267267const blob = await response . blob ( ) ;
268268const imageSrc = URL . createObjectURL ( blob ) ;
269- console . log ( "画像ソース:" , imageSrc ) ;
269+ comfyuiLogger . debug ( "画像ソース:" , imageSrc ) ;
270270
271271return imageSrc ;
272272} catch ( error ) {
273- console . error ( "画像取得エラー:" , error ) ;
273+ comfyuiLogger . error ( "画像取得エラー:" , error ) ;
274274return null ;
275275}
276276}
@@ -307,10 +307,10 @@ errorMessage.traceback=Array.isArray(errorDetails.traceback)
307307}
308308}
309309
310- console . log ( "comfyui_getErrorMessage_v2 returning:" , errorMessage ) ;
310+ comfyuiLogger . debug ( "comfyui_getErrorMessage_v2 returning:" , errorMessage ) ;
311311return errorMessage ;
312312}
313- console . log ( "comfyui_getErrorMessage_v2 returning null" ) ;
313+ comfyuiLogger . debug ( "comfyui_getErrorMessage_v2 returning null" ) ;
314314return null ;
315315}
316316
@@ -346,14 +346,14 @@ errorMessage+=error.message;
346346errorMessage += "check COMFYUI!" ;
347347}
348348
349- console . error ( "Error details:" , error ) ;
349+ comfyuiLogger . error ( "Error details:" , error ) ;
350350createToastError ( errorMessage ) ;
351351return null ;
352352}
353353}
354354
355355async function comfyui_get_history_v2 ( promptId ) {
356- console . log (
356+ comfyuiLogger . debug (
357357"comfyui_get_history_v2関数が呼び出されました。プロンプトID:" ,
358358promptId
359359) ;
@@ -364,12 +364,12 @@ headers: {
364364accept : "application/json" ,
365365} ,
366366} ) ;
367- console . log ( "サーバーに履歴データをリクエストしました。" ) ;
367+ comfyuiLogger . debug ( "サーバーに履歴データをリクエストしました。" ) ;
368368const data = await response . json ( ) ;
369- console . log ( "履歴データ:" , data ) ;
369+ comfyuiLogger . debug ( "履歴データ:" , data ) ;
370370return data ;
371371} catch ( error ) {
372- console . log ( "Text2Imageエラー:" , error ) ;
372+ comfyuiLogger . error ( "Text2Imageエラー:" , error ) ;
373373createToastError ( "Text2Image Error." , "check COMFYUI!" ) ;
374374return null ;
375375}
@@ -409,11 +409,11 @@ const promptId=Object.keys(response)[0];
409409if ( promptId && response [ promptId ] && response [ promptId ] . status ) {
410410const status = response [ promptId ] . status ;
411411const result = status . status_str === "error" ;
412- console . log ( "comfyui_isError_v2 return" , result ) ;
412+ comfyuiLogger . debug ( "comfyui_isError_v2 return" , result ) ;
413413return result ;
414414}
415415}
416- console . log ( "comfyui_isError_v2 return false" ) ;
416+ comfyuiLogger . debug ( "comfyui_isError_v2 return false" ) ;
417417return false ;
418418}
419419
0 commit comments