@@ -83,13 +83,13 @@ state.core = (function () {
8383
8484 function fn_timer ( ) {
8585
86- fetch ( '/lightspeedflow /local/need_preload' )
86+ fetch ( '/lightdiffusionflow /local/need_preload' )
8787 . then ( response => response . json ( ) )
8888 . then ( data => {
8989 //console.log(`fn_timer ${data}`)
9090 if ( data != "" ) {
91- //state.core.actions.handleLightSpeedFlow ([{"name":data}]);
92- const btn1 = gradioApp ( ) . querySelector ( `button#set_lightspeedflow_file ` ) ;
91+ //state.core.actions.handleLightDiffusionFlow ([{"name":data}]);
92+ const btn1 = gradioApp ( ) . querySelector ( `button#set_lightdiffusionflow_file ` ) ;
9393 state . utils . triggerMouseEvent ( btn1 ) ;
9494 setTimeout ( ( ) => {
9595 const btn2 = gradioApp ( ) . querySelector ( `button#preload_button` ) ;
@@ -107,9 +107,9 @@ state.core = (function () {
107107 function init ( ) {
108108
109109 //console.log(window.localization)
110- fetch ( '/lightspeedflow /local/refresh_ui' ) // 刷新页面触发python重置图片数据
110+ fetch ( '/lightdiffusionflow /local/refresh_ui' ) // 刷新页面触发python重置图片数据
111111
112- fetch ( '/lightspeedflow /local/get_imgs_elem_key' ) //初始化部分图片组件id, 后续设置onchanged事件
112+ fetch ( '/lightdiffusionflow /local/get_imgs_elem_key' ) //初始化部分图片组件id, 后续设置onchanged事件
113113 . then ( response => response . json ( ) )
114114 . then ( data => {
115115 img_elem_keys = data . split ( "," )
@@ -118,7 +118,7 @@ state.core = (function () {
118118 } ) ;
119119
120120 // 等上面的组件ID同步过来后 再加载其他配置
121- fetch ( '/lightspeedflow /local/config.json?_=' + ( + new Date ( ) ) )
121+ fetch ( '/lightdiffusionflow /local/config.json?_=' + ( + new Date ( ) ) )
122122 . then ( response => response . json ( ) )
123123 . then ( config => {
124124 try {
@@ -477,7 +477,7 @@ state.core = (function () {
477477 // }
478478 // },
479479 applyState : function ( ) {
480- fetch ( '/lightspeedflow /local/config.json?_=' + ( + new Date ( ) ) )
480+ fetch ( '/lightdiffusionflow /local/config.json?_=' + ( + new Date ( ) ) )
481481 . then ( response => response . json ( ) )
482482 . then ( config => {
483483 try {
@@ -533,7 +533,7 @@ state.core = (function () {
533533 store . set ( `img2img_seed` , state . utils . getCurSeed ( 'img2img' ) )
534534 }
535535
536- fetch ( '/lightspeedflow /local/lightspeedflow_config ?onlyimg=true' )
536+ fetch ( '/lightdiffusionflow /local/lightdiffusionflow_config ?onlyimg=true' )
537537 . then ( response => response . json ( ) )
538538 . then ( config => {
539539 config = JSON . parse ( config )
@@ -562,18 +562,18 @@ state.core = (function () {
562562 } ) . catch ( error => console . error ( '[state]: Error getting JSON file:' , error ) ) ;
563563
564564 //config = JSON.stringify(store.getAll(), null, 4);
565- //fetch(`/lightspeedflow /local/ExportLightSpeedFlow ?config=${config}`)
565+ //fetch(`/lightdiffusionflow /local/ExportLightDiffusionFlow ?config=${config}`)
566566 } ,
567567
568- handleLightSpeedFlow : function ( fileInput ) {
568+ handleLightDiffusionFlow : function ( fileInput ) {
569569 actions . output_log ( "Start parsing settings..." )
570570 console . log ( fileInput )
571571 let temp_fileInput = undefined
572572 try { temp_fileInput = fileInput [ 0 ] } catch ( error ) { }
573573 if ( ! temp_fileInput ) { temp_fileInput = fileInput }
574574 if ( ! temp_fileInput ) {
575575 //alert('Please select a JSON file!');
576- actions . output_log ( "Please select a valid lightspeedflow or image file!" )
576+ actions . output_log ( "Please select a valid lightdiffusionflow or image file!" )
577577 return ;
578578 }
579579
@@ -590,11 +590,11 @@ state.core = (function () {
590590 "img_path" :file_name
591591 } )
592592 }
593- fetch ( `/lightspeedflow /local/png_info` , data )
593+ fetch ( `/lightdiffusionflow /local/png_info` , data )
594594 . then ( response => response . json ( ) )
595595 . then ( data => {
596596 console . log ( data )
597- actions . importLightSpeedFlow ( data )
597+ actions . importLightDiffusionFlow ( data )
598598 } ) ;
599599 }
600600 else {
@@ -604,7 +604,7 @@ state.core = (function () {
604604 const reader = new FileReader ( ) ;
605605 reader . onload = function ( event ) {
606606 console . log ( event )
607- actions . importLightSpeedFlow ( event . target . result )
607+ actions . importLightDiffusionFlow ( event . target . result )
608608 } ;
609609 try { reader . readAsText ( file ) ; } catch ( error ) {
610610 console . log ( "read from python" )
@@ -616,27 +616,27 @@ state.core = (function () {
616616 "file_path" :temp_fileInput . name
617617 } )
618618 }
619- fetch ( `/lightspeedflow /local/read_file` , data )
619+ fetch ( `/lightdiffusionflow /local/read_file` , data )
620620 . then ( response => response . json ( ) )
621621 . then ( data => {
622622 //console.log(data)
623- actions . importLightSpeedFlow ( data )
623+ actions . importLightDiffusionFlow ( data )
624624 } ) ;
625625 }
626626
627627 }
628628 }
629629 return fileInput
630630 } ,
631- importLightSpeedFlow : function ( inputData ) {
631+ importLightDiffusionFlow : function ( inputData ) {
632632
633633 forEachElement_WithoutTabs ( IMAGES_WITHOUT_PREFIX , ( image_id ) => {
634634 state . utils . clearImage ( getElement ( image_id ) ) ;
635635 } ) ;
636636
637637 let json_obj = { }
638638 try { json_obj = JSON . parse ( inputData ) } catch ( error ) {
639- actions . output_log ( "Please select a valid lightspeedflow or image file!" )
639+ actions . output_log ( "Please select a valid lightdiffusionflow or image file!" )
640640 return ;
641641 }
642642 console . log ( json_obj )
@@ -685,13 +685,15 @@ state.core = (function () {
685685
686686 } ,
687687 output_log : function ( msg , style = "" ) {
688- fetch ( `/lightspeedflow/local/output_log?msg=${ msg } &style=${ style } ` )
688+ fetch ( `/lightdiffusionflow/local/output_log?msg=${ msg } &style=${ style } ` ) . then ( ( ) => {
689+ gradioApp ( ) . getElementById ( "txt2img_invisible_refresh_log" ) . click ( ) ;
690+ } ) ;
689691 } ,
690692 output_warning : function ( msg , style = "color:Orange;" ) {
691- fetch ( `/lightspeedflow/local/ output_log? msg= ${ msg } & style= ${ style } ` )
693+ actions . output_log ( msg , style )
692694 } ,
693695 output_error : function ( msg , style = "color:Tomato;" ) {
694- fetch ( `/lightspeedflow/local/ output_log? msg= ${ msg } & style= ${ style } ` )
696+ actions . output_log ( msg , style )
695697 }
696698 } ;
697699
0 commit comments