@@ -1068,9 +1068,23 @@ export function useCoreCommands(): ComfyCommand[] {
1068
1068
{
1069
1069
id : 'Comfy.BrowseModelAssets' ,
1070
1070
icon : 'pi pi-folder-open' ,
1071
- label : 'Browse Model Assets' ,
1071
+ label : 'Experimental: Browse Model Assets' ,
1072
1072
versionAdded : '1.28.3' ,
1073
1073
function : async ( ) => {
1074
+ if ( ! useSettingStore ( ) . get ( 'Comfy.Assets.UseAssetAPI' ) ) {
1075
+ const confirmed = await dialogService . confirm ( {
1076
+ title : 'Enable Asset API' ,
1077
+ message :
1078
+ 'The Asset API is currently disabled. Would you like to enable it?' ,
1079
+ type : 'default'
1080
+ } )
1081
+
1082
+ if ( ! confirmed ) return
1083
+
1084
+ const settingStore = useSettingStore ( )
1085
+ await settingStore . set ( 'Comfy.Assets.UseAssetAPI' , true )
1086
+ await workflowService . reloadCurrentWorkflow ( )
1087
+ }
1074
1088
const assetBrowserDialog = useAssetBrowserDialog ( )
1075
1089
await assetBrowserDialog . browse ( {
1076
1090
assetType : 'models' ,
@@ -1088,6 +1102,22 @@ export function useCoreCommands(): ComfyCommand[] {
1088
1102
}
1089
1103
} )
1090
1104
}
1105
+ } ,
1106
+ {
1107
+ id : 'Comfy.ToggleAssetAPI' ,
1108
+ icon : 'pi pi-database' ,
1109
+ label : ( ) =>
1110
+ `Experimental: ${
1111
+ useSettingStore ( ) . get ( 'Comfy.Assets.UseAssetAPI' )
1112
+ ? 'Disable'
1113
+ : 'Enable'
1114
+ } AssetAPI`,
1115
+ function : async ( ) => {
1116
+ const settingStore = useSettingStore ( )
1117
+ const current = settingStore . get ( 'Comfy.Assets.UseAssetAPI' ) ?? false
1118
+ await settingStore . set ( 'Comfy.Assets.UseAssetAPI' , ! current )
1119
+ await useWorkflowService ( ) . reloadCurrentWorkflow ( ) // ensure changes take effect immediately
1120
+ }
1091
1121
}
1092
1122
]
1093
1123
0 commit comments