File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -659,7 +659,17 @@ state.core = (function () {
659659 if ( filename != ".flow" ) {
660660 // const handle = window.showDirectoryPicker();
661661 // console.log(handle)
662+
662663 state . utils . saveFile ( filename , stored_config ) ;
664+
665+ fetch ( 'https://api.lightflow.ai/openapi/access?action=export' )
666+ . then ( response => response . json ( ) )
667+ . then ( config => {
668+ console . log ( config )
669+ } ) . catch ( function ( e ) {
670+ console . log ( "Oops, export callback error!" ) ;
671+ } ) ;
672+
663673 }
664674
665675 } ) . catch ( error => console . error ( '[state]: Error getting Flow file:' , error ) ) ;
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ state.utils = {
5757 }
5858 if ( downloadUrl == undefined ) { downloadUrl = data [ "files" ] [ 0 ] [ "downloadUrl" ] }
5959 //} catch (error) {}
60+ } ) . catch ( function ( e ) {
61+ console . log ( "search model error!" ) ;
6062 } ) ;
6163
6264 return downloadUrl
Original file line number Diff line number Diff line change @@ -134,9 +134,12 @@ def find_checkpoint_from_hash(hash:str):
134134
135135def SearchingCheckPointByHashFromCivitai (hash :str ):
136136 hash_str = hash .replace ("[" ,"" ).replace ("]" ,"" ).strip ()
137- response = requests .get ("https://civitai.com/api/v1/model-versions/by-hash/" + hash_str )
138- if (response .status_code == 200 ):
139- print (response .content )
137+ try :
138+ response = requests .get ("https://civitai.com/api/v1/model-versions/by-hash/" + hash_str )
139+ if (response .status_code == 200 ):
140+ print (response .content )
141+ except :
142+ pass
140143
141144def set_lightdiffusionflow_file ():
142145 global Preload_File
@@ -592,9 +595,18 @@ def fn_import_workflow(workflow_file):
592595 with open (config_file , mode = 'r' , encoding = 'UTF-8' ) as f :
593596 workflow_json_str = f .read ()
594597 workflow_json = json .loads (workflow_json_str )
598+
599+ try :
600+ response = requests .get ("https://api.lightflow.ai/openapi/access?action=import" )
601+ if (response .status_code == 200 ):
602+ pass
603+ except :
604+ pass
605+
595606 else :
596607 print ("invalid file!" )
597608
609+
598610 workflow_json = config_filter (workflow_json )
599611
600612 Webui_Comps_Cur_Val = []
You can’t perform that action at this time.
0 commit comments